/* ==========================================================================
   Lotus Custom Header — custom-header.css
   Compatible: Blocksy Free + Elementor Free
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset / scope
   -------------------------------------------------------------------------- */
.lotus-header *,
.lotus-header *::before,
.lotus-header *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.lh-container {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

.lh-container--boxed {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.lh-container--full-width {
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   Outer header wrapper
   ─────────────────────────────────────────────────────────────────────────
   WHY position:fixed instead of position:sticky:
   Blocksy's DOM is:
     <div id="main-container">
       <header class="lotus-header">   ← our header lives here
       <main>…</main>
       <footer class="ct-footer">      ← Blocksy footer (empty/hidden)
     </div>
     <footer class="lcf-footer">       ← custom footer is OUTSIDE main-container

   position:sticky only sticks within its nearest scrolling ancestor's
   height — i.e., within #main-container. Once the user scrolls past
   #main-container into the external footer, sticky stops working.

   position:fixed is viewport-relative and always visible regardless of
   where in the DOM the element lives. JS injects a spacer <div> with
   the same height as the header so content isn't hidden underneath.
   -------------------------------------------------------------------------- */
.lotus-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
    font-family: inherit;
    will-change: transform;
}

/* Spacer injected by JS — same height as the header, keeps content from
   hiding under the fixed bar. JS sets this height in px after measuring. */
#lotus-header-spacer {
    display: block;
    width: 100%;
    /* height set dynamically by JS */
}

/* --------------------------------------------------------------------------
   TOP BAR  — phone left · social right
   Always visible — both normal and scrolled state (sticky via .lotus-header)
   -------------------------------------------------------------------------- */
.lh-topbar {
    background-color: var(--lh-topbar-bg, #2AA1AF);
    color: var(--lh-topbar-text, #ffffff);
    padding: 7px 0;
    font-size: 13px;
    line-height: 1.4;
}

.lh-topbar .lh-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Left: phone */
.lh-topbar__left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.lh-topbar__phone {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--lh-topbar-text, #ffffff);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity 0.2s;
}

.lh-topbar__phone:hover {
    opacity: 0.82;
    outline: 2px dashed rgba(255,255,255,0.6);
    outline-offset: 3px;
    border-radius: 3px;
}

.lh-topbar__phone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    flex-shrink: 0;
}

.lh-topbar__label {
    opacity: 0.88;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lh-topbar__num {
    font-weight: 700;
    font-size: 13.5px;
}

.lh-topbar__divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.lh-topbar__tagline {
    font-size: 12px;
    opacity: 0.85;
    font-style: italic;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Right: social icons */
.lh-topbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lh-topbar__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--lh-topbar-text, #ffffff);
    text-decoration: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    transition: background-color 0.2s, transform 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.lh-topbar__social:hover,
.lh-topbar__social:focus-visible {
    background-color: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.55);
    transform: translateY(-2px);
    outline: none;
}

/* --------------------------------------------------------------------------
   MAIN HEADER BAR
   No size transitions — prevents layout shift on scroll.
   .is-scrolled only deepens the shadow (visual cue, no layout change).
   -------------------------------------------------------------------------- */
.lh-main {
    background-color: var(--lh-bg, #ffffff);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease;
}

.lotus-header.is-scrolled .lh-main {
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    background-color: var(--lh-sticky-bg, #ffffff);
}

.lh-main .lh-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 76px;
    gap: 24px;
}

/* --------------------------------------------------------------------------
   BRANDING / LOGO
   Fixed size — no transitions, no scroll-state changes.
   -------------------------------------------------------------------------- */
.lh-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.lh-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.lh-logo-img {
    display: block;
    height: var(--lh-logo-h, 80px);
    width: auto;
    object-fit: contain;
}

.lh-text-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--lh-menu-text, #333);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.lh-site-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--lh-menu-text, #333);
    text-decoration: none;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   DESKTOP NAV
   -------------------------------------------------------------------------- */
.lh-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.lh-nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
}

.lh-nav-list > li {
    position: relative;
}

.lh-nav-list > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    color: var(--lh-menu-text, #333);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-radius: 4px;
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Animated underline */
.lh-nav-list > li > a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 14px;
    right: 14px;
    height: 2px;
    background-color: var(--lh-menu-hover, #2AA1AF);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
}

.lh-nav-list > li > a:hover,
.lh-nav-list > li > a:focus-visible,
.lh-nav-list > li.current-menu-item > a,
.lh-nav-list > li.current-menu-ancestor > a {
    color: var(--lh-menu-hover, #2AA1AF);
    background-color: rgba(42,161,175,0.06);
}

.lh-nav-list > li > a:hover::after,
.lh-nav-list > li > a:focus-visible::after,
.lh-nav-list > li.current-menu-item > a::after,
.lh-nav-list > li.current-menu-ancestor > a::after {
    transform: scaleX(1);
}

/* Dropdown caret */
.lh-caret {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.lh-nav-list > li.menu-item-has-children:hover > a .lh-caret,
.lh-nav-list > li.menu-item-has-children:focus-within > a .lh-caret {
    transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   DROPDOWN
   -------------------------------------------------------------------------- */
.lh-dropdown {
    list-style: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 210px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.09);
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 100;
    padding: 6px 0;
}

/* Nested dropdown */
.lh-dropdown .lh-dropdown {
    top: -6px;
    left: 100%;
}

.lh-nav-list > li:hover > .lh-dropdown,
.lh-nav-list > li:focus-within > .lh-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lh-dropdown li a {
    display: block;
    padding: 9px 18px;
    color: #444444;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.18s, color 0.18s;
}

.lh-dropdown li a:hover,
.lh-dropdown li a:focus-visible {
    background-color: rgba(42,161,175,0.07);
    color: var(--lh-menu-hover, #2AA1AF);
}

.lh-dropdown li + li {
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* --------------------------------------------------------------------------
   CONTACT BUTTON
   -------------------------------------------------------------------------- */
.lh-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    background-color: var(--lh-btn-bg, #2AA1AF);
    color: var(--lh-btn-text, #ffffff) !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(42,161,175,0.3);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.lh-contact-btn:hover,
.lh-contact-btn:focus-visible {
    background-color: #228a96;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(42,161,175,0.45);
    outline: none;
}

/* --------------------------------------------------------------------------
   HAMBURGER BUTTON (mobile only — hidden on desktop)
   -------------------------------------------------------------------------- */
.lh-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.lh-hamburger:hover {
    background-color: rgba(0,0,0,0.05);
}

.lh-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--lh-menu-text, #333);
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger → X animation */
.lh-hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.lh-hamburger.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.lh-hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   MOBILE OFF-CANVAS PANEL
   ─────────────────────────────────────────────────────────────────────────
   position:fixed + inset:0 covers the full viewport regardless of scroll.

   Scroll lock: overflow:hidden on <html> only.
   Do NOT use body { position:fixed } — that snaps the page to top:0,
   causing a visible jump. overflow:hidden on <html> freezes scroll at the
   current position with zero layout shift.
   -------------------------------------------------------------------------- */
.lh-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100dvh; /* dynamic viewport height — shrinks with mobile address bar */
    z-index: 99999;
    pointer-events: none;
}

.lh-mobile.is-open {
    display: block;
    pointer-events: auto;
}

.lh-mobile__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: lh-fade-in 0.25s ease both;
}

/* Slide-in panel — full height, internal nav scrolls independently */
.lh-mobile__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 88vw);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: lh-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes lh-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lh-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.lh-mobile__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--lh-topbar-bg, #2AA1AF);
    flex-shrink: 0;
}

.lh-mobile__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.lh-mobile__logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.lh-mobile__brand-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lh-mobile__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.2s, transform 0.2s;
    line-height: 1;
}

.lh-mobile__close:hover {
    background-color: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Nav list — the ONLY scrollable part of the panel.
   flex:1 + min-height:0 lets it grow/shrink within the flex column
   and scroll internally without making the whole panel scroll. */
.lh-mobile-nav {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0;
    min-height: 0;
}

.lh-mobile-nav > li {
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.lh-mobile-nav li {
    position: relative;
}

/* Flex row: link + optional accordion toggle */
.lh-mob-row {
    display: flex;
    align-items: stretch;
}

.lh-mobile-nav a {
    display: block;
    flex: 1;
    padding: 13px 20px;
    color: var(--lh-menu-text, #333);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    transition: background-color 0.18s, color 0.18s;
}

.lh-mobile-nav a:hover,
.lh-mobile-nav a:focus-visible {
    color: var(--lh-menu-hover, #2AA1AF);
    background-color: rgba(42,161,175,0.05);
}

.lh-mobile-nav li.current-menu-item > .lh-mob-row > a {
    color: var(--lh-menu-hover, #2AA1AF);
    border-left: 3px solid var(--lh-menu-hover, #2AA1AF);
    padding-left: 17px;
}

.lh-mob-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(0,0,0,0.07);
    cursor: pointer;
    color: var(--lh-menu-text, #555);
    transition: background-color 0.2s, color 0.2s;
}

.lh-mob-toggle:hover {
    background-color: rgba(42,161,175,0.06);
    color: var(--lh-menu-hover, #2AA1AF);
}

.lh-mob-toggle svg {
    transition: transform 0.25s ease;
}

.lh-mob-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.lh-mob-toggle[aria-expanded="true"] {
    background-color: rgba(42,161,175,0.08);
    color: var(--lh-menu-hover, #2AA1AF);
}

/* Sub-menu */
.lh-mob-sub {
    list-style: none;
    background: #f8fafb;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.lh-mob-sub li {
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.lh-mob-sub a {
    padding-left: 36px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.lh-mob-sub .lh-mob-sub a {
    padding-left: 52px;
}

/* Panel footer */
.lh-mobile__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 22px;
    border-top: 1px solid rgba(0,0,0,0.07);
    flex-shrink: 0;
    background: #fafafa;
}

.lh-mobile__phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--lh-topbar-bg, #2AA1AF);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    transition: opacity 0.2s;
}

.lh-mobile__phone:hover {
    opacity: 0.8;
}

.lh-mobile__social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lh-mobile__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(42,161,175,0.1);
    color: var(--lh-topbar-bg, #2AA1AF);
    text-decoration: none;
    border: 1px solid rgba(42,161,175,0.2);
    transition: background-color 0.2s, transform 0.2s;
}

.lh-mobile__social-link:hover {
    background-color: var(--lh-topbar-bg, #2AA1AF);
    color: #ffffff;
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   RESPONSIVE — TABLET (768–1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .lh-nav-list > li > a {
        padding: 8px 10px;
        font-size: 12.5px;
        letter-spacing: 0.02em;
    }

    .lh-contact-btn {
        padding: 9px 16px;
        font-size: 12px;
    }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — MOBILE (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    /* Show hamburger, hide desktop nav */
    .lh-hamburger { display: flex; }
    .lh-nav       { display: none; }

    /* Compact top bar — hide elements that don't fit */
    .lh-topbar          { font-size: 12px; padding: 5px 0; }
    .lh-topbar__tagline { display: none; }
    .lh-topbar__divider { display: none; }
    .lh-topbar__label   { display: none; }

    /* Fixed logo height on mobile — same in all scroll states */
    .lh-logo-img { height: 52px; }

    .lh-main .lh-container { min-height: 64px; }
}

@media (max-width: 380px) {
    .lh-topbar__num    { font-size: 11.5px; }
    .lh-topbar__social { width: 26px; height: 26px; }
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY — focus-visible outlines
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--lh-menu-hover, #2AA1AF);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Blocksy override — hide the built-in header so ours renders alone
   -------------------------------------------------------------------------- */
#site-header            { display: none !important; }
.header-builder-wrapper { display: none !important; }
