/* ================================================================
   SPI Header — Inspiro-style coded navbar (replaces HFE header)
   - Front page: transparent over hero → solid navy on scroll (white text)
   - Inner pages: solid white header, black text
   - Dark flat dropdowns, full-screen search overlay, mobile overlay menu
   ================================================================ */

:root { --spi-header-h: 132px; }

/* Push content down on pages that DON'T use the transparent hero header. */
body:not(.spi-transparent-header) { padding-top: var(--spi-header-h); }

/* Neutralize Hello Elementor's reset.css pink <button> styling
   (its [type=button]{color:#c36} ties with .spi-header__icon on specificity,
   so set the color here at higher specificity). */
.spi-header button, .spi-header-overlay button, .spi-search-overlay button {
    border: none !important; background: none !important; border-radius: 0 !important;
    color: var(--spi-h-text); -webkit-appearance: none; appearance: none;
}

.spi-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9990;
    display: flex; align-items: center; height: var(--spi-header-h);
    --spi-h-text: #fff; --spi-h-hover: #f5c873;
    background: rgba(11,17,41,0.98);
    transition: background .3s ease, height .3s ease, box-shadow .3s ease;
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
}
/* front page — transparent over the hero until scrolled */
body.spi-transparent-header .spi-header:not(.is-scrolled) { background: transparent; }
.spi-header.is-scrolled { background: rgba(255,255,255,0.98); box-shadow: 0 2px 24px rgba(0,0,0,0.28); height: 72px; }

/* inner pages — white header, black text */
body:not(.spi-transparent-header) .spi-header {
    --spi-h-text: #0b1129; --spi-h-hover: #2670aa;
    background: #ffffff; box-shadow: 0 1px 0 rgba(11,17,41,0.08);
}
body:not(.spi-transparent-header) .spi-header.is-scrolled { box-shadow: 0 2px 20px rgba(11,17,41,0.12); }

body.admin-bar .spi-header { top: 32px; }

.spi-header__inner { width: 100%; max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 0 32px; }

/* ---- logo (white on the dark header, dark on the white header) ---- */
.spi-header__logo { flex: none; display: flex; align-items: center; }
.spi-header__logo img,
.spi-header__logo .custom-logo { height: auto; width: auto;max-width:159px; display: block; transition: filter .3s ease; }
body:not(.spi-transparent-header) .spi-header__logo img { filter:invert(1); }
body:not(.spi-transparent-header) .spi-header.is-scrolled .spi-header__icon svg{filter:invert(0);}
.spi-header__logo-text { color: var(--spi-h-text); font-weight: 700; font-size: 20px; text-decoration: none; }

/* ---- primary nav (16px / 500 / sentence-case, per reference) ---- */
.spi-header__nav { margin-left: auto; }
.spi-header__nav .spi-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 30px; }
.spi-header__nav .spi-menu > li { position: relative; }
.spi-header__nav .spi-menu > li > a {
    color: var(--spi-h-text); text-decoration: none; font-size: 16px; font-weight: 500;
    padding: 8px 0; display: inline-block; position: relative; transition: color .15s ease;
}
.spi-header.is-scrolled .spi-header__nav .spi-menu > li > a{color:#000;}
.spi-header.is-scrolled .spi-header__inner .spi-header__logo img{filter: invert(1);max-width: 100px;transition:ease-in-out all .2s;}
.spi-header.is-scrolled .spi-header__inner .spi-header__icon svg{filter:invert(1);}
.spi-header__nav .spi-menu > li > a:hover,
.spi-header__nav .spi-menu > li.current-menu-item > a,
.spi-header__nav .spi-menu > li.current-menu-ancestor > a { color: var(--spi-h-hover); }
/* active / hover underline */
.spi-header__nav .spi-menu > li > a::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
    background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.spi-header__nav .spi-menu > li > a:hover::before,
.spi-header__nav .spi-menu > li.current-menu-item > a::before { transform: scaleX(1); }
/* dropdown caret */
.spi-header__nav .menu-item-has-children > a::after {
    content: ""; display: inline-block; width: 6px; height: 6px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); margin-left: 8px; vertical-align: 3px; opacity: .75;
}

/* ---- dropdowns — flat dark, reference-style + fade/slide ---- */
.spi-header__nav .sub-menu {
    list-style: none; margin: 0; padding: 6px 0; position: absolute; top: calc(100% + 8px); left: 0;
    min-width: 200px; background: #101010; opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease; z-index: 10;
}
.spi-header__nav .menu-item-has-children:hover > .sub-menu,
.spi-header__nav .menu-item-has-children:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.spi-header__nav .sub-menu::before { content: ""; position: absolute; top: -6px; left: 22px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #101010; }
.spi-header__nav .sub-menu a { color: #b0b0b0; text-decoration: none; display: block; padding: 8px 15px; font-size: 16px; font-weight: 500; white-space: nowrap; transition: color .15s ease; }
.spi-header__nav .sub-menu a:hover { color: #fff; }

/* ---- right-side actions (search, cart, account) ---- */
.spi-header__actions { display: flex; align-items: center; gap: 18px; }
.spi-header__account { order: 3; }
.spi-header__account .spi-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 16px; }
.spi-header__account a{padding: 15px 28px 15px 28px;background-color: transparent;font-family: "Roboto", Sans-serif;transition:ease-in-out all .2s;
    font-size: 18px;font-weight: 500;color: #FFFFFF;background-image: linear-gradient(160deg, #146698 0%, #90E0FF 100%);
    border:none;border-radius:28px;display:inline-block}
.spi-header__account a:hover{filter: brightness(1.07);transform: translateY(-1px);background-color: transparent;transition:ease-in-out all .2s;
    color: #FFFFFF;background-image: linear-gradient(160deg, #146698 0%, #69B8D7 100%);border:none;}

.spi-header__icon { color: var(--spi-h-text); cursor: pointer; padding: 6px; display: inline-flex; align-items: center; justify-content: center; position: relative; text-decoration: none; transition: color .15s ease; }
.spi-header__icon:hover { color: var(--spi-h-hover); }
.spi-header__icon svg { width: 22px; height: 22px; }
.spi-header__search-toggle { order: 1; }
.spi-header__cart { order: 2; }
.spi-header__burger { order: 4; }

/* burger (mobile only) */
.spi-header__actions .spi-header__burger { display: none; flex-direction: column; gap: 5px; }
.spi-header__burger span { width: 24px; height: 2px; background: currentColor; display: block; border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.spi-header__burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.spi-header__burger.is-active span:nth-child(2) { opacity: 0; }
.spi-header__burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- full-screen search overlay (Inspiro-style) ---- */
/* Search panel: anchored under the search icon, not centred on the viewport */
.spi-header__search { position: relative; order: 1; display: inline-flex; align-items: center; }

.spi-search-overlay {
    position: absolute; inset: auto; top: calc(100% + 14px); right: 0; z-index: 10001;
    width: min(340px, calc(100vw - 32px));
    padding: 12px; border-radius: 12px;
    background: rgba(11,17,41,0.98);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 18px 44px rgba(0,0,0,0.34);
    opacity: 0; pointer-events: none; transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease;
}
.spi-search-overlay.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Little arrow pointing up at the icon. Hung off the wrapper, not the panel, so it
   self-centres on the icon regardless of the panel's width. */
.spi-header__search::after {
    content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 8px solid transparent; border-bottom-color: rgba(11,17,41,0.98);
    opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 10002;
}
.spi-header__search:has(.spi-search-overlay.is-open)::after { opacity: 1; }

.spi-search-overlay__form { width: 100%; max-width: none; text-align: left; }
.spi-search-overlay__input {
    width: 100%; background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.16) !important; border-radius: 8px !important;
    box-shadow: none !important;
    color: #fff; font-size: 15px; font-weight: 400; text-align: left; padding: 11px 14px;
    font-family: 'Roboto', sans-serif; outline: none; -webkit-appearance: none; appearance: none;
}
.spi-search-overlay__input:focus { border-color: rgba(255,255,255,0.45) !important; background: rgba(255,255,255,0.1) !important; }
.spi-search-overlay__input::placeholder { color: rgba(255,255,255,0.5); }

/* the big overlay close button has no place in a dropdown - toggle/Esc/outside-click close it.
   Needs the extra specificity + !important: the theme reset `[type="button"], button { display:inline-block }`
   ties on specificity and comes later in the cascade. */
.spi-header__search .spi-search-overlay__close { display: none !important; }

/* ---- mobile slide-in drawer (from the right; pushes the page left) ---- */
:root { --spi-drawer-w: min(82vw, 320px); }
html.spi-noscroll { overflow: hidden; }

/* drawer + backdrop are moved to <html> by JS so the body push-transform
   can't contain them; each animates with its own transform/opacity. */
.spi-drawer-backdrop { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
html.spi-drawer-open .spi-drawer-backdrop { opacity: 1; pointer-events: auto; }

.spi-header-overlay {
    position: fixed; top: 0; right: 0; width: var(--spi-drawer-w); height: 100%;
    z-index: 10001; background: #101010; overflow-y: auto; padding: 14px 0 40px;
    transform: translateX(100%); transition: transform .3s ease;
    -webkit-overflow-scrolling: touch; display: flex; flex-direction: column;
}
html.spi-drawer-open .spi-header-overlay { transform: translateX(0); }
.spi-header-overlay__close { align-self: flex-end; margin: 0 12px 6px; color: #fff !important; font-size: 32px; line-height: 1; cursor: pointer; padding: 4px 10px; }
.spi-header-overlay__close:hover { color: #f5c873 !important; }

.spi-header-overlay .spi-menu { list-style: none; margin: 0; padding: 0; display: block; }
.spi-header-overlay .spi-menu > li { border-bottom: 1px solid rgba(255,255,255,0.08); }
.spi-header-overlay .spi-menu a { color: #e8e8ea; text-decoration: none; font-size: 16px; font-weight: 500; padding: 14px 22px; display: block; text-align: left; }
.spi-header-overlay .spi-menu a:hover { color: #f5c873; }
/* accordion parent toggle (chevron) */
.spi-header-overlay .menu-item-has-children > a { position: relative; padding-right: 46px; }
.spi-header-overlay .menu-item-has-children > a::after {
    content: ""; position: absolute; right: 24px; top: 50%; width: 8px; height: 8px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; opacity: .85;
}
.spi-header-overlay .menu-item-has-children.is-expanded > a::after { transform: translateY(-30%) rotate(225deg); }
.spi-header-overlay .sub-menu { list-style: none; margin: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height .28s ease; background: rgba(255,255,255,0.03); }
.spi-header-overlay .menu-item-has-children.is-expanded > .sub-menu { max-height: 640px; }
.spi-header-overlay .sub-menu a { font-size: 14.5px; font-weight: 400; padding: 11px 22px 11px 36px; color: #b0b0b0; border-bottom: none; }
.spi-header-overlay__account { margin-top: 8px; }
.spi-header-overlay__account .spi-menu > li { border-bottom: 1px solid rgba(255,255,255,0.08); }

/* ---- responsive: mobile & tablet (<=1024) ---- */
@media (max-width: 1024px) {
    /* Header is sticky on mobile/tablet too: fixed, white, black content.
       body keeps padding-top equal to the header height so the first section
       is not hidden underneath it. */
    body { padding-top: var(--spi-header-h) !important; transition: transform .3s ease; }
    .spi-header,
    .spi-header.is-scrolled,
    body.spi-transparent-header .spi-header,
    body.spi-transparent-header .spi-header:not(.is-scrolled) {
        position: fixed !important; top: 0; left: 0; right: 0; height: var(--spi-header-h);
        background: #ffffff !important; box-shadow: 0 1px 0 rgba(11,17,41,0.08) !important;
        --spi-h-text: #0b1129; --spi-h-hover: #2670aa;
    }
    /* dark (visible) logo on the white bar */
    .spi-header__logo img, body:not(.spi-transparent-header) .spi-header__logo img { filter: brightness(0) !important; }

    /* hide desktop nav/account; show hamburger; push icons to the right */
    .spi-header__nav, .spi-header__account { display: none; }
    .spi-header__actions { margin-left: auto; }
    .spi-header__actions .spi-header__burger { display: inline-flex; }

    /* slide-in drawer pushes the whole page (body) to the left */
    html.spi-drawer-open body { transform: translateX(calc(-1 * var(--spi-drawer-w))); }
}
@media (max-width: 767px) {
    /* icon sits ~250px in on a 390px screen, so a 340px right-aligned panel would overflow */
    .spi-search-overlay { position: fixed; top: calc(var(--spi-header-h) + 8px); left: 12px; right: 12px; width: auto; }
    .spi-header__search::after { display: none; }
    :root { --spi-header-h: 68px; }
    .spi-header__inner { padding: 0 18px; gap: 12px; }
    .spi-header__actions { gap: 12px; }
    .spi-header__logo img, .spi-header__logo .custom-logo { height: 32px; }
}
@media (max-width: 782px) { body.admin-bar .spi-header { top: 46px; } }
