/* ============================================================
   SL Header — TaylorMade VN
   ============================================================ */

/* ── Promo bar ────────────────────────────────────────────── */
.sl-promo-bar {
    position: relative;
    background: #15472A;
    color: #fff;
    text-align: center;
    padding: 2px 48px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: "Be Vietnam Pro", sans-serif;
}

.sl-promo-track {
    position: relative;
    width: 100%;
    height: 52px;
}

.sl-promo-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease;
    padding: 10px 16px;
}

.sl-promo-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.sl-promo-title {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    letter-spacing: .01em;
}

.sl-promo-link {
    font-size: 13px;
    font-weight: 400;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity .15s;
}

.sl-promo-link:hover { opacity: .75; }

.sl-promo-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
    z-index: 2;
}

.sl-promo-btn:hover { color: #fff; }

.sl-promo-prev { left: 4px; }
.sl-promo-next { right: 4px; }

@media (max-width: 767px) {
    .sl-promo-bar { padding: 0 40px; }
    .sl-promo-title,
    .sl-promo-link { font-size: 12px; }
}

:root {
    --sl-hdr-h        : 64px;
    --sl-hdr-bg       : #fff;
    --sl-hdr-border   : #e8e8e8;
    --sl-hdr-text     : #1a1a1a;
    --sl-hdr-muted    : #666;
    --sl-hdr-red      : #cc0000;
    --sl-mega-left-w  : 220px;
    --sl-mega-max-h   : 480px;
}

/* ── Reset & base ─────────────────────────────────────────── */
.sl-header *,
.sl-header *::before,
.sl-header *::after { box-sizing: border-box; }

.sl-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: var(--sl-hdr-bg);
    font-family: "Be Vietnam Pro", sans-serif;
}

/* ── Main bar ─────────────────────────────────────────────── */
.sl-header-bar {
    display: flex;
    align-items: center;
    height: var(--sl-hdr-h);
    padding: 0 24px;
    gap: 16px;
}

/* ── Left ─────────────────────────────────────────────────── */
.sl-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

/* Hamburger */
.sl-hamburger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: none !important;
    border: none;
    cursor: pointer;
    padding: 0;
    height: var(--sl-hdr-h);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    color: var(--sl-hdr-text);
}

.sl-hamburger:hover,
.sl-hamburger:focus,
.sl-hamburger:focus-visible,
.sl-hamburger:active {
    background: none !important;
    color: var(--sl-hdr-text) !important;
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.sl-hamburger span:not(.sl-hamburger-label) {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform .25s ease, opacity .25s ease;
}

.sl-hamburger span:nth-child(2) { margin: 5px 0; }

.sl-hamburger-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-top: 4px;
    line-height: 1;
}

/* Hamburger → X when mega open */
.sl-mega-open .sl-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sl-mega-open .sl-hamburger span:nth-child(2) { opacity: 0; }
.sl-mega-open .sl-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Logo */
.sl-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.sl-logo-link img,
.sl-logo-link .custom-logo {
    display: block;
    height: 28px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.sl-logo-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--sl-hdr-text);
    letter-spacing: -.02em;
}

/* ── Center: search ───────────────────────────────────────── */
.sl-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 560px;
    margin: 0 auto;
}

.sl-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    background: #fff;
    border: 1px solid var(--sl-hdr-border);
    border-radius: 100px;
    padding: 0 16px;
    gap: 8px;
    transition: box-shadow .15s;
}

.sl-search-form:focus-within {
    box-shadow: 0 0 0 2px rgba(0,0,0,.12);
}

.sl-search-icon { flex-shrink: 0; color: var(--sl-hdr-muted); }

.sl-search-input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: "Be Vietnam Pro", sans-serif;
    font-size: 13px;
    color: var(--sl-hdr-text);
    padding: 10px 0;
    min-width: 0;
    -webkit-appearance: none;
}

.sl-search-input::placeholder { color: #999; }

/* ── Right: account + cart ────────────────────────────────── */
.sl-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sl-header-account {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--sl-hdr-text);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 4px;
    transition: color .15s;
}

.sl-header-account:hover { color: var(--sl-hdr-red); }

.sl-header-account-label {
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sl-header-cart {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--sl-hdr-text);
    padding: 6px 8px;
    border-radius: 4px;
    transition: color .15s;
}

.sl-header-cart:hover { color: var(--sl-hdr-red); }

.sl-cart-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    background: var(--sl-hdr-text);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    transition: background .15s;
}

.sl-header-cart:hover .sl-cart-count { background: var(--sl-hdr-red); }

/* ── Mobile search row ────────────────────────────────────── */
.sl-search-row {
    display: none;
    padding: 8px 16px 10px;
    border-top: 1px solid var(--sl-hdr-border);
}

.sl-search-form--mobile { max-width: 100%; }

/* ── Mega menu ────────────────────────────────────────────── */
.sl-mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    z-index: 100;
}

.sl-mega-open .sl-mega {
    max-height: var(--sl-mega-max-h);
}

.sl-mega-inner {
    display: flex;
    max-height: var(--sl-mega-max-h);
}

/* Left: category nav */
.sl-mega-nav {
    flex-shrink: 0;
    width: var(--sl-mega-left-w);
    background: #f7f7f7;
    border-right: 1px solid var(--sl-hdr-border);
    list-style: none;
    margin: 0;
    padding: 12px 0;
    overflow-y: auto;
}

.sl-mega-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: "Be Vietnam Pro", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--sl-hdr-text);
    text-align: left;
    text-decoration: none;
    transition: background .12s, color .12s;
}

.sl-mega-tab:focus { outline: none; }
.sl-mega-tab:hover { background: #ebebeb; color: var(--sl-hdr-red); }

.sl-mega-tab.is-active {
    background: var(--sl-hdr-text);
    color: #fff;
}

.sl-mega-tab.is-active svg { stroke: #fff; }

.sl-mega-tab--direct svg { display: none; }

/* Right: panels */
.sl-mega-panels {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.sl-mega-panel {
    display: none;
    height: 100%;
}

.sl-mega-panel.is-active { display: flex; }

.sl-mega-panel-inner {
    display: flex;
    gap: 0;
    width: 100%;
    height: 100%;
}

/* Subcategory grid */
.sl-mega-subs {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 2px;
    padding: 20px 24px;
}

.sl-mega-sub {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    text-decoration: none;
    color: var(--sl-hdr-text);
    border-radius: 4px;
    transition: background .12s;
    width: calc(20% - 2px);
    min-width: 100px;
    text-align: center;
}

.sl-mega-sub:hover { background: #f5f5f5; color: var(--sl-hdr-red); }

.sl-mega-sub--all {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sl-hdr-red);
    padding: 8px 2px;
    margin-bottom: 8px;
    border-radius: 0;
    border-bottom: 1px solid var(--sl-hdr-border);
}

.sl-mega-sub--all:hover { background: transparent; color: #a80000; }

.sl-mega-sub-img {
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: 4px;
    background: #f0f0f0;
    flex-shrink: 0;
}

.sl-mega-sub-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sl-mega-sub-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* Featured image (right side of panel) */
.sl-mega-feature {
    flex-shrink: 0;
    width: 200px;
    display: block;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
}

.sl-mega-feature img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.sl-mega-feature:hover img { transform: scale(1.04); }

/* ── Backdrop — outside <header>, below header z-index ────── */
.sl-mega-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 9998; /* below header (9999) so mega menu is never covered */
}

body.sl-mega-body-open .sl-mega-backdrop { display: block; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1023px) {
    .sl-header-account-label,
    .sl-header-account svg ~ * { display: none; }

    .sl-header-center { display: none; }

    .sl-search-row { display: block; }

    .sl-hamburger-label { display: none; }

    .sl-header-bar { padding: 0 16px; }

    .sl-mega-left-w { --sl-mega-left-w: 180px; }
}

@media (max-width: 767px) {
    :root { --sl-hdr-h: 54px; }

    .sl-header-left { gap: 12px; }

    .sl-logo-link img,
    .sl-logo-link .custom-logo { height: 22px; }

    .sl-mega-inner { flex-direction: column; }

    .sl-mega-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--sl-hdr-border);
        display: flex;
        flex-wrap: wrap;
        padding: 8px;
        gap: 4px;
    }

    .sl-mega-tab {
        width: auto;
        flex: 0 0 auto;
        padding: 8px 14px;
        border-radius: 100px;
        border: 1px solid var(--sl-hdr-border);
        font-size: 12px;
    }

    .sl-mega-tab.is-active {
        background: var(--sl-hdr-text);
        border-color: var(--sl-hdr-text);
    }

    .sl-mega-tab svg { display: none; }

    .sl-mega-subs { padding: 12px 16px; }

    .sl-mega-sub {
        width: calc(33.333% - 2px);
        min-width: 80px;
    }

    .sl-mega-sub-img { width: 56px; height: 56px; }

    .sl-mega-feature { display: none; }
}
