/* ============ متغیرها: ظاهر کل سایت از اینجا تغییر می‌کند ============ */
:root {
    --bg: #ffffff;
    --bg-soft: #f7f5f2;
    --text: #1c1c1c;
    --muted: #7a7670;
    --line: #e9e6e1;
    --accent: #c8693a;        /* رنگ تأکید: نارنجی گرم */
    --accent-dark: #a9532b;
    --radius: 10px;
    --container: 1180px;
    --font: 'Vazirmatn', Tahoma, sans-serif;
}

/* ============ پایه ============ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main { flex: 1 0 auto; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.4; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 20px;
}

.muted { color: var(--muted); }

/* ============ دکمه‌ها ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    border: 1px solid var(--text);
    border-radius: var(--radius);
    background: var(--text);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn--outline { background: transparent; color: var(--text); }
.btn--outline:hover { color: #fff; }
.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ============ نوار اعلان ============ */
.topbar {
    background: var(--text);
    color: #fff;
    text-align: center;
    font-size: 12.5px;
    padding: 7px 12px;
}

/* ============ هدر ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 24px;
}

.logo {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.3px;
}

.nav { display: flex; gap: 28px; }
.nav a {
    font-size: 14px;
    color: var(--muted);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}
.nav a:hover,
.nav a.is-active { color: var(--text); border-color: var(--accent); }

.header__actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s;
}
.icon-btn:hover { background: var(--bg-soft); }

.badge {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 10.5px;
    line-height: 17px;
    text-align: center;
}

.menu-btn { display: none; }

/* ============ پیام‌های فلش ============ */
.alert {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
}
.alert--success { background: #eef6ef; color: #2c6b3a; }
.alert--error   { background: #fbeeee; color: #a33a3a; }

/* ============ فرم‌ها (برای صفحات بعدی) ============ */
.input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    transition: border-color .2s;
}
.input:focus { outline: none; border-color: var(--accent); }

/* ============ کارت محصول (برای صفحات بعدی) ============ */
.grid { display: grid; gap: 24px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.product-card { display: block; }
.product-card__img {
    position: relative;
    aspect-ratio: 4 / 5;
    background: var(--bg-soft);
    border-radius: var(--radius);
    overflow: hidden;
}
.product-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .product-card__img img { transform: scale(1.04); }
.product-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #cfc9c1;
}
.product-card__brand { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); }
.product-card__name { margin: 2px 0 4px; font-size: 14.5px; font-weight: 500; }
.product-card__price { font-size: 14px; font-weight: 600; }
.product-card__price small { font-size: 12px; font-weight: 400; color: var(--muted); }

.tag {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    padding: 2px 10px;
    border-radius: 20px;
    background: #fff;
    font-size: 11.5px;
    color: var(--muted);
}

/* ============ بخش‌ها ============ */
.section { padding: 64px 0; }
.section__title { font-size: 24px; margin: 0; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.section-head a { font-size: 13.5px; color: var(--muted); transition: color .2s; }
.section-head a:hover { color: var(--accent); }

/* ============ فوتر ============ */
.footer {
    margin-top: 80px;
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    padding-top: 56px;
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: 40px;
}
.footer h4 { font-size: 15px; margin-bottom: 14px; }
.footer li { margin-bottom: 8px; font-size: 14px; }
.footer li a { color: var(--muted); transition: color .2s; }
.footer li a:hover { color: var(--accent); }
.footer .muted { font-size: 14px; margin-top: 10px; }

.footer__bottom {
    margin-top: 40px;
    padding-block: 20px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}

/* ============ ریسپانسیو ============ */
@media (max-width: 900px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .menu-btn { display: inline-flex; }

    .nav {
        position: absolute;
        top: 100%;
        inset-inline: 0;
        flex-direction: column;
        gap: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    .nav a { padding: 14px 20px; border: 0; border-top: 1px solid var(--line); }

    /* باز شدن منو بدون جاوااسکریپت */
    .menu-toggle:checked ~ .nav { max-height: 360px; }

    .header__inner { gap: 8px; }
    .logo { margin-inline-end: auto; }
}

@media (max-width: 520px) {
    .footer__grid { grid-template-columns: 1fr; gap: 28px; }
    .section { padding: 44px 0; }
}
