* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: #f6f7f9;
    color: #17202a;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: auto;
}

.header {
    background: #ffffff;
    border-bottom: 1px solid #e7e9ed;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 12px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.nav a:hover {
    opacity: .7;
}

.main-content {
    min-height: calc(100vh - 150px);
    padding-top: 30px;
    padding-bottom: 50px;
}

.hero {
    min-height: 260px;
    border-radius: 28px;
    padding: 45px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #edf2f7
        );
    border: 1px solid #e3e7ec;
    margin-bottom: 40px;
}

.hero h1 {
    margin: 10px 0;
    font-size: clamp(30px, 5vw, 52px);
}

.hero p {
    margin: 0;
    color: #667085;
    font-size: 17px;
    line-height: 2;
}

.eyebrow {
    color: #6875f5;
    font-size: 13px;
    font-weight: 700;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 8px 0 0;
}

.cart-badge {
    background: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 13px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .07);
}

.product-image {
    height: 230px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    color: #98a2b3;
    font-weight: 700;
}

.product-body {
    padding: 17px;
}

.product-body h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

.product-description {
    color: #667085;
    font-size: 13px;
    line-height: 1.9;
    min-height: 50px;
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

.price {
    font-size: 14px;
    white-space: nowrap;
}

.btn {
    border: 0;
    cursor: pointer;
    border-radius: 12px;
    padding: 11px 15px;
    background: #17202a;
    color: white;
    font-weight: 700;
}

.btn:hover {
    opacity: .88;
}

.btn.light {
    background: #eef1f4;
    color: #17202a;
}

.btn.danger {
    background: #b42318;
}

.btn.disabled {
    background: #d0d5dd;
    cursor: not-allowed;
}

.btn.full {
    width: 100%;
}

.auth-box,
.checkout,
.page {
    max-width: 650px;
    margin: 30px auto;
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 24px;
    padding: 28px;
}

.auth-box h1,
.checkout h1,
.page h1 {
    margin-top: 0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form label {
    font-size: 14px;
    font-weight: 700;
    margin-top: 8px;
}

.form input,
.form textarea {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 13px;
    font: inherit;
    outline: none;
    background: #fff;
}

.form input:focus,
.form textarea:focus {
    border-color: #6875f5;
}

.form-footer {
    text-align: center;
    color: #667085;
}

.form-footer a {
    color: #6875f5;
    font-weight: 700;
}

.error,
.success {
    border-radius: 12px;
    padding: 12px;
    margin: 15px 0;
    font-size: 14px;
}

.error {
    background: #fef3f2;
    color: #b42318;
}

.success {
    background: #ecfdf3;
    color: #027a48;
}

.empty {
    background: #ffffff;
    border: 1px dashed #d0d5dd;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    color: #667085;
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.checkout-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    padding: 14px;
}

.checkout-total {
    border-top: 1px solid #e4e7ec;
    padding: 18px 0;
    font-size: 18px;
}

.order-card {
    border: 1px solid #e4e7ec;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 12px;
    display: grid;
    gap: 10px;
}

.order-card small {
    display: block;
    color: #98a2b3;
    margin-top: 6px;
}

.footer {
    background: #17202a;
    color: white;
    padding: 30px 0;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

@media (max-width: 1000px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .container {
        width: min(100% - 20px, 600px);
    }

    .header-inner {
        min-height: auto;
        padding: 12px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        gap: 15px;
    }

    .hero {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-image {
        height: 180px;
    }

    .product-body {
        padding: 13px;
    }

    .product-bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .footer .container {
        flex-direction: column;
    }
}

@media (max-width: 430px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 240px;
    }

    .auth-box,
    .checkout,
    .page {
        padding: 20px;
        border-radius: 18px;
    }
}
