

/* Mobile layout uses available width rather than desktop offsets or fixed flex bases. */
@media (max-width: 768px) {
 header.ns-header { width: 100%; max-width: 100%; }
 .ns-header .ns-header-desktop { display: none !important; }
 .ns-header .ns-header-mobile { display: block !important; position: relative !important; width: 100% !important; height: auto !important; padding: 10px !important; }
 .ns-header .ns-header-mobile > form { display: flex !important; flex-direction: column; align-items: stretch !important; width: 100%; max-width: 100%; gap: 10px !important; }
 .ns-header .ns-header-mobile .ns-header-site-brand { align-self: center; flex: 0 0 auto !important; margin: 0 auto !important; }
 .ns-header .ns-header-mobile .headerPage { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(44px,1fr)); align-items: center; justify-items: center; gap: 6px !important; min-width: 0; width: 100% !important; height: auto !important; direction: rtl; }
 .ns-header .ns-header-mobile .headerPage > .ns-header-brand,
 .ns-header .ns-header-mobile .ns-header-account { display: contents !important; }
 .ns-header .ns-header-mobile .headerPage .header_icon,
 .ns-header .ns-header-mobile .headerPage .ns-search-trigger { box-sizing: border-box; flex-basis: auto !important; width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; padding: 0 !important; margin: 0 !important; }
 .ns-header .ns-header-mobile .headerPage .onhover-div { width: auto !important; height: auto !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important; }
 .ns-header .ns-header-mobile .ns-search-panel { position: static !important; inset: auto !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; box-sizing: border-box; }
 .ns-header .ns-header-mobile .ns-search-panel-inner { width: 100%; min-width: 0; padding: 6px; gap: 4px; box-sizing: border-box; }
 .ns-header .ns-header-mobile .ns-search-field { min-width: 0; flex: 1 1 0; padding: 4px; }
 .ns-header .ns-header-mobile .ns-search-field > svg { display: none; }
 .ns-header .ns-header-mobile .ns-search-panel-input { width: 0 !important; min-width: 0 !important; flex: 1 1 0; }
 .ns-header .ns-header-mobile .ns-search-close { width: 36px; min-width: 36px; flex: 0 0 36px; }
}

/* Header layout correction: keep every action reachable, including signed-in accounts. */
.ns-header .ns-header-row, .ns-header .headerPage, .ns-header .ns-header-account { min-width: 0; }
.ns-header .ns-header-control, .ns-header .header_icon, .ns-header .ns-search-trigger {
 display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; cursor: pointer;
}
.ns-header .header_icon { filter: none !important; }
.ns-header .ns-search-panel[hidden] { display: none !important; }
.ns-header .ns-search-field { min-width: 0; }
.ns-header .ns-search-field .ns-search-panel-input { min-width: 0 !important; flex: 1 1 0; width: 100% !important; }
.ns-header .ns-search-submit, .ns-header .ns-search-close { flex-shrink: 0; min-height: 44px; }
@media (min-width: 769px) {
 .ns-header .ns-header-row { grid-template-columns: auto minmax(0,1fr) auto !important; gap: 12px !important; }
 .ns-header .ns-header-row > .ns-header-brand { grid-column: 2 !important; }
 .ns-header .ns-header-row > .ns-header-site-brand { grid-column: 1 !important; }
 .ns-header .ns-header-row > .ns-header-actions { grid-column: 3 !important; }
 .ns-header .ns-header-row > .ns-header-search-section { position: static; grid-column: 1 / -1 !important; grid-row: 2 !important; max-width: 100%; }
 .ns-header .ns-header-account { flex-wrap: wrap; }
}
@media (max-width: 768px) {
 .ns-header .ns-header-mobile > form { display: flex !important; flex-direction: column; align-items: stretch !important; gap: 10px !important; width: 100%; height: auto !important; }
 .ns-header .ns-header-mobile .ns-header-site-brand { grid-column: 1; grid-row: 1; position: static !important; width: 46px !important; height: 46px !important; transform: none !important; }
 .ns-header .ns-header-mobile .headerPage { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(44px,1fr)); justify-items: center; width: 100%; height: auto !important; min-height: 48px !important; gap: 6px !important; padding: 0; }
 .ns-header .ns-header-mobile .headerPage > .ns-header-brand { display: contents !important; }
 .ns-header .ns-header-mobile .ns-header-account { gap: 6px !important; flex-wrap: wrap; justify-content: flex-end; }
 .ns-header .ns-header-mobile .headerPage > .ns-search-trigger { margin: 0 !important; }
 .ns-header .ns-header-mobile .header_icon,
 .ns-header .ns-header-mobile .ns-search-trigger,
 .ns-header .ns-header-mobile .onhover-div > .header_icon { width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; }
 .ns-header .ns-header-mobile .ns-cart-holder { margin: 0 !important; }
 .ns-header .ns-header-mobile .ns-search-panel { grid-column: 1 / -1; width: 100%; max-width: 100%; }
 .ns-header .ns-search-panel-inner { display: flex; align-items: center; gap: 6px; padding: 8px; }
 .ns-header .ns-search-field { display: flex; flex: 1; width: 100%; gap: 4px; }
 .ns-header .ns-search-submit { padding-inline: 8px; font-size: 12px; }
}

/* Two balanced mobile action groups, with search floating below the header. */
@media (max-width: 768px) {
 .ns-header .ns-header-mobile > form { position: relative; display: flex !important; flex-direction: column; align-items: stretch !important; min-height: 0; gap: 12px !important; }
 .ns-header .ns-header-mobile .headerPage { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; min-height: 44px !important; column-gap: 16px !important; }
 .ns-header .ns-header-mobile .ns-header-site-brand { position: static !important; align-self: center; flex: 0 0 auto !important; width: 50px !important; height: 50px !important; transform: none !important; margin: 0 auto !important; order: -1; z-index: 2; }
 .ns-header .ns-header-mobile .headerPage > .ns-header-brand { display: flex !important; grid-column: 1; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px !important; width: 100%; margin: 0 !important; }
 .ns-header .ns-header-mobile .ns-header-account { display: flex !important; flex-wrap: wrap; gap: 6px !important; justify-content: flex-start; }
 .ns-header .ns-header-mobile .ns-mobile-actions { display: flex; grid-column: 2; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; width: 100%; }
 .ns-header .ns-header-mobile .ns-mobile-actions > .ns-search-trigger { margin: 0 !important; order: 0 !important; }
 .ns-header .ns-header-mobile .ns-mobile-actions .ns-cart-holder { position: static; }
 .ns-header .ns-header-mobile .ns-search-panel { position: absolute !important; top: calc(100% + 10px) !important; left: -10px !important; right: -10px !important; bottom: auto !important; width: auto !important; max-width: none !important; padding: 10px !important; z-index: 1200; border-radius: 0 0 14px 14px; box-shadow: 0 12px 24px #173e2826; }
}

@media (max-width: 768px) {
 body:has(.ns-mobile-bottom-nav) { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
 .ns-header .ns-header-mobile .headerPage { display: block !important; min-height: 44px !important; }
 .ns-header .ns-header-mobile .headerPage > .ns-header-brand { display: flex !important; justify-content: space-between; width: 100%; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav {
  position: fixed; inset: auto 0 0; z-index: 1000; display: flex !important;
  align-items: center; justify-content: space-evenly; gap: 8px;
  width: 100%; min-height: 68px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box; background: #087b49; border-top: 1px solid #ffffff38;
  box-shadow: 0 -4px 20px #063d2726; direction: rtl;
 }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-header-account { display: contents !important; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav > .ns-cart-holder { position: static; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-cart {
  position: fixed !important; inset: auto 12px calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  width: auto !important; max-width: none !important; max-height: calc(100dvh - 110px) !important;
 }
 .nsp-quick-cart-holder { bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* Navigation polish: consistent targets, readable labels and safe-area spacing. */
@media (max-width: 768px) {
 .ns-header .ns-header-mobile .headerPage > .ns-header-brand { flex-wrap: nowrap; gap: 16px !important; }
 .ns-header .ns-header-mobile .headerPage > .ns-header-brand > button { width: 48px !important; min-width: 48px !important; height: 48px !important; min-height: 48px !important; border-radius: 14px !important; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav { gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom,0px)); min-height: 80px; background: #fff; border-top: 1px solid #dce8e0; box-shadow: 0 -4px 20px #063d2714; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .header_icon { display: flex !important; flex-direction: column; justify-content: center; gap: 4px; width: 48px !important; min-width: 48px !important; height: auto !important; min-height: 60px !important; padding: 6px 2px !important; color: #08613d !important; background: transparent !important; border: 0 !important; border-radius: 10px !important; box-shadow: none !important; text-decoration: none; touch-action: manipulation; transition: background-color 150ms ease; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .header_icon i,
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-cart-trigger::before { font-size: 22px; line-height: 24px; color: inherit !important; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .header_icon:hover,
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .header_icon:active { background: #e8f4ed !important; color: #063d27 !important; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-nav-label { font: inherit; font-size: 11px; line-height: 1.5; white-space: nowrap; color: inherit; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-cart-trigger { position: relative; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .circle-red-basket { top: 0 !important; right: 0 !important; min-width: 18px; height: 18px; font-size: 10px; line-height: 16px; }
 body:has(.ns-mobile-bottom-nav) { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-cart { bottom: calc(92px + env(safe-area-inset-bottom,0px)) !important; max-height: calc(100dvh - 116px) !important; }
 .ns-header .ns-header-mobile .ns-search-close { min-width: 44px; width: 44px; flex-basis: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
 .ns-header .header_icon, .ns-header .ns-search-trigger { transition: none !important; }
}

/* Restore the header green while preserving the white bottom navigation. */
.ns-header .ns-header-desktop,
.ns-header .ns-header-mobile {
 background: linear-gradient(270deg, #02B756 0%, #00F572 100%) !important;
}
@media (max-width: 768px) {
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav {
  background: #fff !important;
  border-top-color: #dce8e0 !important;
 }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .header_icon {
  color: #08613d !important;
 }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .header_icon:hover,
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .header_icon:active {
  background: #e8f4ed !important;
  color: #063d27 !important;
 }
}


/* Dark green icons on light controls keep contrast against the bright header. */
.ns-header .ns-header-desktop .ns-header-control,
.ns-header .ns-header-desktop .ns-search-trigger,
.ns-header .ns-header-desktop #show-sidebar.ns-header-control,
.ns-header .ns-header-mobile #show-mobile-sidebar.header_icon,
.ns-header .ns-header-mobile .ns-header-brand > .ns-search-trigger {
 background: #f3fff7 !important;
 color: #075b36 !important;
 border: 1px solid rgba(7,91,54,.18) !important;
 box-shadow: 0 2px 6px rgba(6,61,39,.08) !important;
}
.ns-header .ns-header-desktop .ns-header-control:hover,
.ns-header .ns-header-desktop .ns-search-trigger:hover,
.ns-header .ns-header-mobile #show-mobile-sidebar.header_icon:hover,
.ns-header .ns-header-mobile .ns-header-brand > .ns-search-trigger:hover {
 background: #dcfce7 !important;
 color: #063d27 !important;
}
.ns-header .ns-header-desktop .ns-header-control > a { color: inherit !important; }
.ns-header .circle-red-basket {
 display: inline-flex !important; align-items: center; justify-content: center;
 min-width: 20px !important; height: 20px !important; width: auto !important;
 padding: 0 5px !important; border: 0 !important; border-radius: 999px !important;
 background: #c81e42 !important; color: #fff !important; box-shadow: none !important;
 font-size: 11px !important; font-weight: 700; line-height: 20px !important;
 font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .circle-red-basket {
  top: 0 !important; right: -2px !important;
 }
}

/* Labels must not inherit the legacy Arial font of header_icon. */
.ns-header .ns-header-mobile .ns-mobile-bottom-nav,
.ns-header .ns-header-mobile .ns-mobile-bottom-nav .header_icon,
.ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-nav-label,
.ns-header .ns-header-mobile .ns-mobile-bottom-nav .circle-red-basket {
 font-family: 'IRANSansX', sans-serif !important;
}

@media (max-width: 768px) {
 .ns-header .ns-header-mobile > form > .ns-header-site-brand {
  position: absolute !important; top: 50%; left: 50%;
  transform: translate(-50%, -50%) !important; margin: 0 !important;
  width: 55px !important; height: 55px !important; z-index: 2;
  background: transparent !important; border: 0 !important;
  box-shadow: none !important; padding: 0 !important; border-radius: 0 !important;
 }
 .ns-header .ns-header-mobile > form > .ns-header-site-brand img {
  border-radius: 0 !important; object-fit: contain;
  filter: drop-shadow(1px 1px 1px black);
 }
 .ns-header .ns-header-mobile .headerPage > .ns-header-brand {
  min-height: 68px; padding-inline: 0;
 }
 .ns-header .ns-header-mobile .ns-bottom-shop i {
  color: #087b49; font-size: 26px; line-height: 1;
 }
 .ns-header .ns-header-mobile .ns-bottom-shop {
  flex-direction: column; gap: 3px; text-decoration: none;
 }
 .ns-header .ns-header-mobile .ns-bottom-shop .ns-shop-label {
  font-family: 'IRANSansX', sans-serif !important;
  font-size: 10px; font-weight: 600; line-height: 1.5; color: #08613d;
 }
}

/* Raised circular brand at the centre of the mobile bottom navigation. */
@media (max-width: 768px) {
 .ns-header .ns-header-mobile > form { gap: 0 !important; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 88px minmax(0,1fr);
  align-items: center;
  gap: 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom,0px));
  overflow: visible;
 }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-header-account {
  display: flex !important; grid-column: 1; flex-wrap: wrap;
  align-items: center; justify-content: space-evenly; gap: 8px !important; min-width: 0;
 }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-bottom-actions {
  display: flex; grid-column: 3; align-items: center; justify-content: space-evenly;
  flex-wrap: wrap; gap: 8px; min-width: 0;
 }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav > .ns-header-site-brand,
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav > .ns-header-site-brand:hover {
  position: absolute !important; left: 50%; top: -24px; bottom: auto;
  width: 64px !important; height: 64px !important; min-width: 64px;
  margin: 0 !important; padding: 8px !important;
  transform: translateX(-50%) !important; border-radius: 50% !important;
  background: #fff !important; border: 1px solid #dce8e0 !important;
  box-shadow: 0 0 0 10px #f4f8f5, 0 -4px 16px #063d2720 !important;
  z-index: 2;
 }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav > .ns-header-site-brand img {
  width: 100% !important; height: 100% !important; object-fit: contain;
  border-radius: 0 !important;
 }
 body:has(.ns-mobile-bottom-nav) { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
 .ns-header .ns-header-mobile .ns-mobile-bottom-nav .ns-cart { bottom: calc(152px + env(safe-area-inset-bottom,0px)) !important; max-height: calc(100dvh - 176px) !important; }
}
