/* wp-content/themes/gtmotor/assets/css/components/explore-bikes.css */
.gtm-explore-section {
    width: 100%;
    overflow: hidden;
    padding: 48px 0 32px;
}

.gtm-explore-header {
    padding: 32px 0 24px;
    margin-bottom: 32px;
    color: #fff;
    border-radius: 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.gtm-explore-brand-logo {
    height: 40px;
    width: auto;
    margin: 0 auto 16px;
    display: block;
}

.gtm-explore-heading {
    font-weight: 900;
    font-size: 48px;
    line-height: 1;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 0.02em;
}

.gtm-explore-filters {
    margin-bottom: 16px;
    text-align: center;
}

/* Mobile-only family dropdown: hidden on desktop (pills are the control). */
.gtm-family-select-wrap {
    display: none;
}

.gtm-filter-pill {
    display: inline-block;
    padding: 0 12px;
    margin: 0;
    text-decoration: none;
    color: #342E37;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 16px;
    line-height: 24px;
    position: relative;
    background: none;
    border: none;
    transition: color 0.2s ease;
}

.gtm-filter-pill:not(:last-child)::after {
    content: "|";
    position: absolute;
    right: -2px;
    top: 0;
    color: #E0E0E0;
    font-weight: 400;
}

.gtm-filter-pill:hover {
    color: #000;
}

.gtm-filter-pill.active {
    color: var(--c-active-brand, #342E37);
}

.gtm-explore-outline-title {
    text-align: center;
    font-weight: 900;
    font-size: 64px;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke-width: 2px;
    margin: 0 0 32px;
    line-height: 1;
}

.gtm-explore-grid-wrapper {
    padding: 0 0 0 32px;
    margin-bottom: 48px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gtm-explore-grid-wrapper::-webkit-scrollbar {
    display: none;
}

.gtm-explore-track {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-columns: 260px;
    gap: 32px 24px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    padding-right: 32px;
}

.gtm-explore-track::after {
    content: "";
    width: 1px;
    grid-row: 1 / -1;
    display: block;
}

.gtm-explore-track.is-sparse {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    padding-right: 0;
}

.gtm-explore-track.is-sparse::after {
    display: none;
}

.gtm-explore-track.is-sparse .gtm-card-simple {
    width: 260px;
    max-width: 100%;
    flex: 0 0 auto;
}

.gtm-card-simple {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.gtm-card-simple:hover .gtm-card-simple-title {
    color: var(--c-active-brand);
}

.gtm-card-simple-media {
    width: 100%;
    aspect-ratio: 6/5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    flex-grow: 0;
    min-height: 0;
}

.gtm-card-simple-media img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* Single-row simple carousels ("You Might Also Like"): pin the media to its
   6/5 box so a tall source image cannot balloon the card. The 2-row grid
   bounds its own rows, so Explore is unaffected. */
.gtm-carousel:not(.gtm-carousel--rows2) .gtm-card-simple-media {
    flex-grow: 0;
    min-height: 0;
    overflow: hidden;
}

.gtm-card-simple-body {
    width: 100%;
    min-width: 0;
}

.gtm-card-simple-title {
    font-weight: 800;
    font-size: 18px;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    min-width: 0;
    padding: 8px 12px 0;
    flex-shrink: 0;
    /* clamp long names to 2 lines with an ellipsis instead of clipping */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gtm-explore-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    padding: 8px 12px;
    margin-top: 16px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    min-width: 140px;
}

.gtm-nav-arrow {
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.gtm-nav-arrow:hover {
    background: #f0f0f0;
}

.gtm-nav-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 1;
    min-width: 0;
    margin: 0 8px;
}

.gtm-dots-mask {
    width: 9rem;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%);
}

.gtm-dots-track {
    display: flex;
    gap: 8px;
    width: max-content;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    margin: 0 auto;
    padding: 0 40px;
}

.gtm-dots-track .dot {
    width: 10px;
    height: 10px;
    background: #ddd;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    transition: background 0.3s;
}

.gtm-dots-track .dot.active {
    background: #000;
}

@media (max-width:767.98px) {
    /* Red header: smaller, tighter, proportional on a phone. Nav arrows are
       hidden below, so the band only carries the logo + heading. */
    .gtm-explore-header {
        padding: 20px 16px 18px;
        margin-bottom: 20px;
        border-radius: 12px 12px 0 0;
    }

    .gtm-explore-brand-logo {
        height: 26px;
        margin-bottom: 10px;
    }

    .gtm-explore-heading {
        font-size: 26px;
        letter-spacing: 0.01em;
    }

    .gtm-explore-filters {
        margin-bottom: 12px;
    }

    .gtm-explore-outline-title {
        font-size: 40px;
        margin-bottom: 16px;
    }

    .gtm-explore-grid-wrapper {
        padding: 0 0 0 16px;
        height: auto;
        min-height: 900px;
        overflow-y: hidden;
        transition: height 0.3s ease;
    }

    .gtm-explore-track {
        padding-right: 16px;
        grid-auto-flow: row;
        grid-template-rows: auto;
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .gtm-explore-track.is-sparse {
        display: grid;
        grid-template-columns: 1fr;
        padding-right: 16px;
    }

    .gtm-explore-track.is-sparse .gtm-card-simple {
        width: 100%;
    }

    .gtm-card-simple-media {
        width: 100%;
        margin-bottom: 6px;
    }

    .gtm-card-simple-title {
        font-size: 15px;
        padding-top: 4px;
    }

    /* Swap the 11 family pills for the native <select> on phones. */
    #famFilters {
        display: none !important;
    }

    .gtm-family-select-wrap {
        display: block;
        max-width: 420px;
        margin: 0 auto;
    }

    .gtm-family-select {
        display: block;
        width: 100%;
        min-height: 48px;
        padding: 10px 44px 10px 16px;
        font-family: inherit;
        font-size: 16px;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--c-active-brand, #342E37);
        background-color: #fff;
        border: 2px solid var(--c-active-brand, #342E37);
        border-radius: 12px;
        line-height: 1.2;
        cursor: pointer;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }

    /* Chevron drawn as a masked pseudo-element so it follows the brand accent
       (a background-image SVG cannot take a dynamic colour). */
    .gtm-family-select-wrap {
        position: relative;
    }

    .gtm-family-select-wrap::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 16px;
        width: 18px;
        height: 18px;
        transform: translateY(-50%);
        pointer-events: none;
        background-color: var(--c-active-brand, #342E37);
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
    }

    .gtm-family-select:focus-visible {
        outline: 3px solid var(--c-active-brand, #342E37);
        outline-offset: 2px;
    }

    .gtm-filter-toggle {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
        width: 100%;
        border: none;
        background: transparent;
        padding: 8px 0;
    }

    .gtm-filter-toggle .current-filter-label {
        color: var(--c-active-brand);
        font-size: 16px;
        font-weight: 700;
        line-height: 24px;
        text-transform: uppercase;
        text-align: start;
        flex-grow: 1;
        margin-left: 18px;
    }

    .filter-icon-svg {
        width: 18px;
        height: 16px;
        flex-shrink: 0;
        margin-left: auto;
        margin-right: 1rem;
    }

    .gtm-filter-list {
        flex-wrap: wrap;
        margin-top: 10px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 16px;
        padding: 16px;
        gap: 8px;
    }

    .gtm-filter-list .gtm-filter-pill {
        display: block;
        width: 100%;
        text-align: left;
        padding: 8px 16px;
    }

    .gtm-filter-list .gtm-filter-pill::after {
        display: none;
    }
}

.gtm-explore-mask-container {
    position: relative;
    width: 100%;
    --gtm-mask-bg: #FFFFFF;
    z-index: 1;
}

.gtm-explore-mask-container .gtm-explore-grid-wrapper {
    position: relative;
    z-index: 0;
}

.gtm-explore-mask-container::before,
.gtm-explore-mask-container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34px;
    z-index: 20;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gtm-explore-mask-container::after {
    right: 0;
    background: linear-gradient(to left, var(--gtm-mask-bg), rgba(255, 255, 255, 0));
    opacity: 0;
}

.gtm-explore-mask-container.has-overflow::after {
    opacity: 1;
}

.gtm-explore-mask-container::before {
    left: 0;
    background: linear-gradient(to right, var(--gtm-mask-bg), rgba(255, 255, 255, 0));
    opacity: 0;
}

.gtm-explore-mask-container.has-scrolled-left::before {
    opacity: 1;
}

@media (max-width:768px) {

    .gtm-explore-mask-container::before,
    .gtm-explore-mask-container::after {
        width: 40px;
    }

    .gtm-explore-grid-wrapper {
        padding-right: 24px;
    }
}

/* NOTE: the former .gtm-explore-track.is-simple rules were removed — the simple
   "You might also like" scroller now uses the unified .gtm-carousel engine
   (carousel.css owns its sizing). The shared .gtm-explore-* / .gtm-card-simple
   rules below/above stay, as the stock, archive and parts pages still use them. */

.gtm-brand-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gtm-brand-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.gtm-brand-nav-arrow.prev {
    left: 24px;
}

.gtm-brand-nav-arrow.next {
    right: 24px;
}

.gtm-brand-nav-arrow.d-none {
    display: none !important;
}

@media (max-width:768px) {
    /* The header loop arrows overlapped "EXPLORE THE RANGE" on phones. Hide
       them here; the carousel pill nav below the bikes drives navigation and
       the main brand nav still switches brands. */
    .gtm-brand-nav-arrow.prev,
    .gtm-brand-nav-arrow.next {
        display: none;
    }
}

#gtm-explore-header .gtm-explore-brand-logo {
    filter: brightness(0) invert(1);
    -webkit-filter: brightness(0) invert(1);
}

/* advanced filtering */

/* Explorer header uses single source of truth */
.gtm-explore-header{
  border-radius:16px 16px 0 0;
  background: var(--c-active-brand, #342E37);
}
.gtm-explore-outline-title{
  -webkit-text-stroke-color: var(--c-active-brand, #342E37);
}

/* Advanced filter shelf */
.gtm-explore-adv{
  border: 2px solid var(--c-active-brand, #342E37);
  border-radius: 16px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.gtm-explore-adv__summary{
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-weight:700;
  text-transform:uppercase;
}
.gtm-explore-adv__body{ padding-top: 12px; }
.gtm-explore-adv__row{ display:flex; gap:16px; align-items:flex-start; margin-bottom: 12px; }
.gtm-explore-adv__title{ min-width: 90px; font-weight:700; text-transform:uppercase; }
.gtm-explore-adv__controls{ flex:1; }
.gtm-explore-adv__meta{ display:flex; justify-content:space-between; font-size:12px; opacity:.75; margin-top:6px; }
.gtm-explore-adv__conds{ display:flex; gap:12px; flex-wrap:wrap; }

.gtm-pill-check{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:2px solid var(--c-active-brand,#342E37);
  border-radius:96px;
  padding:6px 12px;
  font-weight:700;
  text-transform:uppercase;
}
.gtm-pill-check input{ accent-color: var(--c-active-brand,#342E37); }

.gtm-pill-btn{
  border:2px solid var(--c-active-brand,#342E37);
  border-radius:96px;
  padding:8px 16px;
  font-weight:700;
  text-transform:uppercase;
  background:#fff;
}
.gtm-pill-btn:hover{ background: var(--c-active-brand,#342E37); color:#fff; }

/* --- Logo Bar Close Button --- */
.gtm-logo-bar__item {
    position: relative;
}

.gtm-logo-close {
    position: absolute;
    top: -24px;
    left: 50%;
    /* Start hidden and small */
    transform: translateX(-50%) scale(0.5);
    opacity: 0;
    pointer-events: none;
    
    width: 24px;
    height: 24px;
    background: #333;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Only show when parent is active */
.gtm-logo-bar__item.is-active .gtm-logo-close {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.gtm-logo-close:hover {
    background: #000;
    transform: translateX(-50%) scale(1.2);
}

/* ==========================================================================
   Desktop range selector (>=768px)
   Replaces the pipe-separated text pills with a tidy chip grid: an even,
   grid-aligned set of bordered pill buttons on a light panel. Fixes the ragged
   wrap, weak active state and small hit targets of the old inline list.
   Mobile (<768px) keeps the native <select>; nothing below 768 is touched.
   Markup is unchanged: buttons stay .gtm-filter-pill[data-slug] inside
   #famFilters, so the AJAX brand-loop rebuild and gtm_explore_filter wiring
   keep working exactly as before.
   ========================================================================== */
@media (min-width: 768px) {

    /* Panel: group the whole control as ONE unit, centred and capped so the
       eye scans a tidy block rather than a full-bleed ragged row. The id beats
       the Bootstrap .d-flex/.gap-2 utilities on the same element. */
    #famFilters.gtm-filter-list {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-start !important;
        align-items: stretch;
        gap: 12px !important;
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 0;
        background: none;
        border: none;
        border-radius: 0;
    }

    /* Chip: a real bordered pill button. Comfortable 44px target, centred
       label, no pipe separators, no underline. */
    #famFilters .gtm-filter-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        margin: 0;
        padding: 10px 26px;
        width: auto;
        flex: 0 0 auto;
        color: var(--c-primary, #342E37);
        background: #fff;
        border: 1.5px solid var(--c-border, #DFDFDF);
        border-radius: 999px;
        font-weight: 700;
        font-size: 15px;
        line-height: 1.15;
        text-transform: uppercase;
        letter-spacing: 0.01em;
        text-align: center;
        cursor: pointer;
        transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
    }

    /* Drop the old "|" divider; the grid and borders carry the separation now. */
    #famFilters .gtm-filter-pill::after {
        content: none;
    }

    /* Hover / keyboard focus: brand-tinted border + text so it reads as
       clickable and is clearly distinct from the active (filled) state. */
    #famFilters .gtm-filter-pill:hover {
        color: var(--c-active-brand, #342E37);
        border-color: var(--c-active-brand, #342E37);
        background: #fff;
    }

    #famFilters .gtm-filter-pill:focus-visible {
        outline: 3px solid var(--c-active-brand, #342E37);
        outline-offset: 2px;
    }

    /* Active range: filled with the brand accent, white label, unmissable,
       and the single obvious "you are here". */
    #famFilters .gtm-filter-pill.active {
        color: #fff;
        background: var(--c-active-brand, #342E37);
        border-color: var(--c-active-brand, #342E37);
    }

    #famFilters .gtm-filter-pill.active:hover {
        color: #fff;
        background: var(--c-active-brand, #342E37);
    }

    /* Light-background brands (Kawasaki green, Ducati Scrambler yellow) fail
       white-on-fill contrast. Keep the solid brand fill but switch the active
       label to dark for those brand contexts so it stays legible (WCAG AA).
       Scoped by the same body.brand-* mechanism defined in base.css. */
    body.brand-kawasaki #famFilters .gtm-filter-pill.active,
    body.brand-kawasaki #famFilters .gtm-filter-pill.active:hover,
    body.brand-ducati.family-scrambler #famFilters .gtm-filter-pill.active,
    body.brand-ducati.family-scrambler #famFilters .gtm-filter-pill.active:hover {
        color: #342E37;
    }

    @media (prefers-reduced-motion: reduce) {
        #famFilters .gtm-filter-pill { transition: none; }
    }
}

/* Owner: the red-header brand-loop arrows are redundant (carousel nav sits below the bikes, and the main menu switches brands). */
.gtm-explore-header .gtm-brand-nav-arrow { display: none !important; }
