/*
 * ASL Phase 1 enhancements
 * Fulfillment details (MOQ + lead time), nav "NEW" badge, and light
 * merchandising polish. Reuses existing design tokens where present and
 * degrades gracefully with sensible fallbacks.
 */

:root {
    --asl-primary: var(--asl-primary, #1a1a1a);
    --asl-accent: var(--asl-accent, #b8860b);
    --asl-muted: #6b6b6b;
    --asl-radius: var(--asl-radius, 6px);
}

/* ---------------------------------------------------------------------------
 * Fulfillment details (MOQ + lead time)
 * ------------------------------------------------------------------------- */
.asl-fulfillment-details {
    list-style: none;
    margin: 12px 0 16px;
    padding: 12px 14px;
    border: 1px solid #e5e5e5;
    border-radius: var(--asl-radius);
    background: #fafafa;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
}

.asl-fulfillment-details .asl-fd {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.asl-fulfillment-details .asl-fd__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--asl-muted);
}

.asl-fulfillment-details .asl-fd__value {
    font-size: 15px;
    font-weight: 600;
    color: var(--asl-primary);
}

/* Dark backgrounds (e.g. Quick Ship hero) */
.asl-fulfillment-details.on-dark {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.asl-fulfillment-details.on-dark .asl-fd__label {
    color: rgba(255, 255, 255, 0.7);
}

.asl-fulfillment-details.on-dark .asl-fd__value {
    color: #fff;
}

/* ---------------------------------------------------------------------------
 * "NEW" badge on menu items flagged with the `new-item` class
 * ------------------------------------------------------------------------- */
.new-badge {
    display: inline-block;
    margin-right: 5px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: var(--asl-accent);
    border-radius: 3px;
    vertical-align: middle;
}

/* ---------------------------------------------------------------------------
 * Light merchandising polish: de-emphasize the Legacy top-level entry
 * ------------------------------------------------------------------------- */
.sf-menu > li.legacy-item > a,
.menu__box > li.legacy-item > a {
    opacity: 0.7;
}

.sf-menu > li.legacy-item > a:hover,
.menu__box > li.legacy-item > a:hover {
    opacity: 1;
}

/* Keep Legacy de-emphasized once it's tucked inside the "More" dropdown */
.asl-more__menu > li.legacy-item > a {
    opacity: 0.7;
}
.asl-more__menu > li.legacy-item > a:hover {
    opacity: 1;
}

/* ---------------------------------------------------------------------------
 * Desktop nav overflow: collapse items after "Outdoor" into a hamburger
 * dropdown so the primary header stays on one line. The "More" item is
 * injected by assets/js/asl-nav-overflow.js into ul#menu-primary
 * (.multi-dropdown.main-menu) at desktop widths only.
 * ------------------------------------------------------------------------- */
/* Scoped under .site-header .multi-dropdown so these win over the theme's
 * `.site-header .multi-dropdown > li > a` rules (same base specificity). */
.site-header .multi-dropdown > li.asl-more,
li.asl-more {
    position: relative;
    list-style: none;
    vertical-align: middle;
}

.site-header .multi-dropdown > li.asl-more > a.asl-more__toggle,
li.asl-more > .asl-more__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Match the vertical padding of sibling links (22px 23px) so the button
     * is the same height and shares their baseline. */
    padding: 22px 20px;
}

/* Suppress any inherited "has-children" caret on the hamburger toggle */
li.asl-more > .asl-more__toggle::after,
li.asl-more > .asl-more__toggle::before {
    display: none !important;
    content: none !important;
}

/* Three-bar hamburger glyph, drawn in the current link color. The 7px vertical
 * margins give the glyph a ~16px flow box so the toggle sizes like a text link. */
.asl-more__bars {
    position: relative;
    display: block;
    width: 22px;
    height: 2px;
    margin: 7px 0;
    background: currentColor;
    border-radius: 2px;
}
.asl-more__bars::before,
.asl-more__bars::after {
    position: absolute;
    left: 0;
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    content: '';
}
.asl-more__bars::before {
    top: -7px;
}
.asl-more__bars::after {
    top: 7px;
}

ul.asl-more__menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 190px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: var(--asl-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 999;
    display: none;
}

/* Open only on click (via .is-open); never on hover */
li.asl-more.is-open > ul.asl-more__menu {
    display: block !important;
}

ul.asl-more__menu > li {
    display: block;
    float: none;
    width: auto;
    margin: 0;
}
ul.asl-more__menu > li > a {
    display: block;
    padding: 8px 18px;
    white-space: nowrap;
    color: var(--asl-primary);
}
ul.asl-more__menu > li > a:hover {
    background: #f5f5f5;
}

/* ---------------------------------------------------------------------------
 * ASL Navigation V1 mega panels
 * Full-width intro row followed by a horizontally scrollable category strip.
 * Desktop only; the theme's mobile accordion remains unchanged.
 * ------------------------------------------------------------------------- */
.asl-mega-thumb,
.asl-mega-shop {
    display: none;
}
.site-header .multi-dropdown li.asl-mega-intro-item {
    display: none;
}

@media screen and (min-width: 768px) {
    /* Use the full-width header as the positioning context so every category
     * opens the panel in the same centered location. */
    .site-header .main-header {
        position: relative;
    }
    .site-header .main-nav,
    .site-header .multi-dropdown > li.asl-mega-parent {
        position: static;
    }

    .site-header .multi-dropdown > li.asl-mega-parent > ul {
        display: grid;
        grid-template-columns: repeat(5, minmax(240px, 1fr));
        grid-template-rows: auto auto;
        grid-auto-columns: 240px;
        column-gap: 0;
        row-gap: 30px;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: min(100vw, 1440px);
        max-width: none;
        margin: 0;
        padding: 40px 60px 42px;
        box-sizing: border-box;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: normal;
        background: var(--header-bg, #fff);
        border: 0;
        border-bottom: 2px solid #e6e5e5;
        box-shadow: 0 20px 20px rgba(0, 0, 0, 0.05);
        scrollbar-width: thin;
        scrollbar-color: #b8b8b8 transparent;
    }

    .site-header .multi-dropdown > li.asl-mega-parent > ul::-webkit-scrollbar {
        height: 6px;
    }
    .site-header .multi-dropdown > li.asl-mega-parent > ul::-webkit-scrollbar-thumb {
        background: #b8b8b8;
        border-radius: 999px;
    }

    .site-header .multi-dropdown > li.asl-mega-parent > ul > li.asl-mega-intro-item {
        display: block;
        grid-column: 1 / 6;
        grid-row: 1;
        width: auto;
        margin: 0;
        padding: 0;
        border: 0;
        white-space: normal;
    }

    .asl-mega-intro {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title title"
            "description cta";
        align-items: center;
        column-gap: 48px;
        row-gap: 20px;
    }

    .asl-mega-intro-eyebrow {
        grid-area: title;
        display: block;
        font-family: var(--header-font, "Lexend Deca", Georgia, serif);
        font-size: 32px;
        font-weight: 400;
        line-height: 1.2;
        letter-spacing: -0.02em;
        text-transform: none;
        color: #111;
    }

    .asl-mega-intro-desc {
        grid-area: description;
        max-width: 700px;
        margin: 0;
        font-size: 16px;
        line-height: 1.65;
        color: var(--text-color, #333);
    }

    .asl-mega-intro-cta {
        grid-area: cta;
        justify-self: end;
    }

    .site-header .multi-dropdown .asl-mega-intro-cta.button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 220px;
        padding: 17px 20px 16px;
        font-size: 16px;
        font-weight: 500;
        line-height: 1.1;
        text-align: center;
        text-decoration: none;
        background: #004fff;
        color: #fff;
        border: 2px solid #004fff;
        border-radius: 12px;
    }

    .site-header .multi-dropdown .asl-mega-intro-cta.button:hover,
    .site-header .multi-dropdown .asl-mega-intro-cta.button:focus {
        background: #fff;
        color: #004fff;
        border-color: #004fff;
    }

    .site-header .multi-dropdown > li.asl-mega-parent > ul > li.asl-mega-child:not(.asl-mega-intro-item) {
        display: block;
        grid-row: 2;
        vertical-align: top;
        width: auto;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
        box-sizing: border-box;
        white-space: normal;
    }

    .site-header .multi-dropdown > li.asl-mega-parent > ul > li.asl-mega-child:not(.asl-mega-intro-item) > a {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        min-height: 292px;
        padding: 24px 32px;
        box-sizing: border-box;
        border: 0;
        border-radius: 0;
        color: #111;
        text-align: left;
        white-space: normal;
        transition: background-color .18s ease, color .18s ease;
    }

    .site-header .multi-dropdown > li.asl-mega-parent > ul > li.asl-mega-child:not(.asl-mega-intro-item) > a:after {
        content: none;
    }

    .asl-mega-thumb {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 170px;
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background: #fff;
    }

    .asl-mega-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .asl-mega-label {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        min-width: 0;
    }

    .asl-mega-label-title {
        display: block;
        font-family: var(--header-font, "Lexend Deca", Georgia, serif);
        font-size: 21px;
        font-weight: 400;
        line-height: 1.25;
        color: inherit;
    }

    .asl-mega-shop {
        display: block;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.4;
        color: #111;
    }

    .asl-mega-shop [aria-hidden="true"] {
        margin-left: 8px;
        font-size: 22px;
        line-height: 0;
        color: var(--primary-color, #0047FF);
        vertical-align: -1px;
    }

    .site-header .multi-dropdown > li.asl-mega-parent > ul > li.asl-mega-child:not(.asl-mega-intro-item) > a:hover,
    .site-header .multi-dropdown > li.asl-mega-parent > ul > li.asl-mega-child:not(.asl-mega-intro-item) > a:focus {
        background: var(--hover-bg, #f8f8f8);
        color: var(--primary-color, #0047FF);
    }

    .site-header .multi-dropdown > li.asl-mega-parent > ul > li.asl-mega-child:not(.asl-mega-intro-item) > a:hover .asl-mega-shop,
    .site-header .multi-dropdown > li.asl-mega-parent > ul > li.asl-mega-child:not(.asl-mega-intro-item) > a:focus .asl-mega-shop {
        color: #111;
    }
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
    .site-header .multi-dropdown > li.asl-mega-parent > ul {
        padding-right: 32px;
        padding-left: 32px;
    }
    .asl-mega-intro {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "description"
            "cta";
        row-gap: 16px;
    }
    .asl-mega-intro-cta {
        justify-self: start;
    }
}


/* Product page: labeled "Download Documents" button (was an unlabeled PDF icon). */
.product-downloads .trigger-btn.asl-download-docs-btn {
    width: auto;
    min-width: 56px;
    padding: 0 18px;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.product-downloads .trigger-btn.asl-download-docs-btn .asl-download-docs-label {
    color: #fff;
}
@media (max-width: 480px) {
    .product-downloads .trigger-btn.asl-download-docs-btn {
        padding: 0 12px;
        font-size: 14px;
    }
}
