/* Compact, accessible mobile and tablet header */
@media (max-width: 1024px) {
    .site-header {
        position: relative;
        z-index: 1000;
        width: 100%;
        padding: 0;
        overflow: visible;
        background: #070d18;
        border-bottom: 1px solid rgba(148, 163, 184, .15);
    }

    .header-mobile-bar {
        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        align-items: center;
        min-height: 68px;
        padding: 8px clamp(14px, 3vw, 26px);
        box-sizing: border-box;
    }

    .header-mobile-bar .site-logo {
        justify-self: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        color: #fff;
        text-decoration: none;
        line-height: 1;
    }

    .header-mobile-bar .site-logo img {
        display: block;
        width: auto;
        max-width: min(58vw, 220px);
        height: 38px;
        object-fit: contain;
    }

    .header-mobile-bar .site-logo-text {
        color: #fff;
        font-size: 23px;
        font-weight: 800;
        letter-spacing: -.7px;
        white-space: nowrap;
    }

    .header-search-toggle,
    .header-mobile-bar .mobile-menu {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        color: #f8fafc;
        background: transparent;
        border: 0;
        border-radius: 12px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .header-search-toggle {
        justify-self: start;
    }

    .header-search-toggle svg {
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
    }

    .header-mobile-bar .mobile-menu {
        justify-self: end;
        flex-direction: column;
        gap: 5px;
    }

    .header-mobile-bar .mobile-menu span {
        display: block;
        width: 21px;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
        transition: transform .18s ease, opacity .18s ease;
    }

    .header-mobile-bar .mobile-menu.is-open span:first-child {
        transform: translateY(7px) rotate(45deg);
    }

    .header-mobile-bar .mobile-menu.is-open span:nth-child(2) {
        opacity: 0;
    }

    .header-mobile-bar .mobile-menu.is-open span:last-child {
        transform: translateY(-7px) rotate(-45deg);
    }

    .site-header .header-search {
        display: none !important;
        align-items: stretch;
        gap: 0;
        width: auto;
        margin: 0 14px 12px;
        padding: 0;
        overflow: hidden;
        background: #0b1423;
        border: 1px solid #27354a;
        border-radius: 12px;
    }

    .site-header .header-search.is-open {
        display: flex !important;
    }

    .site-header .header-search input {
        flex: 1 1 auto;
        width: 0;
        min-width: 0;
        height: 46px;
        padding: 0 14px;
        color: #f8fafc;
        background: transparent;
        border: 0;
        outline: none;
        font-size: 15px;
    }

    .site-header .header-search button {
        flex: 0 0 auto;
        min-width: 76px;
        padding: 0 14px;
        color: #fff;
        background: #ef3340;
        border: 0;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
    }

    .site-header .header-category-icons {
        display: none !important;
    }

    .site-header .main-navigation {
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 6px 14px 14px;
        box-sizing: border-box;
        background: #070d18;
        border: 0;
        border-top: 1px solid rgba(148, 163, 184, .12);
        box-shadow: 0 14px 24px rgba(0, 0, 0, .24);
    }

    .site-header .main-navigation.is-open {
        display: flex !important;
    }

    .site-header .main-navigation a {
        display: flex;
        align-items: center;
        min-height: 46px;
        padding: 0 12px;
        color: #e7edf6;
        background: transparent;
        border: 0;
        border-bottom: 1px solid rgba(148, 163, 184, .12);
        border-radius: 0;
        font-size: 15px;
        font-weight: 600;
        letter-spacing: .01em;
        text-decoration: none;
        text-transform: none;
    }

    .site-header .main-navigation a:last-child {
        border-bottom: 0;
    }

    .site-header .main-navigation a:hover,
    .site-header .main-navigation a:focus-visible {
        color: #fff;
        background: #111c2c;
        outline: none;
    }

    .header-search-toggle:focus-visible,
    .header-mobile-bar .mobile-menu:focus-visible {
        outline: 2px solid #f15a67;
        outline-offset: 2px;
    }
}

@media (min-width: 1025px) {
    .header-mobile-bar {
        display: none !important;
    }
}

.site-header:after { content: none !important; display: none !important; }

@media (max-width: 1024px) {
    .site-header .header-mobile-bar .header-search-toggle:hover,
    .site-header .header-mobile-bar .header-search-toggle:active {
        color: #f8fafc !important;
        background: transparent !important;
        transform: none !important;
    }
}

@media (max-width: 1024px) {
    .header-mobile-bar .mobile-menu {
        grid-column: 1;
        grid-row: 1;
        justify-self: start !important;
    }

    .header-mobile-bar .header-search-toggle {
        grid-column: 3;
        grid-row: 1;
        justify-self: end !important;
    }
}

/* Desktop: logo, all navigation links, and compact search share one row. */
@media (min-width: 1025px) {
    .site-header {
        width: 100%;
        box-sizing: border-box;
        background: #070d18;
        border-bottom: 1px solid rgba(148, 163, 184, .15);
    }

    .site-header .header-mobile-bar,
    .site-header > #headerSearch,
    .site-header .main-navigation,
    .site-header .header-category-icons {
        display: none !important;
    }

    .site-header .desktop-header-row {
        display: flex !important;
        align-items: center;
        gap: clamp(12px, 1.5vw, 24px);
        width: 100%;
        max-width: 1440px;
        min-height: 72px;
        margin: 0 auto;
        padding: 10px clamp(18px, 3vw, 42px);
        box-sizing: border-box;
    }

    .site-header .desktop-header-logo {
        display: inline-flex;
        flex: 0 0 145px;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
        color: #fff;
        text-decoration: none;
        white-space: nowrap;
    }

    .site-header .desktop-header-logo img {
        display: block;
        width: auto;
        max-width: 145px;
        height: 38px;
        object-fit: contain;
    }

    .site-header .desktop-header-logo span {
        color: #fff;
        font-size: 23px;
        font-weight: 800;
        letter-spacing: -.7px;
    }

    .site-header .desktop-navigation {
        display: flex !important;
        flex: 1 1 auto;
        align-items: center;
        justify-content: flex-start;
        gap: clamp(9px, 1.25vw, 18px);
        width: auto;
        min-width: 0;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

    .site-header .desktop-navigation a {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 0;
        color: #e8edf5;
        background: transparent;
        border: 0;
        border-radius: 0;
        font-size: clamp(12px, 1vw, 14px);
        font-weight: 650;
        letter-spacing: 0;
        text-decoration: none;
        text-transform: none;
    }

    .site-header .desktop-navigation a:hover,
    .site-header .desktop-navigation a:focus-visible {
        color: #fff;
        background: transparent;
        outline: none;
    }

    .site-header .desktop-header-search {
        display: flex !important;
        flex: 0 1 270px;
        align-items: stretch;
        width: 270px;
        min-width: 190px;
        max-width: 290px;
        height: 40px;
        margin: 0;
        overflow: hidden;
        background: #0b1423;
        border: 1px solid #27354a;
        border-radius: 10px;
    }

    .site-header .desktop-header-search input {
        flex: 1 1 auto;
        width: 0;
        min-width: 0;
        height: 38px;
        padding: 0 12px;
        color: #f8fafc;
        background: transparent;
        border: 0;
        outline: none;
        font-size: 13px;
    }

    .site-header .desktop-header-search button {
        flex: 0 0 auto;
        min-width: 70px;
        padding: 0 12px;
        color: #fff;
        background: #ef3340;
        border: 0;
        border-radius: 0;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }
}

/* Stack to the compact toggle header below desktop widths. */
@media (max-width: 1024px) {
    .site-header .desktop-header-row {
        display: none !important;
    }
}

/* Refined desktop header layout */
@media (min-width: 1025px) {
 .site-header { position:relative!important; z-index:20; display:block!important; width:100%!important; min-height:82px; margin:0; padding:0; overflow:visible; color:#252a32; background:#fff!important; border-bottom:1px solid #e5e7eb!important; box-shadow:0 1px 3px rgba(15,23,42,.04); }
 .site-header .desktop-header-row { display:grid!important; grid-template-columns:minmax(145px,1fr) auto minmax(210px,1fr); align-items:center; column-gap:clamp(16px,2.4vw,38px); width:min(100%,1440px); min-height:82px; margin:0 auto; padding:12px clamp(24px,3.3vw,56px); box-sizing:border-box; }
 .site-header .desktop-header-logo { grid-column:1; justify-self:start; display:inline-flex; align-items:center; width:max-content; max-width:100%; }
 .site-header .desktop-header-logo img { display:block; width:auto; max-width:178px; height:48px; object-fit:contain; }
 .site-header .desktop-header-logo span { color:#111827; }
 .site-header .desktop-navigation { grid-column:2; justify-self:center; display:flex!important; align-items:center; justify-content:center; gap:clamp(18px,2.25vw,36px); width:max-content; min-width:0; margin:0; padding:0; white-space:nowrap; }
 .site-header .desktop-navigation a { display:inline-flex; align-items:center; min-height:56px; padding:0; color:#343941; background:transparent; border:0; border-bottom:2px solid transparent; border-radius:0; font-size:14px; font-weight:700; letter-spacing:.025em; text-decoration:none; text-transform:uppercase; transition:color .15s ease,border-color .15s ease; }
 .site-header .desktop-navigation a:hover,.site-header .desktop-navigation a:focus-visible { color:#6d28d9; border-bottom-color:#7c3aed; }
 .site-header .desktop-header-search { grid-column:3; justify-self:end; display:flex!important; flex:none; align-items:center; width:clamp(190px,17vw,260px); min-width:0; max-width:260px; height:42px; margin:0; overflow:hidden; background:#fff; border:1px solid #dfe2e7; border-radius:2px; box-shadow:none; }
 .site-header .desktop-header-search input { flex:1 1 auto; width:100%; min-width:0; height:40px; padding:0 13px; color:#252a32; background:#fff; border:0; outline:none; font-size:14px; }
 .site-header .desktop-header-search input::placeholder { color:#8b9098; }
 .site-header .desktop-header-search button { position:relative; display:grid; place-items:center; flex:0 0 42px; width:42px; min-width:42px; height:40px; padding:0; overflow:hidden; color:#303640; background:#fff; border:0; font-size:0; }
 .site-header .desktop-header-search button::before { width:13px; height:13px; border:1.8px solid currentColor; border-radius:50%; content:""; }
 .site-header .desktop-header-search button::after { position:absolute; top:24px; left:24px; width:7px; height:1.8px; background:currentColor; content:""; transform:rotate(45deg); transform-origin:left center; }
}

/* Restore SimpleTune's navy desktop header and keep all controls inside the bar. */
@media (min-width: 1025px) {
 .site-header { width:100%!important; min-height:82px; background:#050816!important; border-bottom:1px solid #1d263d!important; }
 .site-header .desktop-header-row {
   display:grid!important;
   grid-template-columns:minmax(130px,180px) minmax(0,1fr) minmax(185px,230px);
   align-items:center;
   gap:clamp(12px,2vw,28px);
   width:100%!important;
   max-width:1600px!important;
   min-height:82px;
   margin:0 auto!important;
   padding:10px clamp(20px,3.2vw,48px)!important;
   box-sizing:border-box!important;
 }
 .site-header .desktop-header-row > * { min-width:0; box-sizing:border-box; }
 .site-header .desktop-header-logo { grid-column:1; justify-self:start; width:100%; max-width:180px; overflow:hidden; }
 .site-header .desktop-header-logo img { display:block; width:auto; max-width:100%; max-height:46px; height:auto; object-fit:contain; object-position:left center; }
 .site-header .desktop-header-logo span { color:#fff; }
 .site-header .desktop-navigation {
   grid-column:2;
   display:flex!important;
   justify-self:stretch;
   justify-content:center;
   align-items:center;
   gap:clamp(8px,1.6vw,25px);
   width:100%;
   min-width:0;
   overflow:hidden;
   white-space:nowrap;
 }
 .site-header .desktop-navigation a {
   flex:0 1 auto;
   min-width:0;
   min-height:50px;
   padding:0;
   color:#f3f4f6;
   border:0;
   font-size:clamp(11px,.9vw,14px);
   font-weight:700;
   letter-spacing:.025em;
   text-transform:uppercase;
   white-space:nowrap;
 }
 .site-header .desktop-navigation a:hover,
 .site-header .desktop-navigation a:focus-visible { color:#c4b5fd; border:0; }
 .site-header .desktop-header-search {
   grid-column:3;
   justify-self:end;
   display:flex!important;
   flex:none;
   width:100%;
   max-width:230px;
   min-width:0;
   height:40px;
   margin:0;
   overflow:hidden;
   background:#101625;
   border:1px solid #26314a;
   border-radius:8px;
 }
 .site-header .desktop-header-search input {
   flex:1 1 auto;
   width:0;
   min-width:0;
   height:38px;
   padding:0 11px;
   color:#f8fafc;
   background:transparent;
   font-size:13px;
 }
 .site-header .desktop-header-search input::placeholder { color:#9ca3af; }
 .site-header .desktop-header-search button {
   position:relative;
   display:grid;
   place-items:center;
   flex:0 0 38px;
   width:38px;
   min-width:38px;
   height:38px;
   padding:0;
   color:#f8fafc;
   background:#101625;
   border:0;
   font-size:0;
 }
 .site-header .desktop-header-search button::before {
   width:12px;height:12px;border:1.8px solid currentColor;border-radius:50%;content:"";
 }
 .site-header .desktop-header-search button::after {
   position:absolute;top:23px;left:22px;width:6px;height:1.8px;background:currentColor;content:"";transform:rotate(45deg);transform-origin:left center;
 }
}

/* Final desktop alignment: bounded full-width flex row prevents edge clipping. */
@media (min-width: 1025px) {
 .site-header { width:100%!important; max-width:none!important; overflow:visible!important; background:#050816!important; }
 .site-header .desktop-header-row {
   display:flex!important;
   align-items:center!important;
   justify-content:space-between!important;
   gap:clamp(16px,2vw,32px)!important;
   width:100%!important;
   max-width:1800px!important;
   min-height:82px!important;
   margin:0 auto!important;
   padding:10px clamp(32px,4vw,72px)!important;
   box-sizing:border-box!important;
 }
 .site-header .desktop-header-logo {
   display:flex!important;
   flex:0 0 170px!important;
   align-items:center!important;
   justify-content:flex-start!important;
   width:170px!important;
   min-width:0!important;
   max-width:170px!important;
   overflow:hidden!important;
 }
 .site-header .desktop-header-logo img {
   display:block!important;
   width:auto!important;
   height:auto!important;
   max-width:170px!important;
   max-height:46px!important;
   object-fit:contain!important;
   object-position:left center!important;
 }
 .site-header .desktop-navigation {
   display:flex!important;
   flex:1 1 auto!important;
   align-items:center!important;
   justify-content:center!important;
   gap:clamp(12px,1.55vw,26px)!important;
   width:auto!important;
   min-width:0!important;
   max-width:none!important;
   margin:0!important;
   padding:0!important;
   overflow:visible!important;
   white-space:nowrap!important;
 }
 .site-header .desktop-navigation a {
   display:inline-flex!important;
   flex:0 0 auto!important;
   align-items:center!important;
   min-height:50px!important;
   padding:0!important;
   color:#f3f4f6!important;
   font-size:clamp(12px,.9vw,15px)!important;
   font-weight:700!important;
   letter-spacing:.02em!important;
   white-space:nowrap!important;
   text-transform:uppercase!important;
 }
 .site-header .desktop-navigation a:hover,
 .site-header .desktop-navigation a:focus-visible { color:#c4b5fd!important; }
 .site-header .desktop-header-search {
   display:flex!important;
   flex:0 0 230px!important;
   align-items:center!important;
   width:230px!important;
   min-width:0!important;
   max-width:230px!important;
   height:42px!important;
   margin:0!important;
   overflow:hidden!important;
   background:#101625!important;
   border:1px solid #26314a!important;
   border-radius:8px!important;
 }
 .site-header .desktop-header-search input {
   flex:1 1 auto!important;
   width:0!important;
   min-width:0!important;
   height:40px!important;
   padding:0 12px!important;
   color:#f8fafc!important;
   background:transparent!important;
   font-size:13px!important;
 }
 .site-header .desktop-header-search button {
   position:relative!important;
   display:grid!important;
   flex:0 0 40px!important;
   place-items:center!important;
   width:40px!important;
   min-width:40px!important;
   height:40px!important;
   padding:0!important;
   color:#f8fafc!important;
   background:#101625!important;
   border:0!important;
   font-size:0!important;
 }
 .site-header .desktop-header-search button:before { width:12px;height:12px;border:1.8px solid currentColor;border-radius:50%;content:""; }
 .site-header .desktop-header-search button:after { position:absolute;top:24px;left:23px;width:6px;height:1.8px;background:currentColor;content:"";transform:rotate(45deg);transform-origin:left center; }
}
