/* ============================================================
   VIT-102 — Sticky header + mega-menu
   Brand: Vitano
   Tokens: tokens.css (var(--vitano-*), var(--font-*), var(--sp-*))
   Mobile-first: 360px-től felfelé
   ============================================================ */

/* Az Astra default header eltüntetése — a Vitano custom header veszi át */
.ast-primary-header,
.site-header,
.ast-primary-header-bar,
#ast-desktop-header,
#ast-mobile-header,
.ast-mobile-header-wrap {
    display: none !important;
}

/* Vitano header — sticky, blur scrollkor */
.vitano-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--vitano-cream);
    transition: background var(--dur) var(--ease-soft), box-shadow var(--dur) var(--ease-soft);
    border-bottom: 1px solid transparent;
}

.vitano-header[data-scrolled="true"] {
    background: rgba(250, 246, 241, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--vitano-line-2);
    box-shadow: var(--shadow-xs);
}

.vitano-header-inner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    height: 64px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--sp-4);
}

@media (min-width: 768px) {
    .vitano-header-inner {
        height: 64px;
        min-height: 60px;
        padding: 0 var(--sp-6);
        gap: var(--sp-5);
    }
}

/* Hamburger (mobil) */
.vitano-header-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--vitano-charcoal);
    cursor: pointer;
    border-radius: var(--radius);
}
.vitano-header-hamburger:hover { background: var(--vitano-line-2); }
.vitano-header-hamburger:focus-visible { outline: 2px solid var(--vitano-terracotta); outline-offset: 2px; }

@media (min-width: 1024px) {
    .vitano-header-hamburger { display: none; }
}

/* Logó */
.vitano-header-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.vitano-header-logo img {
    height: 44px;
    width: 44px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}
@media (min-width: 768px) {
    .vitano-header-logo img { height: 48px; width: 48px; }
}

/* Desktop nav */
.vitano-header-nav { display: none; flex: 0 0 auto; }
@media (min-width: 1024px) {
    .vitano-header-nav { display: block; }
}

.vitano-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--sp-6);
    align-items: center;
}

.vitano-nav-item { position: relative; }

.vitano-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--vitano-charcoal);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    padding: var(--sp-3) 0;
    border-bottom: 2px solid transparent;
    transition: color var(--dur-fast) var(--ease-soft), border-color var(--dur-fast) var(--ease-soft);
}
.vitano-nav-link:hover,
.vitano-nav-link:focus-visible {
    color: var(--vitano-terracotta);
    border-bottom-color: var(--vitano-terracotta);
    outline: none;
}

/* Inline kereső (desktop) */
.vitano-header-search {
    display: none;
    flex: 1 1 auto;
    max-width: 360px;
    position: relative;
}
@media (min-width: 1024px) {
    .vitano-header-search { display: flex; align-items: center; }
}

.vitano-header-search .vitano-search-icon {
    position: absolute;
    left: var(--sp-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--vitano-charcoal-3);
    pointer-events: none;
}

.vitano-header-search input[type="search"] {
    width: 100%;
    height: 42px;
    background: var(--vitano-white);
    border: 1px solid var(--vitano-line);
    border-radius: var(--radius-pill);
    padding: 0 var(--sp-5) 0 calc(var(--sp-4) + 22px);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--vitano-charcoal);
    outline: none;
    transition: border-color var(--dur) var(--ease-soft), box-shadow var(--dur) var(--ease-soft);
}
.vitano-header-search input[type="search"]:focus {
    border-color: var(--vitano-terracotta);
    box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.15);
}
.vitano-header-search input::placeholder { color: var(--vitano-charcoal-3); }

/* Akció ikonok */
.vitano-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.vitano-header-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--vitano-charcoal);
    text-decoration: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-soft);
}
.vitano-header-action:hover { background: var(--vitano-line-2); color: var(--vitano-terracotta); }
.vitano-header-action:focus-visible { outline: 2px solid var(--vitano-terracotta); outline-offset: 2px; }

/* Search ikon csak mobilon */
.vitano-header-search-toggle { display: inline-flex; }
@media (min-width: 1024px) {
    .vitano-header-search-toggle { display: none; }
}

/* Kosár badge */
.vitano-header-cart .vitano-cart-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--vitano-terracotta);
    color: var(--vitano-cream);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: var(--radius-pill);
}
.vitano-header-cart .vitano-cart-count[hidden] { display: none; }

/* ============================================================
   Mega-menu
   ============================================================ */
.vitano-megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--vitano-cream);
    border-top: 1px solid var(--vitano-line-2);
    box-shadow: var(--shadow);
    z-index: 999;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity var(--dur) var(--ease-soft), transform var(--dur) var(--ease-soft);
}

.vitano-megamenu[data-open="true"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.vitano-megamenu-inner {
    display: grid;
    grid-template-columns: 1fr 300px 280px;
    gap: var(--sp-7);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--sp-7) var(--sp-6);
}

.vitano-megamenu-cats ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3) var(--sp-6);
}
.vitano-megamenu-cats a {
    display: block;
    padding: var(--sp-2) 0;
    color: var(--vitano-charcoal);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--dur-fast) var(--ease-soft), border-color var(--dur-fast) var(--ease-soft);
}
.vitano-megamenu-cats a:hover,
.vitano-megamenu-cats a:focus-visible {
    color: var(--vitano-terracotta);
    border-bottom-color: var(--vitano-terracotta);
    outline: none;
}

.vitano-megamenu-all {
    display: inline-block;
    margin-top: var(--sp-5);
    color: var(--vitano-terracotta);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.vitano-megamenu-all:hover { color: var(--vitano-terracotta-dk); }

.vitano-megamenu-photo {
    width: 300px;
    height: 400px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--vitano-cream-2);
}
.vitano-megamenu-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vitano-megamenu-callout {
    align-self: center;
    padding: var(--sp-6);
    background: var(--vitano-cream-2);
    border-radius: var(--radius-lg);
}
.vitano-megamenu-callout .v-eyebrow {
    display: block;
    margin-bottom: var(--sp-2);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--vitano-terracotta);
}
.vitano-megamenu-callout h3 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--vitano-charcoal);
    margin: 0 0 var(--sp-3) 0;
    line-height: var(--lh-tight);
}
.vitano-megamenu-callout p {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: var(--lh-body);
    color: var(--vitano-charcoal-2);
    margin: 0 0 var(--sp-4) 0;
}
.vitano-megamenu-cta {
    display: inline-block;
    padding: var(--sp-3) var(--sp-5);
    background: var(--vitano-coral);
    color: var(--vitano-white);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: background var(--dur-fast) var(--ease-soft), transform var(--dur-fast) var(--ease-soft);
}
.vitano-megamenu-cta:hover {
    background: var(--vitano-coral-dk);
    transform: translateY(-1px);
}

/* Kis képernyőn ne jelenjen meg a mega-menu (mobil hamburger menü helyettesít) */
@media (max-width: 1023px) {
    .vitano-megamenu { display: none !important; }
}

/* ============================================================
   Mobil menü
   ============================================================ */
.vitano-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(85vw, 360px);
    background: var(--vitano-cream);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease-soft);
    padding: var(--sp-5);
    overflow-y: auto;
}

.vitano-mobile-menu[data-open="true"] {
    transform: translateX(0);
}

.vitano-mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--vitano-charcoal);
    cursor: pointer;
    padding: var(--sp-2);
    margin-bottom: var(--sp-5);
    border-radius: var(--radius);
}
.vitano-mobile-menu-close:focus-visible { outline: 2px solid var(--vitano-terracotta); outline-offset: 2px; }

.vitano-mobile-menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.vitano-mobile-menu-nav li { margin: 0; }
.vitano-mobile-menu-nav a {
    display: block;
    padding: var(--sp-4) var(--sp-2);
    color: var(--vitano-charcoal);
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--vitano-line-2);
}
.vitano-mobile-menu-nav a:hover,
.vitano-mobile-menu-nav a:focus-visible {
    color: var(--vitano-terracotta);
    background: var(--vitano-line-2);
    outline: none;
}

.vitano-mobile-menu-divider {
    height: 1px;
    background: var(--vitano-line);
    margin: var(--sp-4) 0;
}

/* Overlay a mobil menü mögé */
.vitano-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 36, 32, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease-soft);
    z-index: 1050;
}
.vitano-overlay[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
 * VIT-TOOLS-2: Tools dropdown ("Tudj meg többet a testedről")
 * ============================================================ */
.vitano-nav-item--has-dropdown {
    position: relative;
}
.vitano-nav-item--has-dropdown > .vitano-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.vitano-tools-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 320px;
    background: var(--vitano-cream, #FAF6F1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(44, 36, 32, 0.12);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0s linear 0.18s;
    z-index: 200;
}
.vitano-nav-item--has-dropdown:hover > .vitano-tools-dropdown,
.vitano-nav-item--has-dropdown:focus-within > .vitano-tools-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
}
.vitano-tools-dropdown::before {
    /* hover bridge — prevents flicker between trigger and panel */
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}
.vitano-tools-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.vitano-tools-dropdown-list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--vitano-charcoal, #2C2420);
    text-decoration: none;
    transition: background 0.12s, transform 0.1s;
}
.vitano-tools-dropdown-list a:hover {
    background: #fff;
    transform: translateX(2px);
}
.vt-dd-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--vitano-terracotta, #C4622D);
}
.vt-dd-title {
    font-family: var(--font-display, 'Fraunces', serif);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--vitano-charcoal, #2C2420);
}
.vitano-tools-dropdown-all {
    display: block;
    margin-top: 6px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--vitano-coral, #F08060);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
}
.vitano-tools-dropdown-all:hover {
    background: var(--vitano-terracotta, #C4622D);
    color: #fff;
}

/* On mobile (≤768px) we hide the dropdown — the mobile menu shows the items inline */
@media (max-width: 768px) {
    .vitano-tools-dropdown { display: none !important; }
}

/* Mobile menu section header + "all" link */
.vitano-mobile-menu-section {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--vitano-terracotta, #C4622D);
    padding: 14px 18px 6px;
    pointer-events: none;
}
.vitano-mobile-menu-all {
    color: var(--vitano-terracotta, #C4622D) !important;
    font-weight: 600;
}
