/* ==========================================================
   Got Hot Wheels Header/Footer UI Overhaul v5
   Clean account dropdown, no menu overlap, mobile-first nav
   ========================================================== */

:root {
    --ghwV5-black: #050505;
    --ghwV5-panel: #0b0f15;
    --ghwV5-panel2: #111822;
    --ghwV5-red: #f20e1a;
    --ghwV5-red2: #bd050d;
    --ghwV5-orange: #ff9d00;
    --ghwV5-yellow: #ffd239;
    --ghwV5-text: #ffffff;
    --ghwV5-muted: #b9c2ce;
    --ghwV5-line: rgba(255,255,255,.12);
    --ghwV5-glowRed: 0 0 22px rgba(242,14,26,.45);
    --ghwV5-glowOrange: 0 0 22px rgba(255,157,0,.33);
}

html,
body {
    max-width: 100%;
    overflow-x: hidden !important;
}

body.ghwV5-body {
    margin: 0;
    background: #050505;
    color: #fff;
}

.ghwV5-wrap {
    width: min(1420px, calc(100% - 48px));
    margin-inline: auto;
}

/* Force old header variants out of the way if an older patch left duplicate markup */
body > .ghw-topbar,
body > .ghw-header,
body > header.ghw-header,
body > .ghw-site-header {
    display: none !important;
}

/* Top bar */
.ghwV5-topbar {
    background: #020202;
    border-bottom: 1px solid rgba(242,14,26,.72);
    min-height: 35px;
    font-size: 13px;
    color: #fff;
}

.ghwV5-topbarInner {
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ghwV5-secure {
    color: #fff;
    white-space: nowrap;
}

.ghwV5-topLinks {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    white-space: nowrap;
}

.ghwV5-topLinks a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.ghwV5-topLinks a:hover {
    color: var(--ghwV5-orange);
}

.ghwV5-topLinks > span {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,.45);
}

.ghwV5-social {
    font-weight: 900 !important;
    min-width: 14px;
    text-align: center;
}

/* Header */
.ghwV5-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: linear-gradient(180deg, rgba(5,5,5,.99), rgba(3,3,3,.97));
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(90deg, var(--ghwV5-red), var(--ghwV5-orange), var(--ghwV5-red)) 1;
    box-shadow: 0 14px 38px rgba(0,0,0,.64);
}

.ghwV5-headerInner {
    min-height: 96px;
    display: grid;
    grid-template-columns: 265px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    position: relative;
}

.ghwV5-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    text-decoration: none;
}

.ghwV5-logo img {
    display: block;
    width: 245px;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255,70,0,.25));
}

.ghwV5-menuPanel {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
}

.ghwV5-mainNav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(13px, 1.45vw, 24px);
    min-width: 0;
    white-space: nowrap;
}

.ghwV5-mainNav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    text-decoration: none;
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: .035em;
    font-size: clamp(13px, .88vw, 16px);
    line-height: 1;
    text-shadow: 1px 1px 0 #000;
}

.ghwV5-mainNav a:hover {
    color: var(--ghwV5-orange);
}

.ghwV5-live {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 19px;
    padding: 0 7px;
    border-radius: 4px;
    background: var(--ghwV5-red);
    color: #fff;
    font-family: system-ui, sans-serif;
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: .03em;
    box-shadow: var(--ghwV5-glowRed);
    animation: ghwV5LiveBlink 1s infinite ease-in-out;
}

@keyframes ghwV5LiveBlink {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 2px rgba(255,0,0,.45)); }
    50% { opacity: .5; filter: drop-shadow(0 0 13px rgba(255,0,0,1)); }
}

.ghwV5-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.ghwV5-search {
    height: 46px;
    width: clamp(190px, 15vw, 270px);
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(120,150,184,.34);
    border-radius: 999px;
    background: #070b11;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
    flex: 0 1 auto;
}

.ghwV5-search input {
    min-width: 0;
    flex: 1;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    padding: 0 0 0 17px;
    font-size: 14px;
}

.ghwV5-search input::placeholder {
    color: #8290a4;
}

.ghwV5-search button {
    width: 48px;
    height: 100%;
    border: 0;
    background: transparent;
    color: #c7d4e6;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.ghwV5-search button:hover {
    color: var(--ghwV5-orange);
}

.ghwV5-login,
.ghwV5-register,
.ghwV5-account > summary {
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 8px;
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    white-space: nowrap;
    cursor: pointer;
}

.ghwV5-login,
.ghwV5-account > summary {
    border: 1px solid var(--ghwV5-orange);
    background: rgba(0,0,0,.34);
    box-shadow: inset 0 0 16px rgba(255,157,0,.08);
}

.ghwV5-register {
    border: 0;
    background: linear-gradient(180deg, #ff2630, #c90610);
    box-shadow: 0 0 20px rgba(242,14,26,.38);
}

.ghwV5-register:hover,
.ghwV5-login:hover,
.ghwV5-account > summary:hover {
    transform: translateY(-1px);
    color: #fff;
}

.ghwV5-account {
    position: relative;
    z-index: 10000;
}

.ghwV5-account > summary {
    list-style: none;
}

.ghwV5-account > summary::-webkit-details-marker {
    display: none;
}

.ghwV5-account > summary::after {
    content: "";
    width: 0;
    height: 0;
    margin-left: 10px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
}

.ghwV5-account[open] > summary::after {
    border-top: 0;
    border-bottom: 6px solid #fff;
}

.ghwV5-accountMenu {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    min-width: 230px;
    padding: 10px;
    border-radius: 12px;
    background: linear-gradient(180deg, #111822, #05070a);
    border: 1px solid rgba(255,157,0,.42);
    box-shadow: 0 20px 50px rgba(0,0,0,.65), 0 0 24px rgba(237,17,28,.20);
}

.ghwV5-accountMenu::before {
    content: "";
    position: absolute;
    right: 25px;
    top: -8px;
    width: 14px;
    height: 14px;
    background: #111822;
    border-left: 1px solid rgba(255,157,0,.42);
    border-top: 1px solid rgba(255,157,0,.42);
    transform: rotate(45deg);
}

.ghwV5-accountMenu a,
.ghwV5-accountMenu button {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: transparent;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.ghwV5-accountMenu a:hover,
.ghwV5-accountMenu button:hover {
    background: rgba(255,157,0,.11);
    color: var(--ghwV5-orange);
}

.ghwV5-accountMenu form {
    margin: 6px 0 0;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.ghwV5-accountMenu button {
    background: linear-gradient(180deg, #ff2630, #c90610);
    justify-content: center;
    text-transform: uppercase;
    box-shadow: 0 0 16px rgba(242,14,26,.28);
}

.ghwV5-menuCheck,
.ghwV5-menuBtn {
    display: none;
}

.ghwV5-alert {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 800;
}

.ghwV5-alertSuccess {
    background: #10391f;
    border: 1px solid #29c263;
    color: #dfffea;
}

.ghwV5-alertError {
    background: #3b080c;
    border: 1px solid #ed111c;
    color: #fff;
}

/* Hero button tag/icon cleanup from older homepage markup */
.ghw-hero .ghw-btn-outline .ghw-sell-tag,
.ghw-hero-buttons .ghw-btn-outline .ghw-sell-tag,
.ghw-hero .ghw-btn-outline svg,
.ghw-hero-buttons .ghw-btn-outline svg,
.ghw-hero .ghw-btn-outline i,
.ghw-hero-buttons .ghw-btn-outline i {
    display: none !important;
}

.ghw-hero .ghw-btn-outline::after,
.ghw-hero-buttons .ghw-btn-outline::after {
    content: "›" !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    margin-left: 14px !important;
    border: 2px solid currentColor !important;
    border-radius: 50% !important;
    font-family: Arial, sans-serif !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

/* Footer */
.ghwV5-footer {
    background: #050505;
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 48px 0 24px;
    color: #fff;
}

.ghwV5-footerGrid {
    display: grid;
    grid-template-columns: 1.4fr .9fr .9fr .9fr 1.25fr;
    gap: 40px;
    align-items: start;
}

.ghwV5-footer img {
    display: block;
    width: 230px;
    max-width: 100%;
    height: auto;
}

.ghwV5-footer p,
.ghwV5-footer small,
.ghwV5-footer a,
.ghwV5-footer strong,
.ghwV5-footer span {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ghwV5-footer p {
    margin: 16px 0 6px;
    color: #c3cad6;
    line-height: 1.55;
}

.ghwV5-footer strong {
    color: #fff;
}

.ghwV5-footer h4 {
    margin: 0 0 14px;
    color: #fff;
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 19px;
}

.ghwV5-footer a {
    display: block;
    color: #fff;
    text-decoration: none;
    margin-bottom: 9px;
    font-weight: 650;
}

.ghwV5-footer a:hover {
    color: var(--ghwV5-orange);
}

.ghwV5-footerSocials {
    display: flex;
    gap: 16px;
    margin-top: 18px;
}

.ghwV5-footerSocials a {
    margin: 0;
    font-weight: 900;
}

.ghwV5-newsletter form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.ghwV5-newsletter input {
    width: 100%;
    height: 47px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,.28);
    background: #090909;
    color: #fff;
    padding: 0 14px;
}

.ghwV5-newsletter button {
    height: 48px;
    border: 0;
    border-radius: 5px;
    background: linear-gradient(180deg, #ff2630, #c90610);
    color: #fff;
    font-weight: 1000;
    text-transform: uppercase;
    cursor: pointer;
}

.ghwV5-newsletter small {
    display: block;
    margin-top: 10px;
    color: #57f27d;
}

.ghwV5-footerBottom {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: #aeb7c5;
    font-size: 13px;
}

/* Desktop compacting */
@media (max-width: 1350px) {
    .ghwV5-wrap {
        width: min(100% - 34px, 1240px);
    }

    .ghwV5-headerInner {
        grid-template-columns: 225px minmax(0, 1fr);
        gap: 14px;
    }

    .ghwV5-logo img {
        width: 215px;
    }

    .ghwV5-menuPanel {
        gap: 14px;
    }

    .ghwV5-mainNav {
        gap: 14px;
    }

    .ghwV5-search {
        display: none;
    }
}

@media (max-width: 1060px) {
    .ghwV5-topbarInner {
        justify-content: center;
    }

    .ghwV5-topLinks {
        display: none;
    }

    .ghwV5-headerInner {
        min-height: 82px;
        grid-template-columns: auto auto;
        justify-content: space-between;
    }

    .ghwV5-logo img {
        width: 220px;
    }

    .ghwV5-menuBtn {
        display: inline-grid;
        grid-template-columns: 24px auto;
        align-items: center;
        gap: 10px;
        min-height: 44px;
        padding: 0 14px;
        border-radius: 8px;
        border: 1px solid var(--ghwV5-orange);
        color: #fff;
        background: rgba(0,0,0,.35);
        font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', system-ui, sans-serif;
        text-transform: uppercase;
        letter-spacing: .04em;
        cursor: pointer;
    }

    .ghwV5-menuBtn span {
        grid-column: 1;
        width: 24px;
        height: 2px;
        background: #fff;
        display: block;
        margin: 2px 0;
    }

    .ghwV5-menuBtn strong {
        grid-column: 2;
        grid-row: 1 / span 3;
        font-size: 15px;
    }

    .ghwV5-menuPanel {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 18px;
        border: 1px solid rgba(255,157,0,.35);
        border-top: 0;
        background: linear-gradient(180deg, #090d13, #050505);
        box-shadow: 0 22px 48px rgba(0,0,0,.70);
    }

    .ghwV5-menuCheck:checked ~ .ghwV5-menuPanel {
        display: grid;
    }

    .ghwV5-mainNav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .ghwV5-mainNav a {
        justify-content: center;
        min-height: 44px;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,.12);
        background: rgba(255,255,255,.045);
        font-size: 14px;
    }

    .ghwV5-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ghwV5-search {
        display: flex;
        width: 100%;
        max-width: none;
    }

    .ghwV5-login,
    .ghwV5-register,
    .ghwV5-account > summary {
        width: 100%;
    }

    .ghwV5-accountMenu {
        position: static;
        margin-top: 10px;
    }

    .ghwV5-accountMenu::before {
        display: none;
    }

    .ghwV5-footerGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ghwV5-footerBottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 620px) {
    .ghwV5-wrap {
        width: min(100% - 22px, 100%);
    }

    .ghwV5-headerInner {
        min-height: 76px;
    }

    .ghwV5-logo img {
        width: 188px;
    }

    .ghwV5-menuBtn strong {
        display: none;
    }

    .ghwV5-menuBtn {
        grid-template-columns: 24px;
        padding: 0 12px;
    }

    .ghwV5-mainNav {
        grid-template-columns: 1fr;
    }

    .ghwV5-footerGrid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .ghwV5-footer img {
        width: 210px;
    }
}
