:root{
  --promo-h: 44px;
  --menu-h: 55px;

  /* این دو تا را JS دقیقاً ست می‌کند */
  --header-h: calc(var(--promo-h) + var(--menu-h));
  --mega-top: var(--header-h);

  --mega-side: clamp(16px, 5vw, 80px);
  --mega-min-h: 320px;

  --brand: var(--primary, #2ec4b6);

  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.35);
}

/* صفحه زیر هدر */
html, body{
  margin: 0;
  padding: 0;
}

body{
  font-family: var(--font-base);
  padding-top: var(--header-h);
  background: #fff;
}

/* جلوگیری از override تکراری */
html body{
  padding-top: var(--header-h);
}

/* Container عمومی */
.container{
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* ===== Header fixed ===== */
.site-header{
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 999999;
  background: transparent;
}

/* Promo bar */
.promo-bar{
  position: relative;
  z-index: 999995; /* Keep above dimming overlay (999990) */
  height: var(--promo-h, 44px);
  max-height: var(--promo-h, 44px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF7E6;
  color: #000000;
  font-size: 13px;
  line-height: 1.2;
  box-sizing: border-box;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  visibility: visible;
  transition: height 360ms cubic-bezier(0.16, 1, 0.3, 1),
              max-height 360ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 300ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 360ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0s linear 0s;
  will-change: height, max-height, opacity, transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: top center;
}
.promo-bar .container{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-bar span{
  display: inline-block;
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

/* وقتی اسکرول شد: پرومو خیلی نرم و بدون پرش جمع می‌شود */
html.is-scrolled .promo-bar{
  height: 0;
  max-height: 0;
  opacity: 0;
  transform: translate3d(0, -100%, 0);
  pointer-events: none;
  visibility: hidden;
  transition: height 320ms cubic-bezier(0.16, 1, 0.3, 1),
              max-height 320ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 220ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0s linear 320ms;
}
html.is-scrolled .promo-bar span{
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* وقتی فیلترهای موبایل باز است: پروموبار بسته می‌ماند و اجازه باز شدن ندارد */
body.filters-open-active .promo-bar,
body.filters-open-active #promoBar {
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: none !important;
}

/* Main menu */
.main-menu{
  height: var(--menu-h);
  background: #fff;
  border-bottom: 1px solid #eee;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1000000;
}

/* container در منو باید کل ارتفاع را پر کند */
.main-menu .container{
  height: 100%;
}

/* wrapper */
.menu-wrapper{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  direction: ltr;
}

/* Logo */
.logo{
  max-height: 66px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Mobile toggle */
.menu-toggle{
  display: none;
  background: none;
  border: 0;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
}

/* ===== Nav ===== */
.nav-drawer-header,
.nav-drawer-user,
.nav-drawer-footer {
  display: none;
}
.nav-drawer-body {
  height: 100%;
}
.nav-item-header {
  display: flex;
  align-items: center;
  height: 100%;
}
.nav-item-icon {
  display: none;
}
.nav-badge-ai {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 6px;
  white-space: nowrap;
}

.nav-items{
  height: 100%;
  display: flex;
  align-items: stretch;
}

.nav-items ul{
  height: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.nav-item{
  position: relative;
  height: 100%;
  display: flex;
  align-items: stretch;
}

/* لینک: کل باکس آیتم */
.nav-link{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
  color: #4b5563; /* Slate-600 for better readability */
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 150ms ease;
}

/* underline فعال در دسکتاپ */
.nav-item::after{
  content:"";
  position: absolute;
  left: 14px; /* Align with text padding */
  right: 14px;
  bottom: 0;
  height: 2px; /* Slimmer line */
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover .nav-link,
.nav-item.is-active .nav-link,
.nav-item:focus-within .nav-link{
  color: #000;
}

.nav-item:hover::after,
.nav-item.is-active::after,
.nav-item:focus-within::after{
  transform: scaleX(1);
}

/* تست آنلاین */
.nav-test{
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.nav-test-box{
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  transform: translateY(-1px);
}
.nav-test .main-text{
  font-size: 11px;
  color: #444;
}
.nav-test .sub-text{
  font-size: 9px;
  color: #6b6b6b;
  margin-top: 4px;
}

/* ===== Desktop Search ===== */
.menu-search{
  flex: 0 0 min(220px, 100%);
  position: relative;
  z-index: 1001;
}
.menu-search-form{
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.menu-search-btn{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #8b7a3b;
  font-size: 15px;
  cursor: pointer;
  z-index: 2;
}
.menu-search input[type="text"]{
  width: 100%;
  height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  outline: none;
  padding: 0 46px 0 18px;
  font-size: 13px;
  text-align: right;
  color: #111827;
  background: linear-gradient(180deg, #fff, #f9fafb);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.menu-search input[type="text"]::placeholder{
  color: #9ca3af;
}
.menu-search input[type="text"]:focus{
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212,163,0,0.12);
}

/* Search Results Panel */
.menu-search-results{
  position: fixed;
  top: calc(var(--header-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 920px);
  max-width: 920px;
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .12);
  z-index: 1000;
  overflow: hidden;
  max-height: min(78vh, 620px);
  overflow-y: auto;
}
.menu-search-results::-webkit-scrollbar{
  width: 8px;
}
.menu-search-results::-webkit-scrollbar-thumb{
  background: #e5e7eb;
  border-radius: 999px;
}

/* Sections */
.search-panel-section{
  padding: 10px 0;
}
.search-panel-section + .search-panel-section{
  border-top: 1px solid #f3f4f6;
}
.search-panel-title{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px 6px;
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.search-panel-title span{
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: none;
  letter-spacing: 0;
}
.search-panel-viewall-btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fff8e6;
  border: 1px solid #fae8b6;
  color: #8a6a00;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 160ms ease;
  cursor: pointer;
  line-height: 1.4;
}
.search-panel-viewall-btn span{
  color: #8a6a00 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
}
.search-panel-viewall-btn i{
  font-size: 10px;
  color: #b08a00;
  transition: transform 160ms ease;
}
.search-panel-viewall-btn:hover,
.search-panel-viewall-btn.is-active{
  background: #fae8b6;
  border-color: #e5cd8a;
  color: #684f00;
  box-shadow: 0 2px 6px rgba(211, 157, 78, 0.2);
}
.search-panel-viewall-btn:hover span,
.search-panel-viewall-btn.is-active span{
  color: #684f00 !important;
}
.search-panel-viewall-btn:hover i,
.search-panel-viewall-btn.is-active i{
  transform: translateX(-3px);
  color: #684f00;
}

/* Tags */
.search-panel-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 6px;
  border-bottom: 1px solid #f3f4f6;
}
.search-tag{
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff8e6;
  color: #8a6a00;
  font-size: 12px;
  font-weight: 700;
}

/* Suggestions */
.search-panel-suggestions-section{
  padding: 12px 12px 6px;
  border-bottom: 1px solid #f3f4f6;
}
.search-panel-suggestions{
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.search-panel-suggestions::-webkit-scrollbar {
  height: 6px;
}
.search-panel-suggestions::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 999px;
}
.search-suggestion-item{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 14px;
  border: 1px solid #f1e5aa;
  background: #fffaf0;
  border-radius: 999px;
  text-align: right;
  cursor: pointer;
  color: #7a5a00;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.search-suggestion-item i{
  color: #b08a00;
  font-size: 13px;
}
.search-suggestion-item:hover,
.search-suggestion-item.is-active,
.search-result-item.is-active,
.search-view-all.is-active{
  background: #fff3c7;
  border-color: #e7c75c;
}

/* Empty */
.search-panel-empty{
  padding: 32px 16px;
  text-align: center;
}
.search-panel-empty-icon{
  font-size: 36px;
  color: #d1d5db;
  margin-bottom: 12px;
  display: block;
}
.search-panel-empty strong{
  display: block;
  font-size: 14px;
  color: #111827;
  margin-bottom: 6px;
}
.search-panel-empty span{
  display: block;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.8;
}

/* ===== Skeleton Loading ===== */
.search-panel-skeleton{
  padding: 12px 16px;
}
.skeleton-row{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}
.skeleton-row + .skeleton-row{
  border-top: 1px solid #f9fafb;
}
.skeleton-thumb{
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
}
.skeleton-lines{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skeleton-line{
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
}
.skeleton-line.w80{ width: 80%; }
.skeleton-line.w70{ width: 70%; }
.skeleton-line.w60{ width: 60%; }
.skeleton-line.w55{ width: 55%; }
.skeleton-line.w50{ width: 50%; }
.skeleton-line.w40{ width: 40%; }

@keyframes skeletonShimmer{
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Error Panel ===== */
.search-panel-error{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  text-align: center;
  color: #6b7280;
}
.search-panel-error i{
  font-size: 28px;
  color: #f59e0b;
}
.search-panel-error strong{
  font-size: 14px;
  color: #111827;
}
.search-panel-error span{
  font-size: 13px;
  line-height: 1.7;
}

/* ===== Search History ===== */
.search-history-section{
  padding: 8px 0;
}
.search-history-section .search-panel-title{
  padding: 10px 16px 8px;
}
.search-history-clear-all{
  background: none;
  border: none;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 160ms;
}
.search-history-clear-all:hover{
  background: #fef2f2;
}
.search-history-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 160ms ease;
  color: #374151;
  font-size: 14px;
}
.search-history-item:hover,
.search-history-item.is-active{
  background: #f9fafb;
}
.search-history-item i.fa-clock-rotate-left{
  color: #9ca3af;
  font-size: 13px;
  flex: 0 0 auto;
}
.search-history-text{
  flex: 1;
  text-align: right;
}
.search-history-remove{
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  transition: color 160ms, background 160ms;
  flex: 0 0 auto;
}
.search-history-remove:hover{
  color: #dc2626;
  background: #fef2f2;
}

/* ===== Highlight (mark) ===== */
.menu-search-results mark{
  background: #fef3c7;
  color: #92400e;
  border-radius: 2px;
  padding: 0 1px;
}

/* ===== Spinner (legacy compat) ===== */
.search-panel-loading{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
  color: #6b7280;
  font-size: 14px;
}
.search-spinner{
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: searchSpin .7s linear infinite;
}
@keyframes searchSpin{
  to { transform: rotate(360deg); }
}

/* View all */
.search-view-all{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff, #f9fafb);
  border-top: 1px solid #f3f4f6;
  text-decoration: none;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}
.search-view-all span{
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}
.search-view-all:hover{
  background: #fff8e6;
  color: #8a6a00;
}

/* Search result items (Products) */
.menu-search-results a.search-result-item{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  text-decoration: none;
  color: #111827;
  transition: background-color 160ms ease;
}
.menu-search-results a.search-result-item:hover,
.menu-search-results a.search-result-item.is-active{
  background: #f8fafc;
}
.search-result-thumb{
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f1f5f9;
}
.menu-search-results img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: linear-gradient(180deg, #fff, #f9fafb);
}
.search-result-body{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.search-result-title{
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-subtitle{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}
.search-product-code{
  font-family: inherit;
  font-weight: 600;
  color: #64748b;
  font-size: 12.5px;
}
.search-result-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* ===== بخش ۱: دسترسی سریع (Quick Links & Services) ===== */
.search-quick-links-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 14px 10px;
}
.search-quick-card{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fdfbf7 0%, #fef8ee 100%);
  border: 1px solid #fbe6c4;
  border-radius: 12px;
  text-decoration: none;
  color: #1f2937;
  transition: transform 160ms, box-shadow 160ms, border-color 160ms, background 160ms;
}
.search-quick-card:hover,
.search-quick-card.is-active{
  background: linear-gradient(135deg, #fef5e7 0%, #faeacf 100%);
  border-color: #d39d4e;
  box-shadow: 0 4px 12px rgba(211, 157, 78, 0.15);
  transform: translateX(-3px);
}
.search-quick-icon{
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: #0f172a;
  color: #d39d4e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.search-quick-info{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.search-quick-header{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-quick-title{
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.search-quick-badge{
  font-size: 11px;
  font-weight: 700;
  color: #854d0e;
  background: #fef08a;
  padding: 2px 8px;
  border-radius: 999px;
}
.search-quick-desc{
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.search-quick-arrow{
  color: #94a3b8;
  font-size: 13px;
  transition: transform 160ms, color 160ms;
}
.search-quick-card:hover .search-quick-arrow,
.search-quick-card.is-active .search-quick-arrow{
  color: #0f172a;
  transform: translateX(-3px);
}

/* ===== بخش ۲: عدسی‌های طبی تخصصی (Prescription Lenses) ===== */
.search-lenses-list{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 12px 10px;
}
.search-lens-card{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  color: #1e293b;
  transition: all 160ms ease;
}
.search-lens-card:hover,
.search-lens-card.is-active{
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
}
.search-lens-thumb{
  width: 56px;
  height: 48px;
  flex: 0 0 56px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.search-lens-thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: none;
}
.search-lens-body{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.search-lens-title{
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-lens-meta{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.search-lens-brand{
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.search-lens-index{
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 4px;
}
.search-lens-type{
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  padding: 2px 6px;
  border-radius: 4px;
}
.search-lens-action{
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 160ms;
}
.search-lens-card:hover .search-lens-action,
.search-lens-card.is-active .search-lens-action{
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

/* ===== بخش ۳: مقالات وبلاگ و دانستنی‌ها (Blog Articles) ===== */
.search-articles-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 14px 10px;
}
.search-article-card{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  text-decoration: none;
  color: #1e293b;
  transition: all 160ms ease;
}
.search-article-card:hover,
.search-article-card.is-active{
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.search-article-thumb{
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-article-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.search-article-thumb-placeholder{
  color: #94a3b8;
  font-size: 20px;
}
.search-article-body{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.search-article-title{
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-article-summary{
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-article-arrow{
  color: #cbd5e1;
  font-size: 12px;
}
.search-article-card:hover .search-article-arrow,
.search-article-card.is-active .search-article-arrow{
  color: #0f172a;
}


/* Clear button */
.menu-search-clear{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms, color 160ms;
}
.menu-search-clear:hover{
  background: #e5e7eb;
  color: #374151;
}

/* ===== Mobile Search Button (در هدر) ===== */
.mobile-search-btn{
  display: none; /* فقط موبایل */
  background: none;
  border: 0;
  font-size: 18px;
  color: #333;
  cursor: pointer;
  padding: 8px 10px;
  line-height: 1;
  transition: color 160ms;
}
.mobile-search-btn:hover{
  color: var(--brand);
}

/* ===== Mobile Search Overlay (فول‌اسکرین) ===== */
.mobile-search-overlay{
  display: none; /* فقط موبایل فعال */
}

/* ===== Icons ===== */
.menu-icons{
  display: flex;
  align-items: center;
}
.menu-icons a,
.menu-icons .mobile-search-btn{
  text-decoration: none;
  color: #333;
  font-size: 18px;
  padding: 8px 10px;
  position: relative;
}
.menu-icons a:hover,
.menu-icons .mobile-search-btn:hover{
  color: var(--brand);
}
.menu-login{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

/* ===== Mega Menu ===== */
.has-mega-menu{
  position: relative;
}
.mega-toggle{
  display: none; /* فقط موبایل */
}

@media (min-width: 981px) {
  .has-mega-menu .mega-menu {
    position: fixed;
    top: var(--mega-top);
    left: var(--mega-side);
    right: var(--mega-side);
    width: auto;
    height: 340px; /* Increased height to comfortably display all brand items */
    background: #ffffff; /* Clean white like EyeBuyDirect */
    border: 1px solid #cbd5e1; /* Thin border all around */
    border-radius: 8px; /* Sharper floating corners */
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08); /* Premium shadow */
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    pointer-events: none;
    z-index: 999998;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: 
      opacity 220ms ease,
      transform 220ms ease,
      visibility 0s linear 220ms;
  }

  /* Transition override when moving between menus to mimic EyeBuyDirect */
  .site-header.has-active-mega .has-mega-menu .mega-menu {
    transform: translateY(0) !important;
    transition: opacity 120ms ease, visibility 0s !important;
  }

  /* Open states */
  .has-mega-menu:hover .mega-menu,
  .has-mega-menu.is-active .mega-menu,
  .has-mega-menu:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: 
      opacity 220ms ease,
      transform 220ms ease,
      visibility 0s;
  }

  /* پل نامرئی ضد پرش */
  .has-mega-menu .mega-menu::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
  }

  .mega-inner {
    max-width: 1360px;
    height: 100%;
    margin: 0 auto;
    padding: 15px 24px;
    display: flex;
    gap: 40px;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
  }

  .mega-inner .column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mega-inner .column h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
  }

  .mega-inner .column a {
    text-decoration: none;
    color: #4b5563;
    font-size: 13px;
    padding: 4px 0;
    transition: color 150ms ease, padding-right 150ms ease;
  }

  .mega-inner .column a:hover {
    color: var(--brand);
    text-decoration: none;
    padding-right: 4px; /* Micro-interaction */
  }

  .mega-inner .column.image img {
    width: 100%;
    height: 100%;
    max-height: 308px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
  }

  /* Premium Backdrop Overlay for Desktop Mega Menu */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65); /* Solid dark dimming backdrop */
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, visibility 0s linear 250ms;
    z-index: 999990; /* Below mega menu (999998) and header */
    display: block !important; /* Force override display: none in main flow */
    pointer-events: none;
  }

  .site-header.has-active-mega .nav-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Allow overlay clicks to close */
    transition: opacity 250ms ease, visibility 0s;
  }
}

/* Featured menu cards like EyeBuyDirect */
@media (min-width: 981px) {
  .menu-featured-row {
    display: flex;
    gap: 16px;
    width: 480px;
    height: 250px; /* Compact height */
    flex-shrink: 0;
  }

  .menu-featured-row.three-cards {
    width: 580px;
    height: 250px;
  }

  .menu-featured-card {
    flex: 1;
    display: block;
    text-decoration: none !important;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
  }

  .menu-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }

  .card-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
  }

  .menu-featured-card:hover .card-image-wrapper img {
    transform: scale(1.06);
  }

  .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.1) 60%, rgba(0,0,0,0) 100%);
    transition: opacity 0.3s ease;
    z-index: 1;
  }

  .menu-featured-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0) 100%);
  }

  .menu-featured-card .card-title {
    position: absolute;
    bottom: 14px;
    right: 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: color 0.2s ease;
  }

  .menu-featured-card:hover .card-title {
    color: #ffffff !important;
  }
}

@media (max-width: 980px) {
  .menu-featured-row {
    display: none !important;
  }
}

/* Brands grid */
@media (min-width: 981px) {
  .brands-grid {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 24px;
    padding: 0;
    box-sizing: border-box;
  }
  .brand-card {
    width: 170px;
    height: 120px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1), border-color 300ms ease;
  }
  .brand-card:hover {
    transform: translateY(-4px);
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }
  .brand-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .brand-card:hover img {
    transform: scale(1.08);
  }
  .brand-card p {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 8px 10px;
    font-size: 13px;
    color: #1e293b;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #f1f5f9;
    transition: background 300ms ease, color 300ms ease;
  }
  .brand-card:hover p {
    color: var(--brand);
    background: #ffffff;
  }
}

/* Lenses layout */
@media (min-width: 981px) {
  .lenses-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr;
    gap: 30px;
    direction: ltr;
  }
  .lenses-grid .column {
    direction: rtl;
    text-align: right;
  }
  .image-banner {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    height: 100%;
    max-height: 308px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
    display: block;
  }
  .image-banner:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  }
  .image-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
  }
  .image-banner:hover img {
    transform: scale(1.06);
  }
}

.badge{
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
}
.badge.new{
  background: #44697d;
}
.caption-rtl{
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}
.caption-rtl span{
  display: block;
  font-size: 12px;
  font-weight: 400;
  margin-top: 3px;
}

/* Screen-reader only */
.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;
}

/* ===== Mobile Nav Overlay ===== */
.nav-overlay{
  display: none;
}

/* ========================================
   Mobile Breakpoint
   ======================================== */
@media (max-width: 980px){
  .main-menu{
    z-index: auto;
  }

  .menu-wrapper {
    direction: rtl !important;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 0;
    width: 100%;
  }

  .main-menu .container {
    padding: 0 12px;
    display: flex;
    align-items: center;
  }

  /* Right Side: Toggle + Logo */
  .menu-toggle{
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    font-size: 20px;
    color: #1a1a2e;
    cursor: pointer;
    border-radius: 8px;
    flex-shrink: 0;
    order: 1;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .menu-toggle:active {
    background: rgba(0, 0, 0, 0.05);
  }

  .logo-box {
    display: flex;
    align-items: center;
    order: 2;
    flex-shrink: 1;
    min-width: 0;
    margin-right: 4px;
  }
  .logo-box .logo-link {
    display: flex;
    align-items: center;
  }
  .logo {
    max-height: 42px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
  }

  /* Left Side: Action Icons (Search, Cart, Favorites, User) */
  .menu-icons {
    display: flex !important;
    align-items: center;
    gap: 3px;
    order: 3;
    flex-shrink: 0;
    direction: rtl;
    margin-right: auto;
  }

  .menu-icons a,
  .menu-icons button,
  .menu-icons .mobile-search-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0 !important;
    font-size: 17px;
    color: #1a1a2e;
    text-decoration: none;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .menu-icons a:active,
  .menu-icons .mobile-search-btn:active,
  .menu-icons button:active {
    background: rgba(0, 0, 0, 0.05);
  }

  /* مخفی کردن سرچ دسکتاپ */
  .menu-search-desktop{
    display: none !important;
  }

  /* نمایش دکمه سرچ موبایل */
  .mobile-search-btn{
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #1a1a2e;
  }

  .menu-cart-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #1a1a2e;
  }

  .cart-badge,
  .fav-badge {
    position: absolute;
    top: -1px;
    left: -1px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    z-index: 2;
  }

  /* User section in mobile topbar */
  .menu-user-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
  }
  .menu-user {
    padding: 0 !important;
    gap: 0;
  }
  .menu-user-name {
    display: none !important;
  }
  .menu-login {
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(212, 175, 55, 0.12);
    color: #9c7800;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    height: 28px;
    box-sizing: border-box;
  }
  .menu-login .fa-chevron-down {
    display: none !important;
  }

  /* نمایش overlay سرچ موبایل */
  .mobile-search-overlay{
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 250ms ease, transform 250ms ease, visibility 0s linear 250ms;
  }
  .mobile-search-overlay.is-open{
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 250ms ease, transform 250ms ease, visibility 0s;
  }

  body.mobile-search-active{
    overflow: hidden;
  }

  .mobile-search-overlay-inner{
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .mobile-search-header{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    direction: rtl;
  }

  .mobile-search-form{
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
  }

  .mobile-search-form input[type="text"]{
    width: 100%;
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    padding: 0 42px 0 38px;
    font-size: 14px;
    font-family: inherit;
    text-align: right;
    color: #111827;
    background: #f9fafb;
    box-sizing: border-box;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  }

  .mobile-search-form input[type="text"]:focus{
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212,163,0,0.12);
  }

  .mobile-search-form .menu-search-btn{
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: #8b7a3b;
    font-size: 16px;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-search-form .menu-search-clear{
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 0;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms, color 160ms;
  }

  .mobile-search-close{
    background: none;
    border: none;
    color: var(--brand);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 6px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .mobile-search-body{
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* نتایج سرچ موبایل — static نه fixed */
  .mobile-search-results{
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* Body Scroll Lock */
  body.nav-open-locked {
    overflow: hidden !important;
    touch-action: none;
  }

  /* Nav Slide Drawer */
  /* Nav Slide Drawer */
  .nav-items {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 86vw);
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    direction: rtl;
    text-align: right;
  }

  html.nav-open .nav-items {
    transform: translateX(0);
  }

  /* Mobile Backdrop Overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 280ms ease, visibility 0s linear 280ms;
    z-index: 9999990;
    display: block !important;
    pointer-events: none;
  }

  html.nav-open .nav-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 280ms ease, visibility 0s;
  }

  /* Drawer Header */
  .nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    flex-shrink: 0;
    direction: rtl;
  }

  .nav-drawer-logo {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .nav-drawer-logo-img {
    max-height: 68px;
    width: auto;
    object-fit: contain;
  }

  .nav-drawer-brand-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
  }

  .nav-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
  }

  .nav-drawer-close:hover,
  .nav-drawer-close:active {
    background: #e2e8f0;
    color: #0f172a;
  }

  /* Drawer User Box */
  .nav-drawer-user {
    display: block;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    direction: rtl;
  }

  .nav-drawer-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }

  .nav-drawer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand, #d4a300);
  }

  .nav-drawer-avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
  }

  .nav-drawer-user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .nav-drawer-welcome {
    font-size: 11px;
    color: #64748b;
  }

  .nav-drawer-username {
    font-size: 13.5px;
    color: #0f172a;
    font-weight: 700;
  }

  .nav-drawer-user-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .nav-drawer-btn-primary,
  .nav-drawer-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
  }

  .nav-drawer-btn-primary {
    background: #0f172a;
    color: #ffffff !important;
  }

  .nav-drawer-btn-secondary {
    background: #ffffff;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
  }

  .nav-drawer-guest {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .nav-drawer-guest-meta {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .nav-drawer-guest-icon {
    font-size: 28px;
    color: var(--brand, #d4a300);
  }

  .nav-drawer-guest-meta strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
  }

  .nav-drawer-guest-meta p {
    margin: 2px 0 0;
    font-size: 11px;
    color: #64748b;
  }

  .nav-drawer-guest-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .nav-drawer-btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background: #0f172a;
    color: #ffffff !important;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
  }

  .nav-drawer-btn-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background: #ffffff;
    color: #0f172a !important;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
  }

  /* Drawer Body */
  .nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px;
    direction: rtl;
  }

  .nav-drawer-body ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    margin: 0;
    list-style: none;
    height: auto;
  }

  .nav-item {
    height: auto;
    display: block;
    position: relative;
    border-radius: 10px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
  }

  .nav-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    width: 100%;
  }

  .nav-link {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    flex: 1;
    border-radius: 8px;
    transition: all 0.2s ease;
  }

  .nav-link:hover,
  .nav-link:active {
    color: var(--brand, #d4a300);
    background: #f8fafc;
  }

  .nav-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #64748b;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
  }

  .nav-link:hover .nav-item-icon {
    color: var(--brand, #d4a300);
  }

  .nav-badge-ai {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-right: auto;
  }

  .nav-item::after {
    display: none;
  }

  /* Mega Menu Mobile Toggle Button */
  .mega-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    margin-left: 2px;
    transition: background 0.2s, color 0.2s, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
  }

  .mega-toggle:hover,
  .mega-toggle:active {
    background: #e2e8f0;
    color: #0f172a;
  }

  .has-mega-menu.is-open .mega-toggle {
    transform: rotate(180deg);
    color: var(--brand, #d4a300);
  }

  /* Submenu Mobile Accordion */
  .has-mega-menu .mega-menu {
    display: none;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    background: #f8fafc;
    border-radius: 10px;
    margin: 4px 0 10px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    box-shadow: none !important;
    box-sizing: border-box;
    animation: drawerSubmenuFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .has-mega-menu.is-open .mega-menu {
    display: block !important;
  }

  @keyframes drawerSubmenuFade {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .has-mega-menu .mega-menu::before {
    display: none;
  }

  .mega-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
  }

  .mega-inner .column {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    direction: rtl;
    text-align: right;
  }

  .mega-inner .column h4 {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .mega-inner .column a {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .mega-inner .column a:hover,
  .mega-inner .column a:active {
    background: #edf2f7;
    color: var(--brand, #d4a300);
    padding-right: 10px;
  }

  .mega-inner .column.image,
  .mega-inner .image-banner {
    display: none !important;
  }

  /* Brands Grid on Mobile */
  .mega-inner.brands-grid,
  .brands-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 0 !important;
    min-height: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .brand-card {
    position: relative !important;
    width: 100% !important;
    height: 80px !important;
    aspect-ratio: 16 / 10 !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    display: block !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    transform: none !important;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s !important;
  }

  .brand-card:hover,
  .brand-card:active {
    border-color: var(--brand, #d4a300) !important;
    box-shadow: 0 4px 12px rgba(212, 163, 0, 0.2) !important;
    transform: scale(0.98) !important;
  }

  .brand-card img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transform: none !important;
  }

  .brand-card p {
    display: none !important;
  }

  /* Lenses Grid on Mobile */
  .mega-inner.lenses-grid,
  .lenses-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    grid-template-columns: none !important;
    width: 100% !important;
  }

  /* Drawer Footer */
  .nav-drawer-footer {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
    direction: rtl;
  }

  .nav-drawer-booking-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--brand, #d4a300) 0%, #b8860b 100%);
    color: #ffffff !important;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(212, 163, 0, 0.25);
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .nav-drawer-booking-btn:active {
    transform: scale(0.98);
  }

  .nav-drawer-booking-btn i {
    font-size: 15px;
  }

  .nav-drawer-contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .nav-drawer-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #334155 !important;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.2s, border-color 0.2s;
  }

  .nav-drawer-contact-link:hover,
  .nav-drawer-contact-link:active {
    background: #f1f5f9;
    border-color: #94a3b8;
  }

  .nav-drawer-contact-link i {
    font-size: 13px;
    color: var(--brand, #d4a300);
  }
}

/* در نمایشگرهای موبایل و تبلت، تنظیم ابعاد لوگو و آیکون‌های هدر */
@media (max-width: 768px){
  :root {
    --promo-h: 38px;
    --menu-h: 56px;
  }
  .promo-bar {
    font-size: 12px;
  }
  .menu-wrapper {
    gap: 6px;
  }
  .logo {
    max-height: 40px;
  }
}

@media (max-width: 480px){
  :root {
    --promo-h: 34px;
    --menu-h: 54px;
  }
  .promo-bar {
    font-size: 11.5px;
  }
  .main-menu .container{
    padding: 0 10px;
  }
  .mobile-search-header{
    padding: 10px 12px;
  }
  .logo {
    max-height: 38px;
    max-width: 100px;
  }
}

@media (max-width: 420px){
  .menu-icons {
    gap: 1px;
  }
  .menu-icons a,
  .menu-icons button,
  .menu-icons .mobile-search-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 16px;
  }
  .menu-login-text {
    display: none;
  }
  .menu-login {
    padding: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
    font-size: 17px;
  }
  .menu-login-icon {
    font-size: 17px;
    color: #1a1a2e;
  }
}

@media (max-width: 380px){
  .menu-wrapper {
    gap: 2px;
  }
  .main-menu .container{
    padding: 0 8px;
  }
  .logo {
    max-height: 34px;
    max-width: 85px;
  }
  .menu-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 18px;
  }
  .menu-icons a,
  .menu-icons button,
  .menu-icons .mobile-search-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 15px;
  }
  .cart-badge,
  .fav-badge {
    min-width: 15px;
    height: 15px;
    font-size: 9px;
  }
}


/* ═══════════════════════════════════════════════════
   User account dropdown + cart badge
   ═══════════════════════════════════════════════════ */

/* ── User Wrap ───────────────────────────────────── */
.menu-user-wrap {
  position: relative;
}

.menu-user {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .2s;
  text-decoration: none;
  color: inherit;
}
.menu-user:hover { background: rgba(0,0,0,.03); }

.menu-user .fa-circle-user {
  font-size: 1.35rem;
  color: var(--brand, #d4a300);
}
.menu-user-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--brand, #d4a300);
}
.menu-user-name {
  font-size: .82rem;
  font-weight: 600;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Dropdown (Desktop Only) ─────────────────────── */
.menu-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 220px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 85px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
  background: #ffffff;
  border: 1px solid var(--border-color, #E6DFD5);
  border-top: 3px solid var(--primary, #D4AF37);
  border-radius: 12px;
  padding: 12px 10px 10px;
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(26, 26, 46, 0.12));
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s cubic-bezier(0.4, 0, 0.2, 1), transform .2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s .2s;
  z-index: 99999;
}
.menu-user-dropdown::-webkit-scrollbar {
  width: 5px;
}
.menu-user-dropdown::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 4px;
}
.menu-user-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.65);
}
@media (min-width: 981px) {
  .menu-user-wrap:hover .menu-user-dropdown,
  .menu-user-wrap:focus-within .menu-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .2s cubic-bezier(0.4, 0, 0.2, 1), transform .2s cubic-bezier(0.4, 0, 0.2, 1);
  }
}
@media (max-width: 980px) {
  .menu-user-dropdown {
    display: none !important;
    pointer-events: none !important;
  }
  .menu-login .fa-chevron-down {
    display: none !important;
  }
}

.menu-user-dropdown-header {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #1A1A2E);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(26, 26, 46, 0.06);
  margin-bottom: 6px;
}
.menu-user-dropdown-header i {
  color: var(--primary, #D4AF37);
  font-size: 1rem;
}

.menu-user-dropdown-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--text-main, #1A1A2E);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  text-align: right;
}

.menu-user-dropdown a i {
  font-size: 0.85rem;
  width: 18px;
  text-align: center;
  color: #718096;
  transition: color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.menu-user-dropdown a:hover {
  color: var(--primary-hover, #B8860B);
  background-color: var(--primary-light, rgba(212, 175, 55, 0.08));
}

.menu-user-dropdown a:hover i {
  color: var(--primary, #D4AF37);
}

.menu-user-dropdown hr {
  border: none;
  border-top: 1px solid rgba(26, 26, 46, 0.08);
  margin: 5px 0;
}

/* Specific styles for Guest Dropdown */
.menu-user-dropdown .menu-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary, #D4AF37);
  color: #ffffff !important;
  text-align: center;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  transition: background-color 0.2s ease;
}

.menu-user-dropdown .menu-login-btn i {
  color: #ffffff !important;
}

.menu-user-dropdown .menu-login-btn:hover {
  background: var(--primary-hover, #B8860B);
  color: #ffffff !important;
}

.menu-user-dropdown .menu-register-prompt {
  font-size: 0.76rem;
  color: var(--text-muted, #6B6B7A);
  text-align: center;
  margin-bottom: 4px;
}

.menu-user-dropdown .menu-register-prompt a {
  display: inline;
  padding: 0;
  color: var(--primary, #D4AF37);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.menu-user-dropdown .menu-register-prompt a:hover {
  color: var(--primary-hover, #B8860B);
  text-decoration: underline;
  background: none;
}

.menu-user-dropdown .menu-logout {
  color: #e11d48 !important;
  font-weight: 600;
  background-color: rgba(225, 29, 72, 0.04);
  margin-top: 2px;
}

.menu-user-dropdown .menu-logout i {
  color: #e11d48 !important;
}

.menu-user-dropdown .menu-logout:hover {
  background-color: rgba(225, 29, 72, 0.12) !important;
  color: #be123c !important;
}

.menu-user-dropdown .menu-logout:hover i {
  color: #be123c !important;
}

/* ── Cart Badge ──────────────────────────────────── */
.menu-cart-icon {
  position: relative;
}
.cart-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(239,68,68,.5);
  animation: badgePop .3s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── Favorites Badge ──────────────────────────────── */
.menu-fav-icon {
  position: relative;
}
.fav-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(236,72,153,.5);
  animation: badgePop .3s cubic-bezier(.34,1.56,.64,1) both;
}

