/* ================================================================
   Five Star Header — child theme custom header
   ================================================================ */

/* ── Variables ───────────────────────────────────────────────── */
:root {
    --fsh-topbar-bg   : #0D1B2E;
    --fsh-topbar-text : rgba(255,255,255,.70);
    --fsh-topbar-h    : 48px;
    --fsh-nav-bg      : #ffffff;
    --fsh-nav-text    : #1B1B1B;
    --fsh-nav-h       : 84px;
    --fsh-nav-h-stuck : 68px;
    --fsh-shadow      : 0 2px 16px rgba(0,0,0,.07);
    --fsh-shadow-stuck: 0 4px 24px rgba(0,0,0,.13);
    --fsh-accent      : var(--theme-color, #E30D16);
    --fsh-radius      : 6px;
    --fsh-trans       : 0.25s ease;
    --fsh-menu-font   : var(--body-font, 'Inter', sans-serif);
    --fsh-drawer-w    : 340px;
}

/* ── Reset / Base ────────────────────────────────────────────── */
.fsh-header *,
.fsh-header *::before,
.fsh-header *::after {
    box-sizing: border-box;
}

.fsh-header a {
    text-decoration: none;
}

/* ── Outer wrapper ───────────────────────────────────────────── */
.fsh-header {
    position: relative;
    z-index: 1050;
    width: 100%;
}

/* ================================================================
   TOP BAR
   ================================================================ */
.fsh-topbar {
    background: var(--fsh-topbar-bg);
    height: var(--fsh-topbar-h);
}

/* 3-column grid: spacer | centre (email+phone) | right (social+call) */
.fsh-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 42px;
    height: var(--fsh-topbar-h);
}

/* Centre: email + phone */
.fsh-topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.fsh-tb-divider {
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,.20);
    flex-shrink: 0;
}

.fsh-tb-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: rgba(255,255,255,.75);
    transition: color var(--fsh-trans);
    white-space: nowrap;
}

.fsh-tb-link i {
    font-size: 12px;
    color: rgba(255,255,255,.75);
    flex-shrink: 0;
    transition: color var(--fsh-trans);
}

.fsh-tb-link:hover,
.fsh-tb-link:hover i {
    color: #ffffff;
}

/* Right: social + call badge */
.fsh-topbar-right {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.fsh-social-label {
    font-size: 12px;
    color: rgba(255,255,255,.60);
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.fsh-tb-social {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fsh-tb-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.80);
    font-size: 13px;
    transition: border-color var(--fsh-trans), background var(--fsh-trans), color var(--fsh-trans), transform var(--fsh-trans);
}

.fsh-tb-social a:hover {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.50);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Call Now badge */
.fsh-call-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 99px;
    background: var(--fsh-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: filter var(--fsh-trans), transform var(--fsh-trans);
    white-space: nowrap;
}

.fsh-call-badge:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    color: #fff;
}

/* ================================================================
   MAIN NAVBAR
   ================================================================ */
.fsh-navbar {
    background: var(--fsh-nav-bg);
    box-shadow: var(--fsh-shadow);
    position: sticky;
    top: 0;
    z-index: 1050;
    transition: box-shadow var(--fsh-trans), padding var(--fsh-trans);
}

.fsh-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: var(--fsh-nav-h);
    transition: height var(--fsh-trans);
    /* Contain any stray elements the parent theme injects */
    overflow: visible;
    position: relative;
}

/* Stuck (scrolled past topbar) */
.fsh-navbar.is-stuck {
    box-shadow: var(--fsh-shadow-stuck);
}

.fsh-navbar.is-stuck .fsh-navbar-inner {
    height: var(--fsh-nav-h-stuck);
}

/* ── Logo ─────────────────────────────────────────────────────── */
.fsh-logo-wrap {
    flex-shrink: 0;
    min-width: 0;
}

.fsh-logo-wrap .logo,
.fsh-logo-wrap a.logo {
    display: inline-flex;
    align-items: center;
}

.fsh-logo-wrap img {
    max-height: 54px;
    width: auto;
    display: block;
    transition: max-height var(--fsh-trans);
}

.fsh-navbar.is-stuck .fsh-logo-wrap img {
    max-height: 42px;
}

/* Text logo fallback style */
.fsh-logo-text {
    font-family: var(--fsh-menu-font);
    font-size: 20px;
    font-weight: 800;
    color: var(--fsh-nav-text);
    letter-spacing: -0.3px;
    white-space: nowrap;
    transition: color var(--fsh-trans);
}

.fsh-logo-text:hover {
    color: var(--fsh-accent);
}

/* ── Desktop Menu ─────────────────────────────────────────────── */
.fsh-nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.fsh-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.fsh-menu > li {
    position: relative;
}

.fsh-menu > li > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    font-family: var(--fsh-menu-font);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--fsh-nav-text);
    position: relative;
    transition: color var(--fsh-trans);
    white-space: nowrap;
}

/* Animated underline */
.fsh-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--fsh-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s ease;
}

.fsh-menu > li > a:hover,
.fsh-menu > li.current-menu-item > a,
.fsh-menu > li.current-menu-ancestor > a,
.fsh-menu > li.current-page-ancestor > a {
    color: var(--fsh-accent);
}

.fsh-menu > li > a:hover::after,
.fsh-menu > li.current-menu-item > a::after,
.fsh-menu > li.current-menu-ancestor > a::after,
.fsh-menu > li.current-page-ancestor > a::after {
    transform: scaleX(1);
}

/* Chevron for parent items */
.fsh-menu > li.menu-item-has-children > a::before {
    content: '\f107';
    font-family: 'Font Awesome 6 Pro', 'Font Awesome 6 Free', sans-serif;
    font-weight: 900;
    font-size: 10px;
    order: 1;
    transition: transform var(--fsh-trans);
}

.fsh-menu > li.menu-item-has-children:hover > a::before {
    transform: rotate(-180deg);
}

/* ── Dropdown ─────────────────────────────────────────────────── */
.fsh-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border-top: 3px solid var(--fsh-accent);
    border-radius: 0 0 var(--fsh-radius) var(--fsh-radius);
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 100;
}

.fsh-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fsh-menu .sub-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-family: var(--fsh-menu-font);
    font-size: 13.5px;
    font-weight: 500;
    color: #3a3a3a;
    transition: color var(--fsh-trans), padding-left var(--fsh-trans), background var(--fsh-trans);
    white-space: nowrap;
}

.fsh-menu .sub-menu li a:hover {
    color: var(--fsh-accent);
    padding-left: 26px;
    background: rgba(0,0,0,.02);
}

.fsh-menu .sub-menu li.current-menu-item a {
    color: var(--fsh-accent);
    font-weight: 600;
}

/* WhatsApp keeps its brand green on hover */
.fsh-tb-social a[aria-label="WhatsApp"]:hover {
    background: #25D366;
    border-color: #25D366;
    color: #fff;
}

/* ── Hide injected theme-colour toggle inside our header ─────── */
/* fivestar-toggle.js appends #fivestar-toggle-wrap to <header>  */
.fsh-header #fivestar-toggle-wrap,
.fsh-header #fivestar-theme-toggle,
.fsh-header .fs-theme-toggle {
    display: none !important;
}

/* ── "Get a free quote" nav menu button ───────────────────────── */
/* Targets CSS classes set in WP Admin → Menus, plus :last-child   */
/* fallback so it works even if no CSS class is manually applied.  */
/* Get a free quote menu button */

.fsh-menu > li.th-btn > a,
.fsh-menu > li.menu-btn > a,
.fsh-menu > li.nav-btn > a,
.fsh-menu > li:last-child > a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 13px 26px !important;
    border: 2px solid #143A63 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #143A63 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    appearance: none !important;
    white-space: nowrap;
    transition: color .25s ease, background .25s ease,
                border-color .25s ease, box-shadow .25s ease,
                transform .25s ease;
}

.fsh-menu > li.th-btn > a:hover,
.fsh-menu > li.menu-btn > a:hover,
.fsh-menu > li.nav-btn > a:hover,
.fsh-menu > li:last-child > a:hover {
    background: #143A63 !important;
    border-color: #143A63 !important;
    color: #FFFFFF !important;
    box-shadow: 0 6px 20px rgba(20,58,99,.30);
    transform: translateY(-1px);
}

.fsh-menu > li.th-btn > a::before,
.fsh-menu > li.menu-btn > a::before,
.fsh-menu > li.nav-btn > a::before,
.fsh-menu > li:last-child > a::before,
.fsh-menu > li.th-btn > a::after,
.fsh-menu > li.menu-btn > a::after,
.fsh-menu > li.nav-btn > a::after,
.fsh-menu > li:last-child > a::after {
    display: none !important;
}

/* ── Right side (CTA + toggle) ────────────────────────────────── */
.fsh-nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* CTA button */
.fsh-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--fsh-accent);
    color: #fff;
    font-family: var(--fsh-menu-font);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: var(--fsh-radius);
    border: 2px solid var(--fsh-accent);
    transition: background var(--fsh-trans), color var(--fsh-trans), transform var(--fsh-trans), box-shadow var(--fsh-trans);
    white-space: nowrap;
}

.fsh-cta-btn:hover {
    background: transparent;
    color: var(--fsh-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

/* Hamburger toggle */
.fsh-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    gap: 5px;
    background: transparent;
    border: 2px solid rgba(0,0,0,.12);
    border-radius: var(--fsh-radius);
    cursor: pointer;
    padding: 0;
    transition: border-color var(--fsh-trans);
}

.fsh-toggle:hover {
    border-color: var(--fsh-accent);
}

.fsh-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--fsh-nav-text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
    transform-origin: center;
}

/* Animated X when open */
.fsh-toggle[aria-expanded="true"] .fsh-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--fsh-accent);
}
.fsh-toggle[aria-expanded="true"] .fsh-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.fsh-toggle[aria-expanded="true"] .fsh-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--fsh-accent);
}

/* ================================================================
   MOBILE DRAWER
   ================================================================ */
.fsh-drawer {
    position: fixed;
    top: 0;
    right: calc(-1 * var(--fsh-drawer-w));
    width: var(--fsh-drawer-w);
    max-width: 100vw;
    height: 100dvh;
    background: #fff;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,.15);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.fsh-drawer.is-open {
    right: 0;
}

/* Drawer head */
.fsh-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,.07);
    flex-shrink: 0;
}

.fsh-drawer-head .fsh-logo-wrap img {
    max-height: 44px;
}

.fsh-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,.12);
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    transition: border-color var(--fsh-trans), color var(--fsh-trans), transform var(--fsh-trans);
}

.fsh-drawer-close:hover {
    border-color: var(--fsh-accent);
    color: var(--fsh-accent);
    transform: rotate(90deg);
}

/* Drawer nav */
.fsh-drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    overscroll-behavior: contain;
}

.fsh-drawer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fsh-drawer-menu li {
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.fsh-drawer-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    font-family: var(--fsh-menu-font);
    font-size: 15px;
    font-weight: 600;
    color: var(--fsh-nav-text);
    transition: color var(--fsh-trans), background var(--fsh-trans), padding-left var(--fsh-trans);
}

.fsh-drawer-menu li a:hover,
.fsh-drawer-menu li.current-menu-item > a,
.fsh-drawer-menu li.current-menu-ancestor > a {
    color: var(--fsh-accent);
    background: rgba(0,0,0,.02);
    padding-left: 30px;
}

/* Sub-menu toggle button */
.fsh-sub-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    margin-right: 12px;
    transition: color var(--fsh-trans), transform var(--fsh-trans);
}

.fsh-sub-toggle:hover {
    color: var(--fsh-accent);
}

.fsh-drawer-menu li.is-open > .fsh-sub-toggle {
    transform: rotate(180deg);
    color: var(--fsh-accent);
}

/* Accordion sub-menu */
.fsh-drawer-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    background: #fafafa;
    transition: max-height 0.32s ease;
}

.fsh-drawer-menu li.is-open > .sub-menu {
    max-height: 800px;
}

.fsh-drawer-menu .sub-menu li {
    border-bottom: 1px solid rgba(0,0,0,.04);
}

.fsh-drawer-menu .sub-menu li:last-child {
    border-bottom: none;
}

.fsh-drawer-menu .sub-menu li a {
    padding: 12px 24px 12px 36px;
    font-size: 14px;
    font-weight: 500;
}

/* Drawer footer */
.fsh-drawer-foot {
    padding: 20px 24px 28px;
    border-top: 1px solid rgba(0,0,0,.07);
    flex-shrink: 0;
}

.fsh-drawer-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid rgba(0,0,0,.1);
    border-radius: var(--fsh-radius);
    font-size: 15px;
    font-weight: 700;
    color: var(--fsh-nav-text);
    margin-bottom: 10px;
    transition: border-color var(--fsh-trans), color var(--fsh-trans);
}

.fsh-drawer-phone:hover {
    border-color: var(--fsh-accent);
    color: var(--fsh-accent);
}

.fsh-drawer-phone i {
    color: var(--fsh-accent);
}

.fsh-drawer-cta {
    display: flex;
    justify-content: center;
    width: 100%;
    border-radius: var(--fsh-radius);
}

/* ── Overlay ──────────────────────────────────────────────────── */
.fsh-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
    backdrop-filter: blur(2px);
}

.fsh-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */

/* xl and above: show desktop nav */
@media (min-width: 1200px) {
    .fsh-toggle {
        display: none !important;
    }
    .fsh-nav {
        display: flex;
    }
}

/* Below xl: show toggle, hide desktop nav */
@media (max-width: 1199px) {
    .fsh-toggle {
        display: inline-flex;
    }
    .fsh-nav {
        display: none;
    }
    .fsh-cta-btn {
        display: none;
    }
}

/* Tablet: hide email/phone label text, keep icons readable */
@media (max-width: 991px) {
    .fsh-social-label {
        display: none;
    }
    .fsh-topbar-right {
        gap: 10px;
    }
}

/* md and below: collapse topbar to single column, centre social + call */
@media (max-width: 767px) {
    .fsh-topbar-inner {
        grid-template-columns: 1fr;
    }
    .fsh-topbar-center {
        display: none;
    }
    .fsh-topbar-right {
        justify-content: center;
    }
    /* Tighten nav height on small phones */
    :root {
        --fsh-nav-h: 72px;
        --fsh-nav-h-stuck: 62px;
    }
    .fsh-logo-wrap img {
        max-height: 46px;
    }
}

/* Extra small: tighten drawer */
@media (max-width: 400px) {
    :root {
        --fsh-drawer-w: 100vw;
    }
}
