/* ==========================================================================
   SITE HEADER  (loaded after style.css, so it overrides the older .menu-list rules)
   Theme: --primary #F3525A, --dark #152440 (see :root in style.css)
   ========================================================================== */

/* `overflow-x: hidden` on <body> (style.css) stops position:sticky from working; `clip` keeps the
   same no-sideways-scroll behaviour without creating a scroll container. */
body { overflow-x: clip; }

.sg-header {
    --sgh-primary: var(--primary, #F3525A);
    --sgh-dark: var(--dark, #152440);
    --sgh-tint: rgba(243, 82, 90, .09);

    position: sticky;
    top: 0;
    z-index: 1030;
    flex-wrap: wrap; /* below 1200px the opened menu drops onto its own row */
    padding: 12px 32px;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: saturate(170%) blur(14px);
    backdrop-filter: saturate(170%) blur(14px);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 10px 30px rgba(21, 36, 64, .08);
    transition: padding .3s ease, box-shadow .3s ease, background .3s ease;
}

/* Brand accent line along the very top edge */
.sg-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sgh-primary), #ff8a90 55%, var(--sgh-dark));
}

.sg-header.is-scrolled {
    padding-top: 6px;
    padding-bottom: 6px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 12px 32px rgba(21, 36, 64, .16);
}

.sg-header .header-logo { display: inline-flex; align-items: center; flex: none; margin-right: 18px; }
.sg-header .header-logo img { min-width: 0; width: 150px; max-width: 100%; height: auto; transition: width .3s ease; }
.sg-header.is-scrolled .header-logo img { width: 132px; }

/* ----- Mobile / tablet toggle button (below 1200px) ----- */
.sg-header .navbar-toggler {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--sgh-tint);
    align-items: center;
    justify-content: center;
    transition: background .25s ease;
}
/* Only shown below 1200px; Bootstrap's navbar-expand-xl hides it above that, so don't force display here. */
@media (max-width: 1199.98px) {
    .sg-header .navbar-toggler { display: inline-flex; }
}
.sg-header .navbar-toggler:hover { background: rgba(243, 82, 90, .16); }
.sg-header .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(243, 82, 90, .28); outline: 0; }
.sg-header .navbar-toggler-icon {
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F3525A' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E");
}
.sg-header .navbar-toggler:not(.collapsed) .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F3525A' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

/* ==========================================================================
   DESKTOP  (1200px and up)
   ========================================================================== */
@media (min-width: 1200px) {
    .sg-header { flex-wrap: nowrap; }
    .sg-header .navbar-collapse { flex-basis: auto; flex-grow: 1; }
    .sg-header .menu-list { gap: 4px; justify-content: flex-end; }

    .sg-header .menu-list > li > a {
        padding: 10px 15px;
        border-radius: 999px;
        font-family: 'Barlow', sans-serif;
        font-size: 17px;
        font-weight: 600;
        color: var(--sgh-dark);
        position: relative;
    }
    /* Clean text-only links on desktop; icons stay for the mobile menu and the dropdown items */
    .sg-header .menu-list > li > a > i:not(.arrow-icon) { display: none; }

    .sg-header .menu-list > li > a:hover,
    .sg-header .menu-list > li:hover > a {
        background: var(--sgh-tint);
        color: var(--sgh-primary);
    }
    .sg-header .menu-list .arrow-icon { color: currentColor !important; }

    /* Current page / section */
    .sg-header .menu-list > li.is-current > a { color: var(--sgh-primary); }
    .sg-header .menu-list > li.is-current > a::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: 2px;
        width: 18px;
        height: 3px;
        margin-left: -9px;
        border-radius: 3px;
        background: var(--sgh-primary);
    }

    /* Dropdown card */
    .sg-header .menu-list .sub-menu {
        top: calc(100% + 10px);
        width: 360px;
        padding: 10px;
        border: 1px solid rgba(21, 36, 64, .06);
        border-radius: 18px;
        box-shadow: 0 22px 50px rgba(21, 36, 64, .18);
    }
    /* invisible bridge so the menu doesn't close while the pointer crosses the gap */
    .sg-header .menu-list .sub-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
    .sg-header .menu-list .sub-menu li a {
        min-height: 50px;
        padding: 8px 12px;
        font-size: 16px;
        font-weight: 600;
        color: var(--sgh-dark);
        border-radius: 12px;
    }
    .sg-header .menu-list .sub-menu li a i {
        width: 34px;
        min-width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: var(--sgh-tint);
        font-size: 15px;
        transition: background .25s ease, color .25s ease;
    }
    .sg-header .menu-list .sub-menu li a:hover { background: #fff5f5; color: var(--sgh-primary); padding-left: 12px; }
    .sg-header .menu-list .sub-menu li a:hover i { background: var(--sgh-primary); color: #fff; }

    /* Phone chip */
    .sg-header .help-menu-item { margin-left: 8px; }
    .sg-header .contact-area {
        gap: 10px;
        padding: 5px 16px 5px 6px;
        border: 1px solid rgba(21, 36, 64, .1);
        border-radius: 999px;
        background: #fff;
        transition: border-color .25s ease, box-shadow .25s ease;
    }
    .sg-header .contact-area:hover { border-color: rgba(243, 82, 90, .45); box-shadow: 0 6px 18px rgba(243, 82, 90, .14); }
    .sg-header .contact-help-icon { width: 40px; height: 40px; background: var(--sgh-tint); }
    .sg-header .contact-help-icon img { width: 26px; height: 26px; }
    .sg-header .contact-help-content { gap: 0; }
    .sg-header .contact-help-content span { color: #6b7590; font-size: 12px; font-weight: 600; }
    .sg-header .contact-help-content a { color: var(--sgh-dark) !important; font-size: 16px !important; font-weight: 700 !important; }
    .sg-header .contact-help-content a:hover { color: var(--sgh-primary) !important; }

    /* Contact button */
    .sg-header .contact-button-item { margin-left: 8px; }
    .sg-header .menu-list > li.contact-button-item > a.contact-btn {
        width: auto;
        height: 48px;
        padding: 0 26px !important;
        gap: 9px;
        border-radius: 999px;
        background: linear-gradient(135deg, var(--sgh-primary), #ff7a80);
        color: #fff !important;
        font-family: 'Barlow', sans-serif;
        font-size: 17px !important;
        font-weight: 700 !important;
        box-shadow: 0 10px 22px rgba(243, 82, 90, .32);
        transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
    }
    .sg-header .menu-list > li.contact-button-item > a.contact-btn i { display: inline-block; color: #fff !important; font-size: 16px; }
    .sg-header .menu-list > li.contact-button-item > a.contact-btn:hover {
        background: var(--sgh-dark);
        color: #fff !important;
        transform: translateY(-2px);
        box-shadow: 0 12px 24px rgba(21, 36, 64, .28);
    }
}

/* Slightly tighter on smaller laptops so everything fits on one line */
@media (min-width: 1200px) and (max-width: 1399px) {
    .sg-header { padding-left: 20px; padding-right: 20px; }
    .sg-header .header-logo { margin-right: 6px; }
    .sg-header .header-logo img { width: 130px; }
    .sg-header .menu-list > li > a { padding: 10px 11px; font-size: 16px; }
    .sg-header .contact-help-content span { display: none; }
    .sg-header .contact-help-content a { font-size: 15px !important; }
    .sg-header .menu-list > li.contact-button-item > a.contact-btn { padding: 0 20px !important; font-size: 16px !important; }
}

/* ==========================================================================
   MOBILE & TABLET  (below 1200px) - menu opens as a clean card under the bar
   ========================================================================== */
@media (max-width: 1199.98px) {
    .sg-header { padding: 10px 16px; border-radius: 0 0 22px 22px; }
    .sg-header .header-logo img { width: 128px; }
    .sg-header.is-scrolled .header-logo img { width: 118px; }
    .sg-header .navbar-toggler { margin-left: auto; }

    .sg-header .navbar-collapse {
        flex-basis: 100%;
        margin-top: 10px;
        border-radius: 18px;
        background: #fff;
        border: 1px solid rgba(21, 36, 64, .07);
        box-shadow: 0 16px 36px rgba(21, 36, 64, .14);
        max-height: calc(100vh - 92px);
        max-height: calc(100dvh - 92px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sg-header .menu-list { padding: 8px; }

    .sg-header .menu-list > li > a {
        padding: 12px 14px;
        border-radius: 12px;
        font-family: 'Barlow', sans-serif;
        font-size: 17px;
        font-weight: 600;
        color: var(--sgh-dark);
    }
    .sg-header .menu-list > li > a > i:not(.arrow-icon) {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: var(--sgh-tint);
        font-size: 16px;
        color: var(--sgh-primary);
    }
    .sg-header .menu-list > li > a:hover,
    .sg-header .menu-list > li.is-current > a,
    .sg-header .menu-list > li.menu-item-has-children.active > a { background: var(--sgh-tint); color: var(--sgh-primary); }

    .sg-header .menu-list .dropdown-icon { top: 11px; right: 12px; width: 34px; height: 34px; line-height: 34px; font-size: 20px; color: var(--sgh-primary); }
    .sg-header .menu-list .sub-menu { padding: 2px 6px 8px 22px; }
    .sg-header .menu-list .sub-menu li a { min-height: 44px; font-size: 15px; font-weight: 600; color: var(--sgh-dark); border-radius: 10px; }
    .sg-header .menu-list .sub-menu li a i { color: var(--sgh-primary); }
    .sg-header .menu-list .sub-menu li a:hover { background: #fff5f5; color: var(--sgh-primary); }

    .sg-header .help-menu-item { margin: 6px 8px 4px; padding: 14px 6px 8px; border-top: 1px solid rgba(21, 36, 64, .08); }
    .sg-header .contact-help-icon { background: var(--sgh-tint); }
    .sg-header .contact-help-content a { color: var(--sgh-dark) !important; }

    .sg-header .contact-button-item { margin: 4px 8px 10px; }
    .sg-header .menu-list > li.contact-button-item > a.contact-btn {
        width: 100%;
        height: 50px;
        border-radius: 999px;
        background: linear-gradient(135deg, var(--sgh-primary), #ff7a80);
        color: #fff !important;
        font-family: 'Barlow', sans-serif;
        font-size: 17px !important;
        font-weight: 700 !important;
        justify-content: center;
        box-shadow: 0 10px 22px rgba(243, 82, 90, .3);
    }
    .sg-header .menu-list > li.contact-button-item > a.contact-btn i { width: auto; height: auto; background: none; color: #fff !important; }
}

@media (max-width: 575.98px) {
    .sg-header { padding: 8px 12px; }
    .sg-header .header-logo img { width: 112px; }
    .sg-header .navbar-toggler { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .sg-header, .sg-header * { transition: none !important; }
}
