@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn-variable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --white: #fff;
    --soft: #f3f5f8;
    --navy: #17263c;
    --red: #e52535;
    --red-dark: #c81d2c;
    --muted: #667085;
    --border: #e3e8ef;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(23, 38, 60, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--navy);
    background: var(--white);
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 20px; }
.section { margin-block: 40px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; inset-block-start: -60px; inset-inline-start: 12px; z-index: 100;
    background: var(--navy); color: var(--white); padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { inset-block-start: 12px; }

/* آیکن‌ها */
.icon {
    width: 1.25em; height: 1.25em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.icon-lg { width: 36px; height: 36px; }
.icon-xl { width: 44px; height: 44px; }
.icon-2xl { width: 96px; height: 96px; stroke-width: 1.2; }
/* فلش «بعدی» در RTL به چپ اشاره می‌کند؛ آیکن chevron همین‌طور کشیده شده است */

/* دکمه‌ها */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border: 1px solid transparent; border-radius: 10px;
    font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-outline-light { border-color: rgba(255, 255, 255, .8); color: var(--white); padding: 6px 18px; }
.promo:hover .btn-outline-light { background: var(--white); color: var(--navy); }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 0; background: transparent; color: inherit;
    border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { background: var(--soft); }

/* هدر */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 18px; font-weight: 800; }
.brand-text small { font-size: 11px; color: var(--muted); }

.main-nav { display: flex; gap: 22px; font-weight: 500; }
.main-nav a { padding-block: 6px; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--red); }
.main-nav a.is-active { color: var(--red); border-color: var(--red); }

.search {
    display: flex; align-items: center; margin-inline-start: auto;
    width: 280px; background: var(--soft); border-radius: 999px; padding-inline: 16px 4px;
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; padding: 9px 0; color: inherit; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.account-link { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 8px 10px; border-radius: 10px; }
.account-link:hover { background: var(--soft); }

.nav-toggle { display: none; margin-inline-start: auto; }

/* بنر اصلی */
.hero { background: linear-gradient(120deg, var(--navy) 0%, #24385a 100%); color: var(--white); overflow: hidden; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 380px; padding-block: 40px; }
.hero-text { max-width: 560px; }
.eyebrow { color: #ffb3ba; font-weight: 600; margin-bottom: 12px; }
.hero h1 { font-size: clamp(28px, 4.2vw, 48px); line-height: 1.35; font-weight: 800; }
.accent { color: #ff5a67; }
.lead { margin-block: 18px 28px; color: #d5dce8; font-size: 16px; }
.hero-mark { width: 320px; height: 320px; opacity: .95; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35)); background: var(--white); border-radius: 50%; padding: 8px; }

/* دسته‌بندی‌ها */
.cat-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; }
.cat-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    min-height: 118px; padding: 12px 8px; text-align: center; font-size: 13px; font-weight: 600;
    background: var(--soft); border: 1px solid transparent; border-radius: var(--radius); transition: border-color .15s, color .15s;
}
.cat-card:hover { border-color: var(--red); color: var(--red); }

/* عنوان بخش‌ها */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-head h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ""; width: 18px; height: 3px; background: var(--red); border-radius: 2px; }
.more-link { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.more-link:hover { color: var(--red); }

/* کارت محصول */
.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.product-card {
    position: relative; display: flex; flex-direction: column; padding: 14px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.badge {
    position: absolute; inset-block-start: 12px; inset-inline-start: 12px; z-index: 1;
    background: var(--red); color: var(--white); font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
}
.product-thumb {
    display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3;
    background: var(--soft); color: #aab4c4; border-radius: 10px; margin-bottom: 12px;
}
.product-brand { font-size: 12px; color: var(--muted); text-align: center; }
.product-name { font-size: 15px; font-weight: 700; text-align: center; }
.product-meta { font-size: 12px; color: var(--muted); text-align: center; margin-block: 2px 8px; }
.product-price { color: var(--red); font-weight: 800; text-align: center; margin-bottom: 12px; }
.product-price small { font-weight: 500; font-size: 12px; }
.product-card .btn { margin-top: auto; padding-block: 8px; font-size: 13px; }

/* بنرهای تبلیغاتی */
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.promo {
    display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 24px;
    min-height: 150px; padding: 22px; color: var(--white); border-radius: var(--radius);
}
.promo h3 { font-size: 20px; font-weight: 800; }
.promo p { opacity: .85; font-size: 13px; }
.promo-navy { background: linear-gradient(135deg, #24385a, var(--navy)); }
.promo-dark { background: linear-gradient(135deg, #2b2f36, #15181d); }
.promo-red { background: linear-gradient(135deg, var(--red), #a4121f); }

/* مزیت‌ها */
.perks { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); }
.perks li { display: flex; align-items: center; gap: 14px; padding: 20px; }
.perks li + li { border-inline-start: 1px solid var(--border); }
.perks .icon { color: var(--red); }
.perks strong { display: block; font-size: 14px; }
.perks small { color: var(--muted); font-size: 12px; }


/* واکنش‌گرا */
@media (max-width: 1100px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .main-nav { gap: 14px; font-size: 14px; }
    .search { width: 200px; }
}

@media (max-width: 860px) {
    .header-row { flex-wrap: wrap; gap: 8px 12px; padding-block: 10px; }
    .nav-toggle { display: inline-flex; order: 2; margin-inline-start: auto; }
    .header-actions { order: 3; }
    .main-nav {
        display: none; order: 5; flex-direction: column; gap: 0; width: 100%;
        border-top: 1px solid var(--border);
    }
    .main-nav.is-open { display: flex; }
    .main-nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
    .search { order: 4; width: 100%; margin-inline-start: 0; }
    .account-link span { display: none; }
    .hero-mark { display: none; }
    .hero-inner { min-height: 300px; }
    .promo-grid { grid-template-columns: 1fr; }
    .perks { grid-template-columns: repeat(2, 1fr); }
    .perks li:nth-child(3) { border-inline-start: 0; }
    .perks li:nth-child(n + 3) { border-top: 1px solid var(--border); }
}

@media (max-width: 560px) {
    .container { padding-inline: 14px; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-card { padding: 10px; }
    .perks { grid-template-columns: 1fr; }
    .perks li + li { border-inline-start: 0; border-top: 1px solid var(--border); }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* فوتر */
.site-footer { background: var(--soft); margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-block: 32px; }
.footer-brand { display: flex; align-items: flex-start; gap: 14px; }
.footer-brand strong { font-size: 16px; }
.footer-brand p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.footer-nav a:hover { color: var(--red); }
.footer-contact { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.footer-contact li { display: flex; align-items: center; gap: 8px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.socials { display: flex; gap: 4px; }

/* بنر اصلی با تصویر */
.hero-img { max-width: 520px; width: 100%; height: auto; border-radius: var(--radius); object-fit: cover; }

/* صفحات داخلی */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a:hover { color: var(--red); }
.page-title { font-size: 26px; font-weight: 800; margin-bottom: 20px; }
.muted { color: var(--muted); font-size: 14px; }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }

.filters { display: flex; gap: 10px; margin-bottom: 24px; }
.filters input, .filters select {
    font: inherit; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); color: inherit;
}
.filters input { flex: 1; min-width: 160px; }
.btn-light { background: var(--soft); color: var(--navy); }
.btn-light:hover { background: var(--border); }

.product-grid-4 { grid-template-columns: repeat(4, 1fr); }
.product-thumb { overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-name a:hover { color: var(--red); }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; }
.pager-info { color: var(--muted); font-size: 13px; }

/* صفحه محصول */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.gallery-main { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--soft); border-radius: var(--radius); overflow: hidden; color: #aab4c4; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 72px; height: 72px; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--soft); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.info { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.info .page-title { margin-bottom: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--soft); border-radius: 999px; padding: 2px 12px; font-size: 12px; }
.detail-price { color: var(--red); font-size: 24px; font-weight: 800; }
.detail-price small { font-size: 14px; font-weight: 500; }
.detail-block { margin-block: 28px; }
.detail-block h2 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.specs { width: 100%; max-width: 640px; border-collapse: collapse; }
.specs th, .specs td { padding: 10px 14px; text-align: start; border: 1px solid var(--border); font-size: 14px; }
.specs th { width: 35%; background: var(--soft); font-weight: 600; }
.prose { line-height: 2; }
.prose img { height: auto; }

/* واکنش‌گرای صفحات داخلی و فوتر (بعد از قوانین پایه تا اولویت داشته باشد) */
@media (max-width: 1100px) {
    .product-grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .product-detail { grid-template-columns: 1fr; }
    .filters { flex-wrap: wrap; }
}
@media (max-width: 560px) {
    .product-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
