/* nav.css v1 — a fejléc-menü (partials/main-nav) stílusai. 2026-10-28 SEO-audit #10 (K6): a layouts/shop.blade.php és a
   partials/main-nav inline <style> blokkjaiból kiszervezve (változatlan szabályok + a lenyíló betöltés-jelzője). Immutable
   cache: változtatásnál a layout `?v=` paraméterét bumpolni kell. A shop.css UTÁN töltődik (a .nav-link itt felülír). */

/* z-index 380: a main-nav saját stacking contextet képez, és a benne lévő .cat-flyout-overlay (360) + .cat-flyout (370)
   a sidebar bannerek (350) FÖLÉ kell hogy kerüljön. A header (400) továbbra is felülmarad. */
.main-nav { position: relative; z-index: 380; background: var(--bg, #f8f8f8); }
.nav-inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: stretch; padding: 0 24px; gap: 0; }
.cat-dropdown + .cat-dropdown { margin-left: 8px; }
.cat-dropdown { position: relative; display: flex; align-items: stretch; }
.cat-dropdown-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px; height: 44px;
  background: var(--magenta); color: white;
  font-weight: 600; font-size: 14px;
  cursor: pointer; border: none;
  font-family: var(--font-display);
  white-space: nowrap; text-decoration: none;
  transition: background 0.15s;
}
.cat-dropdown-btn:hover { background: var(--magenta-dark, #b8005f); color: white; }
.cat-dropdown-btn i { font-size: 15px; }
.cat-flyout {
  position: absolute; top: 100%; left: 0;
  /* a flyoutnak az overlay (360) és a sidebar bannerek (350) FÖLÖTT kell lennie */
  z-index: 370;
  opacity: 0; visibility: hidden; pointer-events: none;
  /* nyitáskor azonnal visible (a linkek rögtön fókuszálhatók), csukáskor a halványítás végén hidden */
  transition: opacity 0.18s, visibility 0s 0.18s;
}
.cat-dropdown.open .cat-flyout { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.18s, visibility 0s; }
.cat-flyout-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.18);
  /* a sidebar bannerek z-index = 350 — az overlay azok FÖLÉ kerül, a header (400) fölötte marad */
  z-index: 360;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}
.cat-dropdown.open ~ .cat-flyout-overlay { opacity: 1; visibility: visible; pointer-events: auto; }
.cat-flyout-left {
  width: 280px; background: white;
  border: 1px solid var(--border); border-top: 3px solid var(--magenta);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  max-height: 520px; overflow-y: auto; overscroll-behavior: contain;
  flex-shrink: 0;
}
.cat-flyout-left::-webkit-scrollbar { width: 4px; }
.cat-flyout-left::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.cat-flyout-item { position: relative; }
.cat-flyout-item > a {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 11px 16px; font-size: 14px; color: var(--text-secondary);
  text-decoration: none; transition: background 0.1s, color 0.1s;
  border-left: 3px solid transparent;
}
.cat-flyout-item:hover > a,
.cat-flyout-item.active > a { background: var(--bg); color: var(--magenta); border-left-color: var(--magenta); }
.cat-flyout-arrow { font-size: 10px; opacity: 0.4; transition: opacity 0.15s; margin-left: auto; }
.cat-flyout-item:hover .cat-flyout-arrow,
.cat-flyout-item.active .cat-flyout-arrow { opacity: 1; }
.cat-flyout-right {
  position: absolute; left: 280px; top: 0; width: 560px;
  background: white; border: 1px solid var(--border); border-top: 3px solid var(--magenta); border-left: none;
  box-shadow: 8px 12px 40px rgba(0,0,0,0.1);
  padding: 20px 24px; display: none;
  max-height: 520px; overflow-y: auto; overscroll-behavior: contain;
}
.cat-flyout-right.visible { display: block; }
.cat-flyout-right-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.cat-flyout-right-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); }
.cat-flyout-view-all { font-size: 12px; font-weight: 600; color: var(--magenta); text-decoration: none; display: flex; align-items: center; gap: 4px; }
.cat-flyout-view-all:hover { text-decoration: underline; }
.cat-flyout-right-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 16px; }
.cat-sub-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 13px; color: var(--text-secondary);
  text-decoration: none; border-radius: 6px; transition: background 0.1s, color 0.1s;
}
.cat-sub-link:hover { background: var(--bg); color: var(--magenta); }
.cat-sub-count, .nav-dd-count { display: none; }

.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 0 14px; height: 44px; font-size: 14px; font-weight: 500;
  white-space: nowrap; transition: color 0.15s;
  text-decoration: none; color: var(--text-secondary);
}
.nav-link:hover { color: var(--magenta); }
.nav-link.highlight { color: #dc2626; font-weight: 600; }
.nav-link.highlight:hover { color: #b91c1c; }

/* Lenyílók: gyártó, márka, mesehős (egységes markup; a tartalom a /nav-fragment/{kind} töredékből jön) */
.nav-dd { position: relative; display: flex; align-items: stretch; }
.nav-dd-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; height: 44px;
  background: transparent; color: var(--text-secondary);
  font-weight: 600; font-size: 14px;
  cursor: pointer; border: none;
  font-family: var(--font-display);
  white-space: nowrap; text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-dd-btn:hover { color: var(--magenta); }
.nav-dd-btn i { font-size: 13px; transition: transform 0.2s; }
.nav-dd.open .nav-dd-btn i.nav-dd-chevron { transform: rotate(180deg); }
.nav-dd.open .nav-dd-btn { color: var(--magenta); }
.nav-dd-flyout {
  position: absolute; top: 100%; left: 0; z-index: 300;
  background: white; border: 1px solid var(--border); border-top: 3px solid var(--magenta);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  border-radius: 0 0 12px 12px;
  min-width: 520px; max-height: 480px;
  padding: 16px 20px;
  opacity: 0; visibility: hidden; pointer-events: none;
  /* nyitáskor AZONNAL visible (fókuszálható a kereső), csukáskor a halványítás végén lesz hidden */
  transition: opacity 0.18s, visibility 0s 0.18s;
  overflow-y: auto;
}
.nav-dd.open .nav-dd-flyout { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.18s, visibility 0s; }
.nav-dd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.nav-dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; font-size: 13px;
  color: var(--text-secondary); text-decoration: none;
  border-radius: 8px; transition: background 0.1s, color 0.1s;
}
.nav-dd-item:hover { background: var(--bg); color: var(--magenta); }
.nav-dd-search {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none; margin-bottom: 10px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 10px center no-repeat;
  transition: border-color 0.15s;
}
.nav-dd-search:focus { border-color: var(--magenta); }
.nav-dd-no-result { grid-column: 1 / -1; text-align: center; padding: 16px; color: var(--text-muted); font-size: 13px; display: none; }
/* Betöltés-jelző, amíg a lenyíló tartalma (töredék) érkezik — a nav.js siker után leveszi a data-nav-fragment attribútumot */
.nav-dd-flyout[data-nav-fragment] { min-height: 88px; }
.nav-dd-flyout[data-nav-fragment]::after {
  content: ""; display: block; width: 22px; height: 22px; margin: 16px auto;
  border: 2px solid var(--border); border-top-color: var(--magenta); border-radius: 50%;
  animation: nav-spin .8s linear infinite;
}
@keyframes nav-spin { to { transform: rotate(360deg); } }

/* Ajándékválasztó-doboz a menüsor végén (2026-10-20) */
.nav-gift { display: flex; align-items: center; padding: 0 14px; height: 44px; flex: 0 0 auto; }
.nav-gift-anim { position: relative; display: block; height: 40px; width: 52px; transition: transform .2s ease; }
.nav-gift:hover .nav-gift-anim { transform: scale(1.08); }
.nav-gift-lottie { position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease; }
.nav-gift-lottie.is-on { opacity: 1; }
.nav-gift-lottie svg { display: block; width: 100% !important; height: 100% !important; }
/* keskenyebb ablakban a menüsor linkjei már maguk is kitöltik a sort (~1 200 px) → ott nem fér el, nem mutatjuk */
@media (max-width: 1319px) { .nav-gift { display: none; } }

/* Menüsor-illesztés (nav.js): fokozatosan szűkebb térköz, majd a sor végéről menüpont-rejtés */
.nav-inner.nav-tight > .nav-link { padding: 0 8px; }
.nav-inner.nav-tight > .nav-gift { padding: 0 6px; }
.nav-inner.nav-tight.nav-tight2 > .nav-link { padding: 0 5px; }
.nav-inner.nav-tight.nav-tight2 > .nav-gift { padding: 0 4px; }
.nav-inner > .nav-fit-hidden { display: none !important; }

@media (max-width: 1100px) {
  .cat-flyout-right { width: 400px; }
  .cat-flyout-right-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* a flyout mobilon rejtett (a .main-nav-ot a shop.css is elrejti) */
  .cat-flyout { display: none !important; }
  .cat-flyout-overlay { display: none !important; }
  .cat-dropdown-btn { padding: 0 14px; font-size: 13px; height: 40px; gap: 6px; }
  .nav-link { padding: 0 10px; font-size: 13px; height: 40px; }
  .nav-dd { display: none; }
}
