/* ==========================================================================
   Symara header — V4 "ink bar + destination search" (2026-08-22)
   Markup lives in includes/header.php, behaviour in assets/js/nav.js.
   All classes are prefixed `sy-` so the generic names in base/landing.css
   (.logo, .btn, .hero, nav …) never leak in.

   Heights:  desktop 80px  ·  mobile 56px bar + 56px search row = 112px
             pages with body.nav-no-search: mobile 56px (no search row)
   --nav-h is set here on :root and is the ONLY source of truth; page CSS
   pads its <main> with var(--nav-h).
   ========================================================================== */

:root {
    --nav-h: 80px;
    --ink: #0f172a;
    --ring: 0 0 0 3px #fff, 0 0 0 5px var(--primary);
}

html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body.sy-menu-open { overflow: hidden; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sy-skip { left: 16px; top: 16px; z-index: 200; background: #fff; color: var(--dark); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.sy-skip:focus { width: auto; height: auto; clip: auto; box-shadow: var(--ring); }

/* ---------- bar ---------- */
.sy-hdr {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--ink);
    box-shadow: inset 0 -1px 0 transparent; /* hairline drawn inside so the bar stays exactly var(--nav-h) */
    transition: background .15s ease, box-shadow .15s ease;
    color: #fff;
}
.sy-hdr *, .sy-hdr *::before, .sy-hdr *::after { box-sizing: border-box; }
.sy-hdr a { text-decoration: none; color: inherit; }
.sy-hdr button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sy-hdr :focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #a5b4fc; border-radius: 8px; }

.sy-hdr-in {
    max-width: 1200px; margin: 0 auto; height: var(--nav-h);
    padding: 0 24px; display: flex; align-items: center; gap: 20px;
}

.sy-logo { display: inline-flex; align-items: center; flex: none; height: 44px; border-radius: 8px; color: #fff; }
.sy-logo svg { display: block; }

/* ---------- search pill (desktop: centered in the bar; mobile: white row) ---------- */
.sy-hdr form.sy-search {
    position: relative; flex: 1; max-width: 420px; margin: 0 auto;
    display: flex; align-items: center; gap: 10px;
    height: 48px; padding: 0 6px 0 14px;
    border: 1px solid transparent; border-radius: 14px; background: #fff;
    box-shadow: none; transition: border-color .2s, box-shadow .2s;
}
.sy-hdr form.sy-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(99 102 241 / .18); }
.sy-hdr form.sy-search > svg { width: 20px; height: 20px; color: var(--gray); flex: none; }
.sy-hdr form.sy-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px;
    height: 44px; background: transparent; color: var(--dark); padding: 0;
}
.sy-hdr form.sy-search input::placeholder { color: #94a3b8; }
.sy-hdr form.sy-search input:focus-visible { box-shadow: none; }
.sy-hdr form.sy-search button[type=submit] {
    position: relative; flex: none; height: 36px; padding: 0 14px; border-radius: 10px;
    background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
}
.sy-hdr form.sy-search button[type=submit]::after { content: ""; position: absolute; inset: -6px -6px -6px -4px; } /* 44px+ hit area */
.sy-hdr form.sy-search button[type=submit]:hover { background: var(--primary-dark); }
.sy-hdr form.sy-search button[type=submit]:focus-visible { box-shadow: var(--ring); }

/* autocomplete list (created by home-search.js) */
.sy-hdr .hp-search-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px;
    list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .08);
    z-index: 120; max-height: 320px; overflow-y: auto; text-align: left;
}
.sy-hdr .hp-search-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; min-height: 44px; color: var(--dark); }
.sy-hdr .hp-search-list li:hover, .sy-hdr .hp-search-list li.is-active { background: #eef2ff; }
.sy-hdr .hp-search-chip { flex: none; width: 36px; height: 28px; border-radius: 8px; background: var(--light-gray); color: var(--primary-dark); font-size: 12px; font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; justify-content: center; }
.sy-hdr .hp-search-label { font-weight: 600; font-size: 15px; color: var(--dark); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-hdr .hp-search-list small { font-size: 12px; color: var(--gray); flex: none; }

/* ---------- links ---------- */
.sy-links { display: flex; gap: 2px; align-items: center; }
.sy-links > a, .sy-links .sy-dd-trigger {
    display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: #94a3b8; white-space: nowrap; transition: color .15s, background .15s;
}
.sy-links > a:hover, .sy-links .sy-dd-trigger:hover, .sy-dd.is-open .sy-dd-trigger { color: #fff; background: rgb(255 255 255 / .08); }
.sy-links .sy-dd-trigger svg { width: 14px; height: 14px; transition: transform .2s; }
.sy-dd.is-open .sy-dd-trigger svg { transform: rotate(180deg); }

/* generic dropdown (admin menu + avatar menu) */
.sy-dd { position: relative; }
.sy-dd-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; max-height: calc(100vh - var(--nav-h) - 24px); overflow-y: auto;
    padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .08);
    display: none; z-index: 130; color: var(--dark);
}
.sy-dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 9px; } /* hover bridge */
.sy-dd.is-open .sy-dd-menu { display: block; }
.sy-dd-menu a { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 8px; font-size: 14px; color: var(--dark); white-space: nowrap; }
.sy-dd-menu a:hover { background: var(--light-gray); }
.sy-dd-menu a.is-danger { color: #b91c1c; }
.sy-dd-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.sy-dd-menu :focus-visible { box-shadow: var(--ring); }
.sy-dd-admin .sy-dd-menu { left: 0; right: auto; }

/* ---------- right cluster ---------- */
.sy-right { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }

.sy-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; font-weight: 600; font-size: 15px; white-space: nowrap; transition: background .2s, color .2s; }
.sy-btn-primary { background: var(--primary); color: #fff; }
.sy-btn-primary:hover { background: var(--primary-dark); }
.sy-btn-ghost { color: #fff; }
.sy-btn-ghost:hover { background: rgb(255 255 255 / .1); }
.sy-btn-outline { border: 1px solid #334155; background: transparent; color: #fff; }
.sy-btn-outline:hover { border-color: #64748b; }

.sy-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); }
.sy-lang a { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 30px; min-width: 40px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #94a3b8; transition: color .15s, background .15s; }
.sy-lang a::after { content: ""; position: absolute; inset: -7px -2px; } /* 44px hit area */
.sy-lang a:hover { color: #fff; }
.sy-lang a.is-active { background: #fff; color: var(--dark); box-shadow: var(--shadow); }

.sy-credit { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .14); background: rgb(255 255 255 / .08); font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sy-credit svg { width: 16px; height: 16px; color: #a5b4fc; flex: none; }
.sy-credit i { font-style: normal; color: #64748b; }

.sy-avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; }
.sy-avatar svg { width: 22px; height: 22px; }
.sy-avatar:hover, .sy-dd.is-open .sy-avatar { background: rgb(255 255 255 / .1); }

/* coupon badge (filled by the coupon script in header.php) */
.coupon-badge-desktop, .coupon-badge-mobile { position: relative; display: none; align-items: center; height: 32px; padding: 0 10px; border-radius: 999px; background: #f0fdf4; color: #15803d; border: 1px solid #86efac; font-size: 12px; font-weight: 700; letter-spacing: .04em; cursor: default; white-space: nowrap; }
.coupon-badge-tooltip { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 10px 12px; background: var(--dark); color: #fff; font-size: 13px; font-weight: 500; letter-spacing: 0; border-radius: 10px; box-shadow: var(--shadow-lg); display: none; z-index: 130; white-space: normal; }
.coupon-badge-desktop:hover .coupon-badge-tooltip, .coupon-badge-desktop:focus-visible .coupon-badge-tooltip, .coupon-badge-mobile.active .coupon-badge-tooltip { display: block; }
.coupon-badge-tooltip strong { color: #86efac; }
.coupon-badge-mobile { display: none; }

/* ---------- burger ---------- */
.sy-burger { display: none; width: 44px; height: 44px; border-radius: 10px; align-items: center; justify-content: center; color: #fff; flex: none; }
.sy-burger:hover { background: rgb(255 255 255 / .1); }
.sy-burger-box { position: relative; display: block; width: 22px; height: 16px; }
.sy-burger-line, .sy-burger-line::before, .sy-burger-line::after { position: absolute; left: 0; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s, top .25s, background .2s; }
.sy-burger-line { top: 7px; }
.sy-burger-line::before { content: ""; top: -7px; }
.sy-burger-line::after { content: ""; top: 7px; }
.sy-burger[aria-expanded="true"] .sy-burger-line { background: transparent; }
.sy-burger[aria-expanded="true"] .sy-burger-line::before { top: 0; transform: rotate(45deg); }
.sy-burger[aria-expanded="true"] .sy-burger-line::after { top: 0; transform: rotate(-45deg); }

/* ---------- mobile search row + bottom sheet ---------- */
.sy-row2 { display: none; }
.sy-overlay { position: fixed; inset: 0; background: rgb(15 23 42 / .45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90; }
.sy-menu-open .sy-overlay { opacity: 1; pointer-events: auto; }
.sy-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    background: var(--ink); color: #fff; border-radius: 24px 24px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgb(0 0 0 / .4);
    transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    max-height: 85vh; max-height: 85dvh; display: flex; flex-direction: column; overflow-y: auto;
    visibility: hidden;
}
.sy-menu-open .sy-sheet { transform: none; visibility: visible; }
.sy-sheet *, .sy-sheet *::before, .sy-sheet *::after { box-sizing: border-box; }
.sy-sheet a { text-decoration: none; color: inherit; }
.sy-sheet :focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px #a5b4fc; border-radius: 10px; }
.sy-grab { width: 40px; height: 4px; border-radius: 2px; background: #334155; margin: 4px auto 12px; flex: none; }
.sy-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sy-tiles a { display: flex; align-items: center; justify-content: center; height: 56px; border-radius: 14px; background: #1e293b; font-size: 16px; font-weight: 600; color: #fff; text-align: center; padding: 0 8px; }
.sy-tiles a:hover { background: #273449; }
.sy-tiles a.is-wide { grid-column: 1 / -1; }
.sy-sheet-foot { margin-top: 14px; display: grid; gap: 10px; }
.sy-sheet-foot .sy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sy-sheet-foot .sy-btn { width: 100%; height: 48px; }
.sy-sheet .sy-lang { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .14); }
.sy-sheet .sy-lang a { color: #94a3b8; }
.sy-sheet .sy-lang a.is-active { background: #fff; color: var(--dark); }
.sy-sheet .sy-credit { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .14); color: #fff; }
.sy-sheet .sy-credit svg { color: #a5b4fc; }
.sy-sheet .coupon-badge-tooltip { right: auto; left: 0; }

/* ---------- scrolled → light ---------- */
.sy-hdr.is-light { background: #fff; box-shadow: inset 0 -1px 0 var(--border); color: var(--dark); }
.sy-hdr.is-light .sy-logo, .sy-hdr.is-light .sy-burger, .sy-hdr.is-light .sy-btn-ghost, .sy-hdr.is-light .sy-avatar { color: var(--dark); }
.sy-hdr.is-light .sy-burger:hover, .sy-hdr.is-light .sy-btn-ghost:hover, .sy-hdr.is-light .sy-avatar:hover, .sy-hdr.is-light .sy-dd.is-open .sy-avatar { background: var(--light-gray); }
.sy-hdr.is-light .sy-links > a, .sy-hdr.is-light .sy-links .sy-dd-trigger { color: var(--gray); }
.sy-hdr.is-light .sy-links > a:hover, .sy-hdr.is-light .sy-links .sy-dd-trigger:hover, .sy-hdr.is-light .sy-dd.is-open .sy-dd-trigger { color: var(--dark); background: var(--light-gray); }
.sy-hdr.is-light .sy-lang { background: var(--light-gray); border-color: var(--border); }
.sy-hdr.is-light .sy-lang a { color: var(--gray); }
.sy-hdr.is-light .sy-lang a:hover { color: var(--dark); }
.sy-hdr.is-light .sy-lang a.is-active { color: var(--dark); }
.sy-hdr.is-light .sy-credit { background: #fff; border-color: var(--border); color: var(--dark); }
.sy-hdr.is-light .sy-credit svg { color: var(--primary); }
.sy-hdr.is-light .sy-credit i { color: #cbd5e1; }
.sy-hdr.is-light form.sy-search { border-color: var(--border); }
.sy-hdr.is-light :focus-visible { box-shadow: var(--ring); }

/* ---------- responsive ---------- */
@media (max-width: 899px) {
    :root { --nav-h: 112px; }
    :root:has(body.nav-no-search), body.nav-no-search { --nav-h: 56px; }
    .sy-hdr-in { height: 56px; padding: 0 16px; gap: 12px; }
    .sy-hdr-in form.sy-search, .sy-links, .sy-right .sy-lang, .sy-right .sy-btn, .sy-right .sy-credit, .sy-right .sy-dd, .sy-right .coupon-badge-desktop { display: none !important; }
    .sy-burger { display: inline-flex; }
    .sy-logo svg { width: 101px; height: 33px; }
    .sy-row2 { display: flex; align-items: center; height: 56px; padding: 6px 16px; background: #fff; box-shadow: inset 0 -1px 0 var(--border); }
    .sy-row2 form.sy-search { max-width: none; width: 100%; height: 44px; margin: 0; border-color: var(--border); }
    .sy-row2 form.sy-search input { height: 40px; }
    .sy-row2 form.sy-search button[type=submit] { height: 34px; }
    body.nav-no-search .sy-row2 { display: none; }
    .sy-hdr.is-light .sy-row2 { box-shadow: inset 0 1px 0 var(--border), inset 0 -1px 0 var(--border); }
}
@media (min-width: 900px) {
    .sy-sheet, .sy-overlay { display: none; }
    .sy-logo svg { width: 110px; height: 36px; }
    body.nav-no-search .sy-hdr-in form.sy-search { visibility: hidden; pointer-events: none; }
}
@media (max-width: 380px) { .sy-tiles a { font-size: 15px; } }

@media (prefers-reduced-motion: reduce) {
    .sy-hdr, .sy-sheet, .sy-overlay, .sy-burger-line, .sy-burger-line::before, .sy-burger-line::after, .sy-links .sy-dd-trigger svg { transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}

/* dev-mode banner (admins, config/settings.php isDevMode) pushes the bar down */
body:has(#dev-mode-banner) .sy-hdr { top: var(--dev-banner-h, 46px); }
body:has(#dev-mode-banner) main, body:has(#dev-mode-banner) .hero, body:has(#dev-mode-banner) .container { margin-top: var(--dev-banner-h, 46px); }
