* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* نام‌های قدیمی؛ مقدارها از css/tokens.css (DESIGN.md) میان */
    --primary: var(--color-primary);
    --primary-dark: var(--color-primary-hover);
    --dark: var(--color-ink);
    --text: var(--color-text);
    --muted: var(--color-muted);
    --light: var(--color-bg-soft);
    --white: var(--color-bg);
    --border: var(--color-border);
    --danger: var(--color-danger);
    --accent: var(--color-accent);
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--text);
    line-height: 1.8;
}

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

button,
input {
    font-family: inherit;
}

.container {
    width: min(1180px, 92%);
    margin: 0 auto;
}


/* ================= HEADER ================= */

.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 25px;
    font-weight: 800;
    color: var(--dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 14px;
    display: inline-block;
}

.logo span {
    color: var(--primary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.nav a:hover,
.nav a.active {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-btn,
.cart-btn {
    border: 0;
    background: var(--light);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    font-size: 18px;
}

.cart-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--danger);
    color: white;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ================= SEARCH ================= */

.search-section {
    background: var(--light);
    padding: 18px 0;
}

.search-box {
    max-width: 700px;
    margin: auto;
    display: flex;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 15px 18px;
    font-size: 13px;
}

.search-box button {
    border: 0;
    background: var(--primary);
    color: white;
    padding: 0 25px;
    cursor: pointer;
    font-weight: 600;
}


/* ================= HERO ================= */

.hero {
    background: linear-gradient(135deg, #ecfdf5, #f7fee7);
    padding: 70px 0;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.hero-text {
    flex: 1;
}

.hero-label {
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}

.hero h1 {
    color: var(--dark);
    font-size: 45px;
    line-height: 1.4;
    margin: 15px 0;
}

.hero p {
    max-width: 520px;
    color: var(--muted);
    font-size: 16px;
}

.hero-button {
    display: inline-block;
    margin-top: 25px;
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.hero-button:hover {
    background: var(--primary-dark);
}

.hero-image {
    width: 360px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-card {
    width: 230px;
    height: 230px;
    background: white;
    border-radius: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}


/* ================= SECTIONS ================= */

.section {
    padding: 70px 0;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 30px;
}

.section-label {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.section h2 {
    margin-top: 5px;
    color: var(--dark);
    font-size: 25px;
}

.view-all {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}


/* ================= CATEGORIES ================= */

.categories {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.category-card {
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px 10px;
    text-align: center;
    transition: 0.2s;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.category-icon {
    width: 65px;
    height: 65px;
    background: var(--light);
    border-radius: 50%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.category-card h3 {
    color: var(--dark);
    font-size: 14px;
    margin-top: 10px;
}

.category-card span {
    color: var(--muted);
    font-size: 11px;
}


/* ================= PRODUCTS ================= */

.products-section {
    background: #fafafa;
}

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

.product-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 17px;
    overflow: hidden;
    position: relative;
    transition: 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.07);
}

.product-image {
    height: 210px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 85px;
}

.product-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #dcfce7;
    color: var(--primary-dark);
    border-radius: 8px;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 600;
}

.product-tag.out-of-stock-tag {
    background: #fdecec;
    color: #c62828;
}

.product-info {
    padding: 18px;
}

.product-brand {
    color: var(--primary);
    font-size: 11px;
}

.product-info h3 {
    color: var(--dark);
    font-size: 15px;
    margin-top: 4px;
}

.product-description {
    color: var(--muted);
    font-size: 11px;
}

.product-bottom {
    margin-top: 20px;
    display: flex;
    align-items: end;
    justify-content: space-between;
}

.price {
    display: flex;
    flex-direction: column;
}

.price span {
    color: var(--muted);
    font-size: 10px;
}

.price strong {
    color: var(--dark);
    font-size: 14px;
}

.add-cart {
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 25px;
    cursor: pointer;
}


/* ================= OFFER ================= */

.offer-section {
    padding: 50px 0;
    background: var(--dark);
    color: white;
}

.offer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.offer-content span {
    color: #86efac;
    font-size: 13px;
    font-weight: 600;
}

.offer-content h2 {
    font-size: 28px;
    margin: 5px 0;
}

.offer-content p {
    color: #cbd5ce;
    font-size: 13px;
}

.offer-content a {
    background: white;
    color: var(--dark);
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}


/* ================= FOOTER ================= */

.footer {
    background: #111712;
    color: white;
    padding-top: 55px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
}

.footer-brand p {
    color: #9ca3af;
    max-width: 300px;
    font-size: 12px;
    margin-top: 12px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.footer-column h3 {
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-column a,
.footer-column span {
    color: #9ca3af;
    font-size: 12px;
}

.footer-bottom {
    border-top: 1px solid #28302a;
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 11px;
}


/* ================= RESPONSIVE ================= */

@media (max-width: 900px) {

    .categories {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 35px;
    }

}


@media (max-width: 600px) {

    .header-content {
        min-height: 65px;
    }

    .nav {
        display: none;
    }

    .hero {
        padding: 45px 0;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero p {
        margin: auto;
    }

    .hero-image {
        width: 100%;
        height: 200px;
    }

    .hero-card {
        width: 160px;
        height: 160px;
        font-size: 70px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .categories {
        grid-template-columns: repeat(2, 1fr);
    }

    .products {
        grid-template-columns: 1fr;
    }

    .section-header {
        align-items: center;
    }

    .offer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

}

.user-btn {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--light);

    border-radius: 12px;

    text-decoration: none;

    font-size: 19px;

    transition: 0.3s;
}


.user-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.change-status-btn {
    margin-top: 10px;

    margin-right: 8px;

    border: 1px solid var(--primary);

    background: white;

    color: var(--primary);

    padding: 9px 15px;

    border-radius: 8px;

    font-family: inherit;

    font-size: 11px;

    cursor: pointer;

    transition: 0.3s;
}


.change-status-btn:hover {
    background: var(--primary);

    color: white;
}

.cancel-order-btn {
    margin-top: 10px !important;
    margin-right: 8px !important;

    border: 1px solid #d64545 !important;

    background: white !important;

    color: #d64545 !important;

    padding: 9px 15px !important;

    border-radius: 8px !important;

    font-family: inherit !important;

    font-size: 11px !important;

    cursor: pointer !important;

    transition: 0.3s !important;
}


.cancel-order-btn:hover {
    background: #d64545 !important;

    color: white !important;
}

/* =========================
   عکس واقعی محصول
========================= */

.product-image-page {

    overflow: hidden;

}


.product-image-page img {

    width: 100%;

    height: 100%;

    display: block;

    object-fit: contain;

}

.cart-qty-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #dc2626;
    color: #fff;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 2;
}
