/* ==========================================================================
   Lys Roast – KÖZÖS FEJLÉC (minden oldalon ugyanez): logó · bal oldali menü · nyelvválasztó · oldalspecifikus gombok
   Betöltés: az oldal saját stíluslapja UTÁN. A régi, oldalankénti fejléc-szabályok a két style.css-ből kikerültek.
   Töréspont: 1279 px alatt hamburger + oldalpanel (minden oldalon ugyanott).
   ========================================================================== */

/* ---------- Fejléc ---------- */
.site-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    box-sizing: border-box;
    min-height: 64px;
    padding: 0.6rem 2rem;
    background-color: var(--secondary-color, #fff);
    border-bottom: 1px solid var(--border-color, #ddd);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    /* FIGYELEM: alapállapotban nem lehet itt transform/will-change (a görgetés-elrejtés csak a .header-hidden-ben használ) */
}
.site-header.header-hidden { transform: translate3d(0, -100%, 0); }
.site-header.header-hidden:not(:focus-within) { pointer-events: none; }
.site-header .logo { flex: 0 0 auto; margin: 0; }
.site-header .logo a { display: block; line-height: 0; text-decoration: none; outline-offset: 4px; }
/* Logó: minden oldalon (a shopban is) ugyanaz a kép és ugyanakkora méret: 1rem magas, ≤ 768 px-en 10 px */
.site-header .top-logo-svg { height: 1rem; width: auto; display: block; margin: 0; }
@media (max-width: 768px) { .site-header .top-logo-svg { height: 10px; } }

/* Oldalspecifikus vezérlők (nyelv, deviza, kosár / kapcsolat) */
.header-tools { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; margin-left: auto; }
.nm-wrapper + .header-tools { margin-left: 0; }

/* ---------- Nyelvválasztó: HU | EN | DE – a vonalak két oldalán egyforma a távolság ---------- */
.language-selector { display: flex; align-items: center; flex-shrink: 0; }
.language-selector button {
    position: relative;
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.9rem;              /* szimmetrikus: a felirat a vonaltól balra és jobbra ugyanolyan távol van */
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;               /* minden gomb azonos vastagságú, hogy az aktív állapot ne tolja el a vonalakat */
    color: var(--text-color, #333);
    cursor: pointer;
    white-space: nowrap;
}
.language-selector button + button::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 1.1em;
    background: var(--border-color, #bbb);
    transform: translateY(-50%);
}
.language-selector button.active,
.language-selector button[aria-pressed="true"] {
    color: var(--primary-color, #000);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}
.language-selector button:disabled { opacity: 0.4; cursor: not-allowed; }
@media (hover: hover) { .language-selector button:hover:not(:disabled) { color: var(--primary-color, #000); text-decoration: underline; text-underline-offset: 6px; } }
.language-selector button:focus-visible { outline: 3px solid var(--accent, #704213); outline-offset: -3px; }

/* ---------- Shop: deviza (visszafogott) + kosár (hangsúlyos) ---------- */
.currency-selector { display: flex; align-items: center; flex-shrink: 0; border: 1px solid #ccc; overflow: hidden; }
.currency-selector button {
    min-width: 40px; min-height: 32px; padding: 0 0.6rem; /* ≥ 24 px (WCAG 2.2 AA, 2.5.8): a pénznem másodlagos vezérlő, a kosár a fő gomb */
    background: none; border: 0; border-left: 1px solid #ccc;
    font: inherit; font-size: 0.75rem; font-weight: 400; color: #555; cursor: pointer; white-space: nowrap;
}
.currency-selector button:first-child { border-left: 0; }
.currency-selector button.active { background: #ececec; color: var(--primary-color, #000); font-weight: 700; }
.currency-selector button:focus-visible { outline: 3px solid var(--accent, #704213); outline-offset: -3px; }

/* Kosár gomb: visszafogott – vékony fekete körvonal, árnyék és kitöltés nélkül */
.site-header .shop-checkout-btn {
    min-height: 40px; padding: 0.25rem 0.9rem; margin: 0; gap: 0.5rem;
    font-size: 0.9rem; background: transparent;
    border: 1px solid var(--primary-color, #000);
    box-shadow: none;
    transition: background-color 0.15s;
}
.site-header .shop-checkout-btn .cart-icon { width: 18px; height: 18px; margin: 0; }
.site-header .shop-checkout-btn:active:not(:disabled) { background: rgba(0, 0, 0, 0.1); color: var(--primary-color, #000); }
@media (hover: hover) {
    .site-header .shop-checkout-btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.06); color: var(--primary-color, #000); }
}

/* ---------- Kapcsolat gomb (nem shop oldalak) ---------- */
.header-cta { white-space: nowrap; }

/* ---------- Közös menü: ASZTALI (≥ 1280 px): a logó mellett, balra ---------- */
.nm-wrapper { display: flex; align-items: center; margin: 0 auto 0 2rem; min-width: 0; }
.nm-hamburger { display: none; }
.nm-nav { display: block; }
.nm-nav > nav { display: block; }
.nm-list { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nm-list a {
    display: inline-block; padding: 0.4rem 0; color: #000; font-size: 0.92rem; font-weight: 400;
    text-decoration: none; white-space: nowrap; transition: color 0.2s;
}
@media (hover: hover) { .nm-list a:hover { color: var(--accent, #704213); text-decoration: underline; text-underline-offset: 5px; } }
.nm-list a:active { color: var(--accent, #704213); text-decoration: underline; }
.nm-list a:focus-visible, .nm-hamburger:focus-visible { outline: 3px solid var(--accent, #704213); outline-offset: 2px; }
.nm-hamburger { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ---------- MOBIL / TABLET (≤ 1279 px): egy sor, hamburger balra, oldalpanel ---------- */
@media (max-width: 1279px) {
    .site-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "menu logo tools";
        align-items: center;
        column-gap: 0.4rem;
        row-gap: 0.2rem;
        padding: 0.4rem 1rem;
    }
    .nm-wrapper { grid-area: menu; margin: 0; }
    .site-header .logo { grid-area: logo; min-width: 0; margin: 0; }
    .header-tools { display: contents; }
    .language-selector { grid-area: tools; justify-self: end; }
    .header-cta { display: none; }

    /* Shop: 1. sor = menü · logó (a teljes szabad szélesség) · pénznem, 2. sor = nyelv · KOSÁR.
       A kosár (és a hosszú HUF összeg) a 2. sorban van, ezért a logót nem nyomja össze 320–360 px-en sem.
       Az elemek a rácsvonalak szerint állnak (a több oszlopon átnyúló elemek nem méretezik az "auto" oszlopokat). */
    .site-header--shop {
        grid-template-areas: none;
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding-bottom: 0.5rem;
    }
    .site-header--shop .nm-wrapper { grid-area: auto; grid-column: 1; grid-row: 1; }
    .site-header--shop .logo { grid-area: auto; grid-column: 2; grid-row: 1; }
    .site-header--shop .currency-selector { grid-area: auto; grid-column: 3; grid-row: 1; justify-self: end; }
    .site-header--shop .language-selector { grid-area: auto; grid-column: 1 / 3; grid-row: 2; justify-self: start; margin-left: -0.9rem; }
    .site-header--shop .shop-checkout-btn { grid-area: auto; grid-column: 2 / 4; grid-row: 2; justify-self: end; max-width: 100%; }

    .nm-hamburger {
        display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box;
        width: 44px; height: 44px; padding: 13px 9.5px; margin: 0 0.2rem 0 -0.55rem;
        background: none; border: 0; cursor: pointer;
    }
    .nm-bar { display: block; width: 100%; height: 2px; background: #000; transition: transform 0.2s, opacity 0.2s; }
    .nm-hamburger.active .nm-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nm-hamburger.active .nm-bar:nth-child(2) { opacity: 0; }
    .nm-hamburger.active .nm-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* A menü a <body>-ban él (nav.js). Nyitva: NEM átlátszó háttér (az oldal nem látszik, nem görgethető), a fejléc a menü FÖLÖTT marad,
       így a hamburger zárógombként (X) látszik. A menü egy tömör, középre igazított kártya – nincs nagy üres fehér felület.
       A háttér színe a --nm-scrim változóval állítható (pl. #fff). */
    .nm-nav {
        position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 900;
        display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
        box-sizing: border-box; padding: calc(var(--nm-top, 64px) + 1rem) 1.25rem 1.5rem;
        background: var(--nm-scrim, #1f1f1f);
        visibility: hidden; opacity: 0;
        transition: opacity 0.2s ease, visibility 0s linear 0.2s;
        overflow: hidden; overscroll-behavior: contain; touch-action: none;
    }
    .nm-nav.active { visibility: visible; opacity: 1; transition: opacity 0.2s ease, visibility 0s; }
    .nm-nav > nav {
        box-sizing: border-box; width: min(100%, 420px); max-height: 100%;
        padding: 0.4rem 1.25rem; background: #fff; border-radius: 16px; text-align: center;
        overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
    }
    .nm-list { flex-direction: column; align-items: stretch; gap: 0; }
    .nm-list a { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0.4rem 0; font-size: 1.15rem; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
    .nm-list li:last-child a { border-bottom: 0; }
}
@media (max-width: 380px) {
    .site-header { padding: 0.4rem 0.7rem; }
    .language-selector button { padding: 0 0.7rem; }
    .currency-selector button { padding: 0 0.45rem; }
    .site-header .shop-checkout-btn { padding: 0.25rem 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .site-header, .nm-nav, .nm-nav > nav, .nm-bar { transition: none; }
}
html.nm-lock { overflow: hidden; overscroll-behavior: none; }
html.nm-lock .site-header { touch-action: none; } /* a fejlécre húzva sem görgethető az oldal; a koppintás működik */
.site-header .top-logo-svg { margin-right: 0; }

/* ==========================================================================
   KÖZÖS LÁBLÉC – minden oldalon ugyanaz (a tartalmat a lib/footer.js adja, lásd tools/sync-footer.mjs).
   Alapból egy sorban; ha keskeny a kijelző, a linkek sorokba törnek és középre rendeződnek (egy link sem törik szét).
   ========================================================================== */
.site-footer { padding: 2rem 1.5rem 2.25rem; border-top: 1px solid var(--border-color, #000); text-align: center; background-color: #fafafa; }
.site-footer .legal-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 1.1rem; margin: 0 auto; }
.site-footer .legal-links a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.2rem;
    color: #666; text-decoration: none; font-size: 0.95rem; font-weight: inherit; white-space: nowrap; transition: color 0.2s;
}
@media (hover: hover) { .site-footer .legal-links a:hover { color: var(--primary-color, #000); text-decoration: underline; text-underline-offset: 4px; } }
.site-footer .legal-links a:focus-visible { outline: 3px solid var(--accent, #704213); outline-offset: 2px; }
.site-footer .copyright { margin: 0.25rem 0 0; font-size: 0.85rem; color: #595959; }
@media (max-width: 480px) {
    .site-footer { padding: 1.25rem 0.75rem 1.5rem; }
    .site-footer .legal-links { gap: 0 0.85rem; }
    .site-footer .legal-links a { font-size: 0.9rem; }
}
