/* Polished header.css - transitions, backdrop, accessible styles */

/* ================= GLOBAL RESETS ================= */
.sm-header-wrapper {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
    z-index: 999999;
    line-height: 1.4;
}
.sm-header-wrapper * { box-sizing: border-box; }
.sm-container { max-width: 1200px; margin: 0 auto; padding: 0 15px; width: 100%; }

/* FORCE HIDE THEME HEADERS */
header.site-header, #masthead, .site-header, .elementor-location-header, .ast-main-header-wrap, .hfeed > header {
    display: none !important;
}

/* ================= DESKTOP LAYOUT (Min-Width: 993px) ================= */
@media (min-width: 993px) {
    .sm-mobile-search-wrapper, .sm-hamburger { display: none !important; }
    .sm-top-bar {
        background-color: #f37021;
        color: #fff;
        height: 44px;
        display: flex; align-items: center;
    }
    .sm-flex-between { display: flex; justify-content: space-between; align-items: center; width: 100%; }
    .sm-top-links ul { list-style: none; margin: 0; padding: 0; display: flex; }
    .sm-top-links ul li a { color: #fff; text-decoration: none; padding: 0 15px; border-right: 1px solid rgba(255,255,255,0.4); font-size: 13px; font-weight: 600; }
    .sm-top-links ul li:last-child a { border: none; }
    .sm-desktop-search { display: block; }
    .sm-search-form { position: relative; display: flex; align-items: center; }
    .sm-search-input {
        background: #002266; border: 1px solid #002266;
        border-radius: 20px; color: #fff;
        padding: 5px 35px 5px 15px;
        font-size: 13px; width: 260px; outline: none; transition: 0.3s;
    }
    .sm-search-input:focus { background: #003399; }
    .sm-search-input::placeholder { color: #ccc; opacity: 1; }
    .sm-search-btn { position: absolute; right: 5px; background: none; border: none; color: #fff; cursor: pointer; }
    .sm-logo-row {
        background: linear-gradient(90deg, #302b85 0%, #151552 100%);
        padding: 15px 0;
    }
    .sm-site-branding img { display: block; width: auto; }
    .sm-site-title { color: #fff; font-size: 32px; margin: 0; font-weight: bold; }
    .sm-menu-row { background: #001a4d; border-top: 1px solid rgba(255,255,255,0.15); }
    .sm-main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
    .sm-main-nav ul li a {
        display: block; color: #fff; text-decoration: none;
        padding: 14px 22px; font-weight: 700; font-size: 15px;
        border-right: 1px solid rgba(255,255,255,0.1);
        text-transform: uppercase; transition: background 0.2s;
    }
    .sm-main-nav ul li a:hover { background: #f37021; }
}

/* ================= MOBILE LAYOUT (Max-Width: 992px) ================= */
@media (max-width: 992px) {
    .sm-top-links, .sm-desktop-search { display: none !important; }
    .sm-top-bar { height: 5px; background-color: #f37021; overflow: hidden; }
    .sm-logo-row { background: linear-gradient(90deg, #302b85 0%, #151552 100%); padding: 10px 0; }
    .sm-logo-flex { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
    .sm-site-branding img { height: 40px !important; width: auto; }
    .sm-site-title { font-size: 22px; margin: 0; color: #fff; }
    .sm-mobile-search-wrapper { display: block; flex-grow: 1; max-width: 240px; }
    .sm-search-form.mobile-mode { position: relative; width: 100%; display: flex; }
    .sm-search-input.mobile-mode {
        width: 100%;
        background: #0d1b3e;
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 20px;
        color: #fff;
        padding: 8px 35px 8px 12px;
        font-size: 13px;
        height: 38px;
        outline: none;
    }
    .sm-search-btn.mobile-mode { position: absolute; right: 10px; top: 0; bottom: 0; background: none; border: none; color: #fff; }
    .sm-menu-row { background: #001a4d; border-top: 1px solid rgba(255,255,255,0.1); height: 46px; }
    .sm-menu-flex { display: flex; align-items: center; height: 100%; overflow: hidden; }
    .sm-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        width: 50px;
        height: 100%;
        padding-left: 10px;
        border-right: 1px solid rgba(255,255,255,0.1);
        cursor: pointer;
        flex-shrink: 0;
        transition: opacity 0.2s ease;
    }
    .sm-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .sm-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .sm-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    .sm-hamburger span { display: block; width: 22px; height: 3px; background: #333; border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
    .sm-main-nav { flex-grow: 1; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; height: 100%; }
    .sm-main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; height: 100%; }
    .sm-main-nav ul li a { display: flex; align-items: center; color: #fff; text-decoration: none; padding: 0 15px; height: 100%; font-size: 14px; font-weight: 500; border-right: 1px solid rgba(255,255,255,0.1); }
}

/* ================= SHARED STATES ROW ================= */
.sm-states-row { background: #fff; border-bottom: 2px solid #e5e5e5; white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sm-states-nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.sm-states-nav ul li a { display: block; color: #333; text-decoration: none; padding: 10px 15px; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.sm-states-nav ul li a:hover { color: #f37021; }
.sm-main-nav::-webkit-scrollbar, .sm-states-row::-webkit-scrollbar { display: none; }

/* MOBILE SLIDE MENU (polished) */
.sm-mobile-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-110%);
    width: 78%;
    max-width: 380px;
    height: 100vh;
    background: #001a4d;
    color: #fff;
    z-index: 100000000;
    padding: 24px;
    transition: transform 0.32s cubic-bezier(.2,.9,.2,1);
    box-shadow: 4px 0 30px rgba(0,0,0,0.4);
    overflow-y: auto;
    will-change: transform;
}

.sm-mobile-menu-panel.active {
    transform: translateX(0);
}

.sm-mobile-mobile-focus {
    outline: 2px solid #f37021;
    outline-offset: 2px;
}

.sm-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease;
    z-index: 99999999;
}

.sm-mobile-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.sm-mobile-menu-close {
    font-size: 22px;
    margin-bottom: 14px;
    cursor: pointer;
    color: #fff;
    background: transparent;
    border: 0;
    padding: 6px;
}

.sm-mobile-menu-wrapper ul { list-style: none; margin: 0; padding: 0; }
.sm-mobile-menu-wrapper ul li a {
    color: #fff;
    padding: 12px 0;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 16px;
    text-decoration: none;
}

/* small accessibility helpers */
.sr-only { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* fallback for very small screens */
@media (max-width: 360px) {
    .sm-mobile-menu-panel { width: 88%; }
    .sm-hamburger span { width: 18px; }
}