/* ===== CSS Variables ===== */
:root {
    --background: #faf8f5;
    --foreground: #1a1a1a;
    --card: #ffffff;
    --border: #e8e0d4;
    --muted-fg: #6b6b6b;
    --secondary: #f5f0e8;
    --gold: #b8860b;
    --gold-light: #dcd0b4;
    --gold-dark: #8b6914;
    --cream: #faf8f5;
    --dark: #1a1a1a;
    --red: #dc2626;
    --radius: 0.75rem;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--cream);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; font-family: inherit; }
input { font-family: inherit; }
::selection { background-color: rgba(184,134,11,0.2); color: #1a1a1a; }

/* ===== Container ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ===== Swiper Overrides ===== */
.swiper-pagination-bullet {
    background-color: rgba(255,255,255,0.5) !important;
    width: 10px !important; height: 10px !important; opacity: 1 !important;
}
.swiper-pagination-bullet-active {
    background-color: var(--gold-light) !important;
    width: 28px !important; border-radius: 5px !important;
}
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev { color: var(--gold-light) !important; }

/* ===== Line clamp ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================================
   TOP BAR MARQUEE
======================================================== */
.top-bar {
    background-color: var(--dark);
    color: var(--gold-light);
    font-size: 13px;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.marquee-wrapper {
    display: flex;
    width: 100%;
    overflow: hidden;
}
.marquee-track {
    display: flex;
    gap: 0;
    will-change: transform;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-set {
    display: flex;
    flex-shrink: 0;
    align-items: center;
}
.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 32px;
    flex-shrink: 0;
    white-space: nowrap;
}
.marquee-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.marquee-separator {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    color: var(--gold);
    font-size: 18px;
    flex-shrink: 0;
}

/* ========================================================
   MAIN HEADER - Logo Right, Search Center, Actions Left
======================================================== */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: sticky; top: 0; z-index: 100;
}
.main-header .container {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding-top: 12px; padding-bottom: 12px;
}

/* Logo - right side */
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(184,134,11,0.25);
}
.logo-icon svg { width: 26px; height: 26px; }
.logo-text h1 { font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--gold-dark); }
.logo-text span { font-size: 11px; color: var(--muted-fg); display: block; margin-top: 2px; }

/* Search - center */
.search-bar { flex: 1; max-width: 560px; margin: 0 16px; position: relative; }
.search-bar input {
    width: 100%; padding: 10px 44px 10px 16px;
    border: 2px solid var(--border); border-radius: var(--radius);
    background-color: var(--secondary); font-size: 14px;
    color: var(--foreground); transition: border-color 0.3s;
}
.search-bar input:focus { outline: none; border-color: var(--gold); }
.search-bar svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); pointer-events: none; }

/* Header actions - left side */
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: var(--radius);
    font-size: 14px; color: var(--foreground);
    background: transparent; transition: background 0.2s;
}
.header-btn:hover { background: var(--secondary); }
.icon-btn { position: relative; padding: 8px; border-radius: var(--radius); background: transparent; color: var(--foreground); transition: background 0.2s; }
.icon-btn:hover { background: var(--secondary); }
.badge-count {
    position: absolute; top: -2px; left: -2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--gold); color: #fff; font-size: 10px;
    display: flex; align-items: center; justify-content: center;
}

/* Mobile Menu Toggle */
.mobile-toggle { display: none; }

/* ===== NAV with Dropdown ===== */
.main-nav { background: var(--gold); color: #fff; }
.main-nav > .container > ul { display: flex; align-items: center; gap: 0; justify-content: center; }
.main-nav li { position: relative; }
.main-nav > .container > ul > li > a {
    display: flex; align-items: center; gap: 4px;
    padding: 12px 18px; font-size: 14px; font-weight: 500;
    transition: background 0.2s;
}
.main-nav > .container > ul > li > a:hover { background: rgba(255,255,255,0.15); }
.nav-chevron { width: 14px; height: 14px; transition: transform 0.3s; }

/* Dropdown submenu */
.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 200;
    padding: 8px 0;
}
.main-nav li:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.main-nav li:hover > a .nav-chevron {
    transform: rotate(180deg);
}
.dropdown a {
    display: block;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 400;
    color: var(--dark) !important;
    transition: all 0.2s;
}
.dropdown a:hover {
    background: var(--secondary);
    color: var(--gold) !important;
    padding-right: 24px;
}
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 12px;
}
/* Price dropdown special */
.dropdown--prices { min-width: 280px; }
.dropdown--prices .price-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 20px; font-size: 13px; color: var(--dark);
    border-bottom: 1px solid var(--border);
}
.dropdown--prices .price-row:last-child { border-bottom: none; }
.dropdown--prices .price-label { font-weight: 400; color: var(--muted-fg); }
.dropdown--prices .price-value { font-weight: 700; color: var(--gold-dark); direction: ltr; }

/* ===== Mobile Menu ===== */
.mobile-menu {
    display: none; position: fixed; inset: 0; top: 0; z-index: 90;
    background: #fff; padding: 0; overflow-y: auto;
}
.mobile-menu.active { display: block; }
.mobile-menu-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; border-bottom: 1px solid var(--border);
}
.mobile-menu-close {
    padding: 8px; border-radius: var(--radius); background: transparent;
    color: var(--foreground); transition: background 0.2s;
}
.mobile-menu-close:hover { background: var(--secondary); }
.mobile-menu-body { padding: 16px; }
.mobile-menu-body > ul { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu-body a {
    display: block; padding: 12px 16px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; color: var(--foreground); transition: background 0.2s;
}
.mobile-menu-body a:hover { background: var(--secondary); }
.mobile-submenu-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 12px 16px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; color: var(--foreground);
    background: transparent; transition: background 0.2s; text-align: right;
}
.mobile-submenu-toggle:hover { background: var(--secondary); }
.mobile-submenu-toggle svg { transition: transform 0.3s; }
.mobile-submenu-toggle.open svg { transform: rotate(180deg); }
.mobile-submenu {
    display: none; padding-right: 16px; margin-top: 4px;
}
.mobile-submenu.open { display: block; }
.mobile-submenu a {
    font-size: 13px; font-weight: 400; padding: 10px 16px;
}
.mobile-search {
    position: relative; margin-bottom: 16px;
}
.mobile-search input {
    width: 100%; padding: 10px 44px 10px 16px;
    border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--secondary); font-size: 14px; color: var(--foreground);
}
.mobile-search svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); }


/* ========================================================
   RESPONSIVE
======================================================== */
@media (min-width: 480px) {
    .cat-img-wrap { width: 96px; height: 96px; }
    .cat-name { font-size: 13px; }
}
@media (min-width: 640px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
    .dual-banners-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .features-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; }
    .newsletter .container { flex-direction: row; justify-content: space-between; text-align: right; }
    .footer-copyright .container { flex-direction: row; justify-content: space-between; }
}
@media (min-width: 1024px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
    .main-nav { display: block; }
}
@media (max-width: 1023px) {
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
}
@media (max-width: 767px) {
    .search-bar { display: none; }
    .header-btn .btn-text { display: none; }
    .logo-icon { width: 40px; height: 40px; }
    .logo-icon svg { width: 22px; height: 22px; }
    .logo-text h1 { font-size: 16px; }
    .logo-text span { font-size: 10px; }
}
