/* NIKTAZEH Porodo Header v1.8.0 */
:root{ --nkth-brand:#4B1D84; --nkth-ink:#0f172a; }

.nkth-header{ position:sticky; top:0; z-index:999999; background:#fff; border-bottom:1px solid rgba(2,6,23,.08); }
.nkth-inner{ max-width:1200px; margin:0 auto; padding:10px 14px; }

.nkth-logo{ display:flex; align-items:center; justify-content:center; text-decoration:none; }
.nkth-logo img{ height:38px; width:auto; max-width:190px; display:block; object-fit:contain; }

.nkth-ico-btn{ appearance:none; border:0; background:transparent; padding:8px; border-radius:12px; color:var(--nkth-brand); display:inline-flex; align-items:center; justify-content:center; line-height:0; }
.nkth-ico-btn svg{ display:block; }
.nkth-ico-btn:active{ transform:translateY(1px); }

.nkth-actions{ display:flex; align-items:center; gap:4px; }
.nkth-cart{ position:relative; }
.nkth-badge{ position:absolute; top:2px; right:2px; min-width:18px; height:18px; border-radius:999px; background:var(--nkth-brand); color:#fff; font-size:11px; font-weight:800; display:flex; align-items:center; justify-content:center; padding:0 5px; }

/* Mobile bar */
.nkth-mobile{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.nkth-mobile .nkth-logo img{ height:44px; max-width:220px; }

/* Desktop bar */
.nkth-desktop{ display:none; align-items:center; justify-content:space-between; gap:16px; }

.nkth-nav{ flex:1; }
.nkth-nav-list{ list-style:none; margin:0; padding:0; display:flex; align-items:center; justify-content:center; gap:18px; }
.nkth-nav-list > li{ position:relative; }
.nkth-nav-list > li > a{ display:inline-flex; align-items:center; gap:8px; padding:10px 10px; border-radius:12px; text-decoration:none; color:var(--nkth-ink); font-weight:700; font-size:14px; }
.nkth-nav-list > li > a:hover{ background:rgba(75,29,132,.06); color:var(--nkth-brand); }

/* Mega panel */
.nkth-mega{
  position:absolute;
  top:100%;
  /* ✅ center under the parent item (prevents jumping to left) */
  left:50%;
  right:auto;
  width:min(560px, calc(100vw - 32px));
  background:#fff;
  border:1px solid rgba(2,6,23,.10);
  border-radius:16px;
  padding:14px;
  box-shadow:0 20px 60px rgba(2,6,23,.12);
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
  opacity:0;
  pointer-events:none;
  /* ✅ no hover gap: element touches nav but is visually lower */
  transform: translate(calc(-50% + var(--nkth-shift, 0px)), 10px);
  transition: opacity .18s ease, transform .18s ease;
}
.nkth-mega a{
  text-decoration:none;
  color:rgba(15,23,42,.88);
  font-weight:650;
  font-size:13px;
  padding:10px 10px;
  border-radius:12px;
  background:rgba(2,6,23,.02);
  display:flex;
  align-items:center;
  gap:10px;
}
.nkth-mega a img{
  width:34px;
  height:34px;
  border-radius:12px;
  object-fit:contain;
  background:#fff;
  border:1px solid rgba(2,6,23,.08);
  flex:0 0 34px;
}
.nkth-mega a span{ display:block; line-height:1.35; }
.nkth-mega a:hover{ background:rgba(75,29,132,.06); color:var(--nkth-brand); }

.nkth-nav-list > li.has-mega:hover .nkth-mega,
.nkth-nav-list > li.has-mega.is-open .nkth-mega{ opacity:1; pointer-events:auto; }

/* Drawer */
.nkth-drawer{ position:fixed; inset:0; z-index:1000000; display:none; }
.nkth-drawer.is-open{ display:block; }
.nkth-drawer-overlay{ position:absolute; inset:0; background:rgba(2,6,23,.45); }
.nkth-drawer-panel{ position:absolute; top:0; right:0; width:min(86vw, 360px); height:100%; background:#fff; box-shadow:-20px 0 60px rgba(2,6,23,.22);
  display:flex; flex-direction:column; }
.nkth-drawer-head{ display:flex; align-items:center; justify-content:space-between; padding:14px 14px 10px; border-bottom:1px solid rgba(2,6,23,.08); }
.nkth-drawer-logo img{ height:44px; width:auto; max-width:220px; }
.nkth-drawer-close{ border:0; background:rgba(2,6,23,.06); width:38px; height:38px; border-radius:12px; font-size:22px; line-height:0; color:var(--nkth-ink); }

.nkth-drawer-actions{ display:flex; gap:10px; padding:12px 14px; }
.nkth-drawer-btn{ flex:1; text-align:center; padding:10px 12px; border-radius:12px; text-decoration:none; font-weight:800; color:var(--nkth-brand); background:rgba(75,29,132,.06); }

.nkth-drawer-footer{ padding:18px 14px 22px; border-top:1px solid rgba(2,6,23,.10); background:#fff; }

.nkth-drawer-scroll{ flex:1; overflow:auto; padding:4px 10px 16px; }

@media(max-width: 980px){
  /* ✅ جلوگیری از رفتن آیتم‌ها زیر منوبار پایین موبایل */
  .nkth-drawer-scroll{ padding-bottom: calc(18px + env(safe-area-inset-bottom) + 92px); }
}
.nkth-accordion{ padding:0; overflow:visible; }
.nkth-acc-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px;
  border:0;
  border-radius:14px;
  background:transparent;
  color:var(--nkth-ink);
  font-weight:560;
  font-size:13.5px;
  line-height:1.6;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
}
.nkth-acc-btn:hover{ background:rgba(2,6,23,.04); }
.nkth-acc-btn.is-open{ color:var(--nkth-brand); background:rgba(124,58,237,.10); }
.nkth-acc-ico{ color:rgba(75,29,132,.95); display:inline-flex; align-items:center; justify-content:center; }
.nkth-acc-ico svg{ width:18px; height:18px; }

.nkth-acc-panel{ display:none; padding:2px 8px 10px 8px; }
.nkth-acc-panel a{
  display:block;
  text-decoration:none;
  padding:12px 12px;
  border-radius:12px;
  color:rgba(15,23,42,.84);
  font-weight:520;
  font-size:13px;
  line-height:1.7;
  background:rgba(2,6,23,.02);
  margin:6px 0;
  -webkit-tap-highlight-color: transparent;
}
.nkth-acc-panel a:hover{ background:rgba(75,29,132,.06); color:var(--nkth-brand); }

.nkth-acc-link{
  display:block;
  padding:14px 14px;
  margin:6px 0;
  border-radius:14px;
  text-decoration:none;
  font-weight:560;
  font-size:13.5px;
  line-height:1.6;
  color:var(--nkth-ink);
  background:rgba(2,6,23,.03);
  -webkit-tap-highlight-color: transparent;
}

.nkth-acc-btn.is-open + .nkth-acc-panel{ display:block; }

/* Responsive: separate mobile/desktop (fix your main issue) */
@media (min-width: 1025px){
  .nkth-mobile{ display:none; }
  .nkth-desktop{ display:flex; }
  .nkth-logo img{ height:46px; max-width:240px; }
  .nkth-mega{ width:min(760px, 70vw); grid-template-columns:repeat(3, minmax(0,1fr)); }
}

/* Ensure nothing from theme forces red */
.nkth-header, .nkth-header *{ box-sizing:border-box; }

/* === Search modal styles (copied from niktazeh-mobile-fixes v1.2.9, minimal) === */
/* Search modal */
.nmf-search-modal{
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: none;
  direction: rtl;
  touch-action: none;
}
.nmf-search-modal.nmf-open{ display:block; }

.nmf-search-overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.nmf-search-panel{
  position: fixed;
  left: 10px;
  right: 10px;
  top: 12px;
  bottom: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(0,0,0,.28);
  padding: 12px;
}

.nmf-search-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 4px 2px 10px;
}
.nmf-search-title{ font-size: 14px; font-weight: 800; }
.nmf-search-close{
  width: 34px; height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  font-size: 22px;
  line-height: 30px;
  cursor: pointer;
}

.nmf-search-form{
  display:flex;
  gap:8px;
  align-items:center;
  padding: 8px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 16px;
}
.nmf-search-input{
  flex: 1 1 auto;
  min-width: 0;
  border: 0 !important;
  outline: none !important;
  font-size: 16px;
  padding: 10px 8px;
  background: transparent !important;
}
.nmf-search-submit{
  flex: 0 0 auto;
  border: 0;
  background: #111;
  color: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor:pointer;
}

.nmf-search-section{ padding: 12px 2px 2px; }
.nmf-search-section-title{
  font-size: 12px;
  font-weight: 800;
  opacity: .9;
  margin-bottom: 10px;
}

.nmf-search-cats{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 480px){
  .nmf-search-cats{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.nmf-cat{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  text-decoration:none !important;
  color: inherit;
  padding: 10px 6px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
}

.nmf-cat-ico{
  width: 54px; height: 54px;
  border-radius: 999px;
  border: 2px solid #7c3aed;
  box-shadow: 0 0 0 6px rgba(124,58,237,.12);
  display:grid;
  place-items:center;
  overflow:hidden;
}
.nmf-cat-ico img{
  width: 34px; height: 34px;
  object-fit: contain;
  display:block;
}

.nmf-cat-name{
  font-size: 11px;
  text-align:center;
  line-height: 1.2;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nmf-search-links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.nmf-search-links a{
  text-decoration:none !important;
  color:#111;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
}

/* iOS Safari: prevent input focus zoom inside modal */
@supports (-webkit-touch-callout: none) {
  .nmf-search-panel { -webkit-text-size-adjust: 100%; }
  .nmf-search-input{
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
}


/* Tabs */
.nmf-tabs{
  display:flex;
  gap:8px;
  padding: 10px 2px 2px;
}
.nmf-tab{
  flex:1 1 0;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  color:#111;
  padding: 10px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  cursor:pointer;
}
.nmf-tab.is-active{
  border-color: rgba(124,58,237,.45);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}

.nmf-pane{ display:none; padding-top: 10px; }
.nmf-pane.is-active{ display:block; }

/* Brands grid */
.nmf-brands{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 480px){
  .nmf-brands{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.nmf-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  height: 78px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.98);
  box-shadow: 0 10px 22px rgba(2,6,23,.06);
  text-decoration:none !important;
  overflow:hidden;
  position:relative;
}
.nmf-brand:before{
  content:"";
  position:absolute;
  inset:-40% -30%;
  background: radial-gradient(circle at 35% 30%, rgba(124,58,237,.10), transparent 55%);
  opacity:.85;
  pointer-events:none;
}
.nmf-brand-logo{
  width: 128px;
  height: 44px;
  display:grid;
  place-items:center;
  z-index:1;
}
.nmf-brand-logo img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
}


/* ===== Brands (modal) - chip horizontal scroll (not stretched rectangles) ===== */
.nmf-brands-row{
  display:flex;
  flex-wrap:nowrap;
  gap:12px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width:none;
  padding: 6px 6px 14px 6px;
  margin: 0;
  direction: rtl;
  scroll-snap-type: x proximity;
  mask-image: linear-gradient(to left, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
}
.nmf-brands-row::-webkit-scrollbar{ height:0; }

.nmf-brand-chip{
  flex: 0 0 auto;
  scroll-snap-align: start;

  height: 64px;
  min-width: 150px;

  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0);
  border:1px solid rgba(2,6,23,.10);
  text-decoration:none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nmf-brand-chip:hover,
.nmf-brand-chip:focus-visible{
  transform: translateY(-2px);
  background: rgba(124,58,237,.06);
  border-color: rgba(124,58,237,.70);
  box-shadow: 0 0 0 2px rgba(124,58,237,.15);
}

.nmf-brand-chip img{
  width: 150px;
  height:auto;
  max-height: 42px;
  object-fit: contain;
  filter: brightness(0) saturate(100%);
  transition: filter .18s ease;
}
.nmf-brand-chip:hover img,
.nmf-brand-chip:focus-visible img{ filter:none; }

/* Desktop: modal as right-side panel (about 1/3 screen) */
@media (min-width:1025px){
  .nmf-search-panel{
    left:auto !important;
    right:16px !important;
    top:16px !important;
    bottom:16px !important;
    width:min(440px, 33vw) !important;
    max-width:520px !important;
    border-radius:18px !important;
    box-shadow:0 28px 80px rgba(2,6,23,.18) !important;
  }
}


/* ===== Drawer extra sections (mobile) ===== */
.nkth-drawer-section{padding:10px 14px 0}
.nkth-drawer-section-title{font-weight:900;font-size:16px;color:var(--nkth-brand);margin:18px 0 10px;text-align:center;letter-spacing:-.15px}

/* pages list like screenshot */
.nkth-drawer-links{list-style:none;margin:0;padding:0;border:1px solid rgba(2,6,23,.08);border-radius:18px;overflow:hidden;background:#fff}
.nkth-drawer-links li{margin:0}
.nkth-drawer-links a{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 14px;text-decoration:none;color:#0f172a;font-weight:520;font-size:14px;line-height:1.7;border-bottom:1px solid rgba(2,6,23,.06)}
.nkth-drawer-links li:last-child a{border-bottom:0}

/* brands chips: 2-column grid */
.nkth-drawer-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.nkth-drawer-chips a{display:flex;align-items:center;justify-content:center;padding:10px 10px;border-radius:18px;border:1px solid rgba(2,6,23,.10);background:#fff;text-decoration:none}
.nkth-drawer-chips img{height:24px;width:auto;max-width:100%;display:block;filter:brightness(0) saturate(100%);transition:filter .18s ease}
.nkth-drawer-chips a:hover img,.nkth-drawer-chips a:focus-visible img{filter:none}

/* social row fixed in footer */
.nkth-drawer-social{display:flex;align-items:center;justify-content:center;gap:22px}
.nkth-drawer-social a{width:52px;height:52px;border-radius:18px;border:1px solid rgba(124,58,237,.25);display:flex;align-items:center;justify-content:center;color:var(--nkth-brand);background:#fff;text-decoration:none}
.nkth-drawer-social svg{width:34px;height:34px;display:block;fill:currentColor}
.nkth-drawer-social svg *{stroke:currentColor}

/* Tap/active readability (no white-on-white) */
.nkth-drawer a{-webkit-tap-highlight-color:transparent}
.nkth-acc-btn:active,.nkth-acc-btn:focus-visible{background:rgba(124,58,237,.10);border-color:rgba(124,58,237,.55);color:var(--nkth-brand)}
.nkth-acc-link:hover,.nkth-acc-link:active,.nkth-acc-link:focus-visible,
.nkth-acc-panel a:hover,.nkth-acc-panel a:active,.nkth-acc-panel a:focus-visible,
.nkth-drawer-links a:hover,.nkth-drawer-links a:active,.nkth-drawer-links a:focus-visible{background:rgba(124,58,237,.08);color:var(--nkth-brand)}

/* ===== Desktop mega thumbs ===== */
@media(min-width:1025px){
  .nkth-mega-link{display:flex;align-items:center;gap:10px}
  .nkth-mega-thumb{width:34px;height:34px;border-radius:10px;object-fit:cover;border:1px solid rgba(2,6,23,.08);flex:0 0 34px}
  .nkth-mega-link span{display:inline-block}
  /* Hover bridge to prevent accidental close */
  .nkth-mega:before{content:"";position:absolute;left:0;right:0;top:-12px;height:12px}
}

/* ===== PC Search modal => right panel (1/3) ===== */
@media(min-width:1025px){
  .nmf-search-modal__box{
    width:min(420px, 33vw);
    max-width:520px;
    height:100%;
    border-radius:0;
    right:0;
    left:auto;
    top:0;
    transform:none;
    padding:18px 18px 22px;
  }
}

/* ===== Product page inline search (top of single product) ===== */
.nkth-pdp-search{max-width:1200px;margin:10px auto 0;padding:0 14px}
.nkth-pdp-box{display:flex;align-items:center;gap:10px;border:1px solid rgba(124,58,237,.28);background:#fff;border-radius:18px;padding:10px 12px;box-shadow:0 10px 24px rgba(2,6,23,.06)}
.nkth-pdp-ico{width:40px;height:40px;border-radius:14px;display:grid;place-items:center;background:rgba(124,58,237,.08);color:var(--nkth-brand);flex:0 0 40px}
.nkth-pdp-box input[type="search"]{flex:1;border:0;outline:none;background:transparent;font-size:14px;font-weight:600;color:var(--nkth-ink);padding:6px 2px}
.nkth-pdp-box input[type="search"]::placeholder{color:rgba(15,23,42,.55);font-weight:500}
.nkth-pdp-box button{border:0;background:var(--nkth-brand);color:#fff;border-radius:14px;padding:10px 12px;display:inline-flex;align-items:center;gap:8px;font-weight:800;font-size:13px;cursor:pointer}
.nkth-pdp-box button:active{transform:translateY(1px)}
@media(max-width:920px){
  .nkth-pdp-search{margin:8px auto 0;padding:0 12px}
  .nkth-pdp-box{border-radius:16px}
  .nkth-pdp-box button{padding:10px 10px;font-size:12.5px}
}
