/* =========================================================================
 * HIDDEN FOR NOW — remove this one rule to bring the block back.
 *
 * Alp asked for the row of make buttons to come off the archive; a mega menu
 * is expected to carry the navigation later. Hidden rather than switched off
 * in PHP so that nothing else changes: the sitemap builds its make list from
 * the same file that renders this block, and the markup keeps rendering, so
 * the links to the make, model and chassis pages are still in the HTML for
 * crawlers even though no visitor sees them.
 *
 * Worth knowing: hiding links rather than removing them is the reason to
 * treat this as temporary. Google discounts content it can see is hidden, and
 * a large block of keyword-rich internal links that only a crawler ever sees
 * is a pattern worth not leaving in place indefinitely. Fine while the mega
 * menu is being built; not something to forget about.
 * ====================================================================== */


/**
 * [auction_links] — the "Browse by make" grid.
 *
 * Collapsed, the toggle is always the final cell, at every screen size:
 *
 *   desktop  7 columns   6 links + toggle   one row
 *   tablet   3 columns   5 links + toggle   two rows
 *   mobile   2 columns   3 links + toggle   two rows
 *
 * A fixed column count rather than auto-fill is what makes that predictable.
 * The per-breakpoint caps are CSS only, so the extras stay in the HTML and
 * Google sees every link whether or not the toggle is ever pressed.
 */

.alps-links {
    margin: 0 0 16px;
}

.alps-links-head {
    margin: 0 0 0px;
}

.alps-links-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.25em;
    font-weight: 700;
    color: var(--e-global-color-secondary, #14171a);
}

.alps-links-sub {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.5em;
    color: #6b7280;
}

/* ---------------------------------------------------------------- grid --- */

.alps-links-grid {
    display: none;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.alps-links-grid > li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.alps-links-grid > li::before,
.alps-links-grid > li::marker {
    content: none;
}

.alps-links-grid a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
    height: 100%;
    padding: 10px 10px;
    border: 1px solid #e7e9ec;
    border-radius: 8px;
    background: #eeeeee;
    color: var(--e-global-color-secondary, #14171a);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3em;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.alps-links-grid a:hover,
.alps-links-grid a:focus-visible {
    border-color: var(--e-global-color-primary, #c8102e);
    box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.35);
}

/* Long names must never break the fixed column layout. */
.alps-links-grid a .t {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alps-links-grid .n {
    flex: none;
    font-size: 12.5px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 9px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.alps-links-grid a:hover .n {
    background: rgba(200, 16, 46, 0.09);
    color: var(--e-global-color-primary, #c8102e);
}

/* -------------------------------------------------------- visible caps --- */

/*
 * Two independent limits, both CSS only:
 *   .is-extra      comes from the setting, applied server-side
 *   :nth-child     caps the row count at each breakpoint
 * The toggle is excluded from both so it always stays as the final cell.
 */
.alps-links:not(.is-open) .alps-links-grid > li.is-extra {
    display: none;
}

.alps-links:not(.is-open) .alps-links-grid > li:not(.alps-links-more):nth-child(n + 7) {
    display: none;
}

/* ------------------------------------------------------------- toggle --- */

/*
 * High specificity with !important on the visual properties: the theme styles
 * bare <button> elements as solid red pills, the same treatment as "Clear All",
 * and beats a single class. All of it is scoped inside .alps-links so none can
 * leak onto anything else.
 */
.alps-links .alps-links-grid li.alps-links-more {
    display: block;
    margin: 0;
}

.alps-links .alps-links-grid li.alps-links-more > button.alps-links-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    width: 100% !important;
    height: 100%;
    min-height: 0;
    margin: 0 !important;
    padding: 10px 10px !important;
    border: 1px solid #e7e9ec !important;
    border-radius: 8px !important;
    background: #f9f9f9 !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--e-global-color-primary, #c8102e) !important;
    cursor: pointer;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.3em !important;
    letter-spacing: normal !important;
    text-align: left !important;
    text-transform: none !important;
    text-decoration: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.alps-links .alps-links-grid li.alps-links-more > button.alps-links-toggle:hover,
.alps-links .alps-links-grid li.alps-links-more > button.alps-links-toggle:focus-visible {
    background: #f9f9f9 !important;
    color: var(--e-global-color-primary, #c8102e) !important;
    border-color: var(--e-global-color-primary, #c8102e) !important;
    box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.35) !important;
}

/*
 * Themes that animate their own button arrows tend to absolutely position the
 * spans inside a <button>, which drops the chevron on top of the label. Both
 * spans are pinned back into normal flex flow, and any theme pseudo-element
 * arrow is removed so there is only ever one.
 */
.alps-links .alps-links-grid li.alps-links-more > button.alps-links-toggle::before,
.alps-links .alps-links-grid li.alps-links-more > button.alps-links-toggle::after {
    content: none !important;
    display: none !important;
}

.alps-links .alps-links-toggle .txt {
    position: static !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alps-links .alps-links-toggle .chev {
    position: static !important;
    flex: none;
    display: inline-block;
    font-size: 12px;
    color: inherit;
    transform-origin: center;
    transition: transform 0.2s ease;
}

.alps-links.is-open .alps-links-toggle .chev {
    transform: rotate(180deg);
}

/* --------------------------------------------------------- breakpoints --- */

@media (max-width: 1024px) {
    .alps-links-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* 5 links + toggle = two rows of three */
    .alps-links:not(.is-open) .alps-links-grid > li:not(.alps-links-more):nth-child(n + 6) {
        display: none;
    }
}

@media (max-width: 767px) {
    .alps-links {
        margin: 0 0 26px;
    }

    .alps-links-title {
        font-size: 18px;
    }

    .alps-links-sub {
        font-size: 13px;
    }

    .alps-links-head {
        margin: 0 0 12px;
    }

    .alps-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    /* 3 links + toggle = two rows of two */
    .alps-links:not(.is-open) .alps-links-grid > li:not(.alps-links-more):nth-child(n + 4) {
        display: none;
    }

    .alps-links-grid a {
        padding: 8px 8px;
        font-size: 14px;
        gap: 5px;
    }

    .alps-links-grid .n {
        font-size: 11px;
        padding: 2px 7px;
    }

    .alps-links .alps-links-grid li.alps-links-more > button.alps-links-toggle {
        padding: 8px 8px !important;
        font-size: 13.5px !important;
        gap: 5px;
    }
}

@media (max-width: 380px) {
    .alps-links-grid a {
        padding: 7px 7px;
        font-size: 13px;
    }

    .alps-links .alps-links-grid li.alps-links-more > button.alps-links-toggle {
        padding: 7px 7px !important;
        font-size: 12.5px !important;
    }
}