/* ============================================================
   کالا برق جوکار — استایل اصلی سایت
   ============================================================ */

@font-face {
    font-family: 'IRANSansDN';
    src: url('../fonts/iransansdnlight.woff') format('woff');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansDN';
    src: url('../fonts/iransansdn.woff') format('woff');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansDN';
    src: url('../fonts/iransansdnbold.woff') format('woff');
    font-weight: 700;
    font-display: swap;
}

:root {
    --dark: #1b1b1b;
    --dark-2: #262626;
    --yellow: #f8c630;
    --yellow-dark: #e6ac0b;
    --yellow-light: #fff3d6;
    --bg: #f3f4f6;
    --white: #ffffff;
    --text: #262626;
    --muted: #767676;
    --border: #e7e7e7;
    --danger: #e5484d;
    --success: #2fa84f;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'IRANSansDN', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    font-size: 15px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--yellow); color: var(--dark); }
.btn-primary:hover { background: var(--yellow-dark); transform: translateY(-2px); }
.btn-dark { background: var(--dark); color: var(--white); }
.btn-dark:hover { background: #000; transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--dark); border: 2px solid var(--dark); }
.btn-outline:hover { background: var(--dark); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------------- Flash messages ---------------- */
.flash { padding: 14px 18px; border-radius: var(--radius-sm); margin: 16px 0; font-weight: 600; }
.flash-success { background: #e7f8ec; color: var(--success); border: 1px solid #bfe9c9; }
.flash-error { background: #fdeceb; color: var(--danger); border: 1px solid #f6c6c4; }
.flash-info { background: var(--yellow-light); color: #7a5b00; border: 1px solid #f2dd9c; }

/* ============================================================
   Header
   ============================================================ */
.site-header { background: var(--dark-2); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.topbar { background: var(--dark); color: #ccc; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.topbar-link { color: var(--yellow); font-weight: 600; }
.topbar-phone { direction: ltr; }

.promo-banner { background: var(--yellow); color: var(--dark); text-align: center; }
.promo-banner-inner { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 9px 20px; flex-wrap: wrap; font-size: 13.5px; font-weight: 700; }
.promo-code { background: var(--dark); color: var(--yellow); padding: 3px 12px; border-radius: 999px; font-size: 12.5px; }

.navbar { display: flex; align-items: center; gap: 20px; padding: 14px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; flex-shrink: 0; white-space: nowrap; color: var(--white); }
.logo img { width: 40px; height: 40px; }

.main-nav { flex: 1; min-width: 0; }
.main-nav ul { display: flex; gap: 18px; align-items: center; flex-wrap: nowrap; }
.main-nav a { font-weight: 600; font-size: 14px; padding: 8px 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; color: #ddd; }
.main-nav a:hover { color: var(--yellow); }
.arrow-icon { width: 10px; height: 10px; filter: brightness(0) invert(1); }
/* منوی موبایل روی یک پس‌زمینه‌ی سفید باز می‌شود، پس رنگ متن و آیکون فلش برمی‌گردد به حالت تیره اصلی */
.main-nav.open a { color: var(--text); }
.main-nav.open .arrow-icon { filter: none; }

.has-dropdown { position: relative; }
.dropdown-menu-thumb {
    width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
    background: #333; display: flex; align-items: center; justify-content: center;
}
.dropdown-menu-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- Mega menu دسته‌بندی‌ها (هدر) ---------------- */
.mega-menu {
    position: absolute; top: 100%; right: 0; background: var(--dark-2);
    box-shadow: var(--shadow-lg); border-radius: var(--radius-sm);
    display: none; z-index: 60; overflow: hidden;
}
/* :hover فقط روی دسکتاپ فعاله؛ رو موبایل صرفاً با کلاس .open (از main.js) کنترل می‌شه
   تا حالت hover لمسی مرورگرهای موبایل باعث باز موندن ناخواسته منو نشه */
@media (min-width: 769px) {
    .has-dropdown:hover .mega-menu { display: flex; }
}
.mega-rail {
    display: flex; flex-direction: column; gap: 3px; padding: 10px; min-width: 270px; flex-shrink: 0;
    max-height: 500px; overflow-y: auto; background: var(--dark);
}
/* نکته‌ی مهم: همه‌ی این سلکتورها با «.mega-menu» شروع می‌شوند (نه فقط .mega-rail-item/.mega-col-title تنها)
   چون این لینک‌ها داخل main-nav هستند و قانون عمومی‌تر «.main-nav a» (با specificity کلاس+تگ) در غیر این صورت
   رنگ/padding آن‌ها را override می‌کرد — این باگ باعث می‌شد مثلاً متن دکمه‌ی زرد «مشاهده همه محصولات» به رنگ خاکستری روشن (تقریباً نامرئی روی زرد) دربیاید */
.mega-menu .mega-rail-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: #eee; white-space: normal; }
.mega-menu .mega-rail-item.active, .mega-menu .mega-rail-item:hover { background: var(--yellow); color: var(--dark); }
.mega-menu .mega-rail-item.active .dropdown-menu-thumb, .mega-menu .mega-rail-item:hover .dropdown-menu-thumb { background: rgba(0,0,0,.12); }

.mega-panels { position: relative; }
.mega-panel { display: none; padding: 26px 30px; width: 660px; max-width: 62vw; max-height: 500px; overflow-y: auto; }
.mega-panel.active { display: block; }
.mega-panel-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 22px; }
.mega-col { display: flex; flex-direction: column; gap: 4px; }
.mega-menu .mega-col-title {
    display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 700; font-size: 14px;
    padding-inline-start: 10px; border-inline-start: 3px solid var(--yellow); margin-bottom: 8px; white-space: normal;
}
.mega-col-title-thumb {
    width: 24px; height: 24px; border-radius: 7px; overflow: hidden; flex-shrink: 0;
    background: #3a3a3a; display: flex; align-items: center; justify-content: center;
}
.mega-col-title-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mega-menu .mega-col a:not(.mega-col-title) {
    display: block; color: #d6d6d6; font-size: 13.5px; padding: 7px 12px; border-radius: 7px; line-height: 1.6; white-space: normal;
    transition: background .15s ease, color .15s ease;
}
.mega-menu .mega-col a:not(.mega-col-title):hover { background: rgba(248, 198, 48, .14); color: var(--yellow); }
.mega-empty { color: #999; font-size: 13.5px; padding: 10px 0 4px; }
.mega-menu .mega-viewall {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; background: var(--yellow); color: var(--dark);
    font-weight: 700; font-size: 13px; padding: 10px 20px; border-radius: 999px; transition: background .15s ease, transform .15s ease;
}
.mega-menu .mega-viewall:hover { background: var(--yellow-dark); color: var(--dark); transform: translateY(-1px); }
.mega-viewall .arrow { transition: transform .15s ease; }
.mega-viewall:hover .arrow { transform: translateX(-4px); }

/* رو موبایل، منوی همبرگر پس‌زمینه‌ی سفید داره ولی این زیرمنوی دسته‌ها داخلش هنوز تیره است؛
   بدون این قانون، رنگ متن با قانون کلی‌تر «.main-nav.open a» به تیره (هم‌رنگ پس‌زمینه) برمی‌گشت */
.main-nav.open .mega-rail-item { color: #ddd; }
.main-nav.open .mega-rail-item:hover { color: var(--dark); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.search-box { display: flex; align-items: center; background: var(--bg); border-radius: 999px; padding: 8px 14px; }
.search-box input { background: transparent; border: none; outline: none; width: 130px; }
.search-box button { background: none; border: none; cursor: pointer; padding: 0; }
.icon-btn { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 999px; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn img { filter: brightness(0) invert(1); }
.user-name { color: #ddd; }
.cart-btn .badge {
    position: absolute; top: -4px; left: -4px; background: var(--yellow); color: var(--dark);
    font-size: 11px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.cart-btn .badge.hidden { display: none; }

/* ---------------- Toast notifications ---------------- */
.toast-container {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1000;
    display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
    background: var(--dark); color: #fff; padding: 12px 24px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease;
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success::before { content: '✓'; color: var(--yellow); font-weight: 700; }
.toast.toast-error { background: var(--danger); }
.user-name { font-size: 13px; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mobile-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.mobile-toggle span { width: 24px; height: 2px; background: var(--white); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
    background: linear-gradient(180deg, #fff 0%, #fdf6e3 100%);
    padding: 50px 0 30px;
    overflow: hidden;
}
.hero .container { display: flex; align-items: center; gap: 40px; }
.hero-content { flex: 1; }
.hero-content h1 { font-size: 40px; line-height: 1.4; }
.hero-content h1 .accent { color: var(--yellow-dark); position: relative; }
.hero-content h2 { font-size: 24px; margin-top: 14px; color: var(--dark); }
.hero-content p { margin-top: 14px; color: var(--muted); max-width: 480px; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; }
.hero-image { flex: 1; max-width: 460px; }

/* ---------------- Features row ---------------- */
.features {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    margin: -26px auto 40px; max-width: 1180px; padding: 0 20px; position: relative; z-index: 5;
}
.feature-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; display: flex; align-items: center; gap: 14px;
}
.feature-card .icon-wrap {
    width: 54px; height: 54px; border-radius: 50%; background: var(--yellow-light);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.feature-card h4 { font-size: 14.5px; }
.feature-card p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   Section headings
   ============================================================ */
.section { padding: 40px 0; }
.section-head { text-align: center; margin-bottom: 30px; }
.section-head h2 { font-size: 26px; }
.section-head p { color: var(--muted); margin-top: 8px; }
.section-head-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.section-head-row h2 { font-size: 24px; }
.link-more { color: var(--yellow-dark); font-weight: 700; font-size: 14px; }

/* ---------------- Categories showcase (خرید براساس دسته‌بندی) ---------------- */
.categories-showcase { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.category-tile {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
    background: var(--dark-2); background-size: cover; background-position: center;
    border-radius: var(--radius); padding: 26px 14px 20px; overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.category-tile::before {
    /* روی عکس بکگراند (در صورت وجود) یک لایه‌ی تیره می‌کشد تا متن سفید همیشه خوانا بماند */
    content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.55)); z-index: 0;
}
.category-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.category-tile-photo {
    position: relative; z-index: 1; width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
    background: var(--white); box-shadow: 0 0 0 6px rgba(255,255,255,.08); margin-bottom: 16px; transition: transform .2s ease;
}
.category-tile-photo img { width: 100%; height: 100%; object-fit: cover; }
.category-tile:hover .category-tile-photo { transform: scale(1.06); }
.category-tile-name { position: relative; z-index: 1; color: var(--white); font-size: 14.5px; font-weight: 700; margin-bottom: 6px; }
.category-tile-cta { position: relative; z-index: 1; color: #ccc; font-size: 12px; }

/* ---------------- Product grid & cards ---------------- */
.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.products-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.products-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.product-card {
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); position: relative; transition: box-shadow .15s, transform .15s;
    display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.product-thumb { aspect-ratio: 1/1; background: var(--yellow-light); overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
    position: absolute; top: 12px; z-index: 2; font-size: 12px; font-weight: 700;
    padding: 5px 10px; border-radius: 999px;
}
.badge-sale { right: 12px; background: var(--danger); color: #fff; }
.badge-popular { right: 12px; background: #1a56db; color: #fff; }
.badge-out { left: 12px; background: var(--dark); color: #fff; }
.product-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-name { font-weight: 600; font-size: 14px; line-height: 1.6; min-height: 44px; }
.low-stock-note { font-size: 12px; color: var(--danger); font-weight: 600; }
.product-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.price-block { display: flex; align-items: baseline; gap: 8px; }
.price-final { font-weight: 700; font-size: 15px; }
.price-old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.add-cart-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--yellow-light); border: none; border-radius: 999px;
    padding: 11px 14px; font-size: 13px; font-weight: 700; color: var(--dark);
    cursor: pointer; transition: background .15s;
}
.add-cart-btn:hover { background: var(--yellow); }
.add-cart-btn img { width: 18px; height: 18px; flex-shrink: 0; }
.add-cart-btn span { white-space: nowrap; }
.add-cart-btn .btn-text-short { display: none; }
.quick-add-form { margin: 0; }
/* رو کارت‌های دوستونه‌ی موبایل، متن کامل جا نمی‌شود و می‌شکند؛ نسخه‌ی کوتاه‌تر نشان داده می‌شود */
@media (max-width: 560px) {
    .add-cart-btn { padding: 10px 6px; font-size: 12px; }
    .add-cart-btn .btn-text-full { display: none; }
    .add-cart-btn .btn-text-short { display: inline; }
}


/* ---------------- Wholesale banner ---------------- */
.wholesale-banner {
    background: var(--dark); border-radius: var(--radius); overflow: hidden;
    display: flex; align-items: center; gap: 30px; padding: 30px 40px; color: var(--white);
}
.wholesale-banner .badge-visual { flex-shrink: 0; }
.wholesale-banner .badge-visual img { width: 150px; height: 150px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.wholesale-banner .content { flex: 1; min-width: 0; }
.wholesale-banner h3 { font-size: 22px; color: var(--yellow); }
.wholesale-banner p { color: #ccc; margin-top: 10px; max-width: 560px; }
.wholesale-banner .cta { margin-top: 18px; display: flex; align-items: center; gap: 16px; }
.wholesale-banner .phone { direction: ltr; font-weight: 700; color: var(--yellow); }

/* ---------------- Blog cards ---------------- */
.blog-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.blog-card {
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card img { aspect-ratio: 16/10; object-fit: cover; width: 100%; display: block; transition: transform .35s ease; }
.blog-card:hover img { transform: scale(1.06); }
.blog-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.blog-card h4 {
    font-size: 15px; line-height: 1.7; font-weight: 700; color: var(--text); margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 51px;
}
.blog-card .meta { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.blog-card .read-more {
    margin-top: auto; display: inline-flex; align-items: center; gap: 6px;
    color: var(--yellow-dark); font-weight: 700; font-size: 13.5px; align-self: flex-start;
}
.blog-card .read-more .arrow { transition: transform .15s ease; }
.blog-card .read-more:hover .arrow { transform: translateX(-4px); }

/* ---------------- Newsletter ---------------- */
.newsletter-section { padding: 10px 0 40px; }
.newsletter-box {
    background: var(--yellow); border-radius: var(--radius); padding: 34px; text-align: center;
}
.newsletter-box h3 { font-size: 22px; }
.newsletter-box p { margin-top: 8px; color: #4a3900; }
.newsletter-form { display: flex; gap: 10px; max-width: 420px; margin: 18px auto 0; }
.newsletter-form input { flex: 1; padding: 12px 16px; border-radius: 999px; border: none; outline: none; }
.newsletter-form button { padding: 12px 24px; border-radius: 999px; border: none; background: var(--dark); color: var(--white); font-weight: 700; cursor: pointer; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--dark); color: #ccc; padding-top: 44px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 30px; padding-bottom: 30px; }
.footer-col h4 { color: var(--white); font-size: 15px; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a:hover { color: var(--yellow); }
.footer-brand p { font-size: 13px; margin-top: 12px; color: #999; }
.footer-brand .logo { color: var(--white); }
.social-icons { display: flex; gap: 10px; margin-top: 16px; }
.social-icons a { width: 36px; height: 36px; border-radius: 50%; background: #2e2e2e; display: flex; align-items: center; justify-content: center; }
.trust-seals { margin-top: 18px; }
.trust-seals img { max-width: 80px; }
.enamad-placeholder { display: inline-block; opacity: .6; }
.contact-list li { font-size: 13px; }
.footer-bottom { border-top: 1px solid #333; padding: 16px 0; text-align: center; font-size: 13px; color: #888; }

/* ============================================================
   Generic page header (about/contact/consult/wholesale/blog/products)
   ============================================================ */
.page-hero { background: var(--dark); color: var(--white); padding: 40px 0; text-align: center; }
.page-hero h1 { font-size: 26px; color: var(--yellow); }
.page-hero p { margin-top: 8px; color: #bbb; }
.breadcrumb { font-size: 13px; color: #999; margin-top: 10px; }
.breadcrumb a { color: #ccc; }

/* ---------------- Generic card/form ---------------- */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
    outline: none; transition: border-color .15s; background: var(--white);
}
.form-control:focus { border-color: var(--yellow); }
textarea.form-control { resize: vertical; min-height: 110px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ---------------- Layout helpers ---------------- */
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: start; }
.info-list { display: flex; flex-direction: column; gap: 16px; }
.info-item { display: flex; gap: 14px; align-items: flex-start; }
.info-item .dot { width: 40px; height: 40px; border-radius: 50%; background: var(--yellow-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; color: var(--yellow-dark); }

/* ============================================================
   Products listing page
   ============================================================ */
.products-layout { display: grid; grid-template-columns: 250px 1fr; gap: 26px; padding: 30px 0 60px; }
.filter-box { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; height: fit-content; }
.filter-box h4 { font-size: 15px; margin-bottom: 12px; }
.filter-box ul li { margin-bottom: 4px; }
.filter-box ul a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; }
.filter-box ul a:hover, .filter-box ul a.active { background: var(--yellow-light); color: var(--yellow-dark); font-weight: 700; }
.sort-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sort-pill { padding: 8px 16px; border-radius: 999px; background: var(--white); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; color: var(--muted); }
.sort-pill:hover { color: var(--text); }
.sort-pill.active { background: var(--dark); color: var(--white); }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; font-size: 13.5px; color: var(--muted); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ============================================================
   Product detail page
   ============================================================ */
.product-detail { padding: 30px 0 60px; }
.product-gallery { display: flex; flex-direction: column; gap: 12px; }
.product-gallery .main-image { background: var(--yellow-light); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1; }
.product-gallery .main-image img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery .thumbs { display: flex; gap: 10px; }
.product-gallery .thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.product-gallery .thumbs img.active { border-color: var(--yellow); }

.product-main h1 { font-size: 24px; }
.product-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.product-price-box { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.product-price-box .price-final { font-size: 24px; font-weight: 700; }
.product-price-box .price-old { font-size: 15px; }
.product-price-box .discount-percent { background: var(--danger); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 700; }

.stock-status { font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.stock-status.in-stock { color: var(--success); }
.stock-status.low-stock { color: var(--danger); }
.stock-status.out-stock { color: var(--muted); }

.variant-group { margin-bottom: 18px; }
.variant-group h5 { font-size: 13.5px; margin-bottom: 10px; }
.variant-options { display: flex; flex-wrap: wrap; gap: 10px; }
.variant-swatch {
    width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer;
    position: relative; display: flex; align-items: center; justify-content: center;
}
.variant-swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.variant-swatch.selected { border-color: var(--dark); box-shadow: 0 0 0 2px var(--yellow); }
.variant-pill {
    padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--border); cursor: pointer; font-size: 13px; font-weight: 600;
    position: relative;
}
.variant-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.variant-pill.selected { border-color: var(--dark); background: var(--dark); color: var(--white); }

.qty-control { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; width: fit-content; }
.qty-control button { width: 38px; height: 38px; border: none; background: var(--white); cursor: pointer; font-size: 18px; }
.qty-control input { width: 46px; text-align: center; border: none; outline: none; }
.add-to-cart-row { display: flex; gap: 14px; align-items: center; margin: 20px 0; }

.trust-badges { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.trust-badge { display: flex; align-items: center; gap: 10px; background: var(--yellow-light); padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; flex: 1; min-width: 200px; }

.tabs { margin-top: 40px; }
.tabs-nav { display: flex; gap: 6px; border-bottom: 2px solid var(--border); }
.tabs-nav button { padding: 12px 20px; background: none; border: none; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs-nav button.active { color: var(--dark); border-color: var(--yellow); }
.tab-panel { padding: 22px 4px; display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   Cart / Checkout
   ============================================================ */
.cart-page { padding: 30px 0 60px; }

/* ---------------- Order success ---------------- */
.order-success-page { padding: 40px 0 60px; }
.success-hero { text-align: center; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 24px; margin-bottom: 30px; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--success); color: #fff; font-size: 30px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.success-hero h1 { font-size: 22px; }
.success-hero p { color: var(--muted); margin-top: 8px; }
.tracking-number { margin-top: 14px; font-size: 14px; background: var(--yellow-light); display: inline-block; padding: 8px 18px; border-radius: 999px; margin-inline: 4px; }
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--white); }
.cart-table { width: 100%; min-width: 520px; border-collapse: collapse; background: var(--white); }
.cart-table th { background: var(--bg); padding: 14px; font-size: 13px; text-align: right; }
.cart-table td { padding: 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.cart-product { display: flex; align-items: center; gap: 12px; }
.cart-product img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: var(--yellow-light); }
.cart-product .variant { font-size: 12px; color: var(--muted); }
.cart-remove { color: var(--danger); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; }
.cart-summary { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; height: fit-content; }
.cart-summary h4 { margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.summary-row.total { font-weight: 700; font-size: 17px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.summary-row.discount-row { color: var(--success); }
.test-period-note { background: var(--yellow-light); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; font-weight: 600; margin: 16px 0; color: #7a5b00; }

.discount-box { margin-bottom: 16px; }
.discount-form { display: flex; gap: 8px; }
.discount-form .form-control { flex: 1; }
.discount-applied {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #e7f8ec; border: 1px solid #bfe9c9; border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--success);
}
.discount-applied form { margin: 0; }
.discount-applied .cart-remove { color: var(--danger); }

.shipping-methods-list { display: flex; flex-direction: column; gap: 10px; }
.shipping-method-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px;
    cursor: pointer; position: relative; transition: border-color .15s, background .15s;
}
.shipping-method-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.shipping-method-option.selected { border-color: var(--yellow-dark); background: var(--yellow-light); }
.shipping-method-option .method-name { font-weight: 600; font-size: 14px; }
.shipping-method-option .method-price { font-weight: 700; font-size: 13.5px; color: var(--yellow-dark); }

/* ============================================================
   Auth / OTP
   ============================================================ */
.auth-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.auth-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 34px; width: 100%; max-width: 400px; text-align: center; }
.auth-card h2 { font-size: 20px; }
.auth-card p.desc { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.otp-inputs { display: flex; gap: 10px; justify-content: center; direction: ltr; margin: 22px 0; }
.otp-inputs input { width: 50px; height: 56px; text-align: center; font-size: 22px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); }
.otp-timer { font-size: 13px; color: var(--muted); margin-top: 14px; }
.dev-otp-hint { margin-top: 14px; font-size: 12px; background: var(--yellow-light); border-radius: 8px; padding: 8px; color: #7a5b00; }

/* ============================================================
   نظرات مشتریان (reviews.php + بخش صفحه اصلی)
   ============================================================ */
.star-rating-input { display: inline-flex; gap: 4px; font-size: 26px; cursor: pointer; direction: ltr; }
.star-rating-input .star { color: #ddd; transition: color .1s ease, transform .1s ease; }
.star-rating-input .star:hover { transform: scale(1.12); }
.star-rating-input .star.filled { color: var(--yellow); }
.star-rating-display { display: inline-flex; gap: 1px; font-size: 15px; direction: ltr; }
.star-rating-display .star { color: #ddd; }
.star-rating-display .star.filled { color: var(--yellow); }

.reviews-list { display: flex; flex-direction: column; gap: 14px; }
.review-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.review-card-head b { font-size: 14.5px; }
.review-card-message { color: var(--text); line-height: 1.9; font-size: 14px; }
.review-card-date { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* کارت «ادامه نظرات» — همون شکل کارت نظر ولی به‌عنوان لینک، کنار ۵ نظر نمایش‌داده‌شده در صفحه اصلی */
.review-more-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: var(--dark-2); color: var(--white); font-weight: 700; font-size: 15px; text-align: center;
    min-height: 140px; transition: transform .2s ease, background .2s ease;
}
.review-more-card:hover { background: var(--dark); transform: translateY(-4px); }
.review-more-arrow { font-size: 22px; color: var(--yellow); transition: transform .15s ease; }
.review-more-card:hover .review-more-arrow { transform: translateX(-6px); }

.reviews-showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.reviews-showcase .review-card { height: 100%; }

/* ============================================================
   Account
   ============================================================ */
.account-page { padding: 30px 0 60px; }
.order-row { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.status-pill { padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-pending { background: #fff3d6; color: #7a5b00; }
.status-confirmed, .status-processing { background: #e6f0ff; color: #1a56db; }
.status-shipped { background: #eee6ff; color: #6b21a8; }
.status-delivered { background: #e7f8ec; color: var(--success); }
.status-canceled { background: #fdeceb; color: var(--danger); }

/* ============================================================
   Blog detail / About / Contact
   ============================================================ */
.article-cover { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.article-date-badge {
    display: inline-flex; align-items: center; gap: 6px; background: var(--yellow-light); color: var(--yellow-dark);
    font-weight: 700; font-size: 12.5px; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.article-body { line-height: 2; font-size: 15px; }
.article-body h2, .article-body h3 { line-height: 1.6; margin: 28px 0 12px; }
.article-body h2 { font-size: 20px; }
.article-body h3 { font-size: 17px; }
.article-body p { margin: 0 0 14px; }
.article-body ul, .article-body ol { margin: 0 0 14px; padding-inline-start: 22px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
    border-inline-start: 4px solid var(--yellow); background: var(--yellow-light); color: #6b5400;
    padding: 14px 18px; border-radius: var(--radius-sm); margin: 16px 0;
}
.article-body img { border-radius: var(--radius); margin: 16px 0; }

.blog-sidebar-title { font-size: 17px; margin-bottom: 16px; }
.blog-mini-card {
    display: flex; gap: 12px; align-items: center; background: var(--white); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); padding: 10px; margin-bottom: 12px; transition: box-shadow .15s ease, transform .15s ease;
}
.blog-mini-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.blog-mini-card img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.blog-mini-card b { display: block; font-size: 13px; line-height: 1.6; font-weight: 700; }
.blog-mini-card span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.contact-map { width: 100%; height: 260px; border-radius: var(--radius); background: var(--yellow-light) url('../images/product-placeholder.svg') center/cover; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
    .features { grid-template-columns: repeat(2, 1fr); }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .sale-section-grid { grid-template-columns: 1fr; }
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .categories-showcase { grid-template-columns: repeat(3, 1fr); }
    .reviews-showcase { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .products-layout { grid-template-columns: 1fr; }
    .product-detail .container { display: flex; flex-direction: column; }
}
/* هدر خیلی زودتر از بقیه‌ی بخش‌ها جمع می‌شود، چون منوی کامل حتی روی تبلت هم جا نمی‌شود
   و باعث می‌شد لوگو/منو/جستجو/کاربر روی هم بریزند */
@media (max-width: 1220px) {
    .main-nav, .search-box { display: none; }
    .mobile-toggle { display: flex; }
    .main-nav.open {
        display: block; position: absolute; top: 100%; right: 0; left: 0; background: var(--white);
        box-shadow: var(--shadow-lg); padding: 10px 20px; max-height: 80vh; overflow-y: auto;
    }
    .main-nav.open ul { flex-direction: column; align-items: stretch; gap: 4px; }
    .has-dropdown .mega-menu { position: static; box-shadow: none; display: none; }
    .has-dropdown.open .mega-menu { display: flex; flex-direction: column; }
    /* روی موبایل جای کافی برای پنل دوستونه‌ی زیردسته‌ها نیست؛ فقط لیست دسته‌های اصلی (که خودشان لینک قابل کلیک هستند) نمایش داده می‌شود */
    .mega-rail { max-height: none; border-inline-start: none; }
    .mega-panels { display: none; }
    .user-name { max-width: 60px; }
}
@media (max-width: 768px) {
    /* منوی هدر روی موبایل خیلی تنگ است (لوگو + دکمه همبرگر + سبد خرید + ورود)؛ بدون این قانون متن «ورود / عضویت»
       (یا نام کاربر) باعث سرریز افقی کل صفحه می‌شد و کل سایت را چند ده پیکسل به‌طور نامرئی می‌لغزاند */
    .user-name { display: none; }
    .icon-btn { padding: 8px 6px; }
    .hero .container { flex-direction: column; }
    .hero-image { order: -1; max-width: 260px; }
    .features { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-grid { grid-template-columns: 1fr; }
    .categories-showcase { grid-template-columns: repeat(2, 1fr); }
    .reviews-showcase { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .wholesale-banner { flex-direction: column; text-align: center; padding: 26px; }
}
