/*
 * TTF Nav: the car picker bar (Hub Run Sheet H4.3), look 1 "Clean and light" (owner, 2026-10-06).
 *
 * ttf-nav/picker.php prints it under the category bar on every front-end page and enqueues this file; picker.js
 * fills it in. A white row with a thin bottom line, the shop's red for actions. Without a car, desktop (992 px and
 * up) shows "Shop by car:" and the steps (make, model, generation, and the body style where a car has several) with a
 * red "Show parts" right in the row; narrower screens show "Choose your car", which opens the steps below the row.
 * With a car: the car icon, the car in bold with its years and body, "Change" (the steps below the row, filled in),
 * the page's count as a pill, a red "Shop for your {car}" and a clear button. The row keeps its height in every state
 * (it scrolls sideways on a phone if it must), so filling it in never moves the page. Before any script runs,
 * html.ttf-has-car (picker.php's head script, then picker.js) says whether a car is stored, so the steps show or wait
 * from the first paint. The steps' own look (.ttf-picker__form) also holds inside the garage's panel (garage.css),
 * where ttfPicker.openForm moves them; meanwhile (.ttf-picker--away) the bar's "Shop by car:" waits. Class prefix ttf-picker; .ttf-fit--none marks a link of another surface that
 * holds nothing for the car (unstyled: its count says it).
 */

.ttf-picker {
    position: relative;
    background: #fff;
    border-bottom: 1px solid #E9ECEF;
    color: var(--color-text-primary, #212529);
    font-family: 'Krub', sans-serif;
}
.ttf-picker[hidden],
.ttf-picker [hidden],
.ttf-picker__form [hidden] { display: none !important; }

/* The row: the bar, with the steps beside it (desktop, no car) or below it (opened). */
.ttf-picker__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: .75rem;
}
.ttf-picker__bar {
    flex: 1 0 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .35rem .75rem;
    height: 2.75rem;
    font-size: .875rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.ttf-picker__bar::-webkit-scrollbar { display: none; }
.ttf-picker__icon {
    flex: none;
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    padding: 5px;
    border-radius: 50%;
    background: #FFF0F2;
    color: #D81D33;
}
.ttf-picker__lead { display: none; color: #6C757D; }
.ttf-picker__car { color: #6C757D; }
.ttf-picker__car strong { margin-right: .2rem; font-size: .9375rem; font-weight: 800; color: var(--color-text-primary, #212529); }

/* Text buttons: the theme gives every button a height, padding and a fill. */
.ttf-picker .ttf-picker__toggle,
.ttf-picker .ttf-picker__clear,
.ttf-picker__form .ttf-picker__cancel {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: auto;
    margin: 0;
    padding: .3rem .1rem;
    border: 0;
    border-radius: 4px;
    background: none;
    box-shadow: none;
    font-family: inherit;
    font-size: .875rem;
    line-height: 1.3;
    cursor: pointer;
}
.ttf-picker .ttf-picker__toggle { font-weight: 700; color: #D81D33; }
.ttf-picker .ttf-picker__toggle::after {
    content: '';
    width: .42em;
    height: .42em;
    margin: 0 .1rem .2em .2rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .15s ease;
}
.ttf-picker .ttf-picker__toggle[aria-expanded="true"]::after { margin-bottom: -.15em; transform: rotate(-135deg); }
.ttf-picker--car .ttf-picker__toggle { font-weight: 600; }
.ttf-picker .ttf-picker__clear {
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border-radius: 50%;
    color: #ADB5BD;
}
.ttf-picker .ttf-picker__clear::before { content: '\2715'; font-size: .95rem; line-height: 1; }
.ttf-picker .ttf-picker__clear:hover { background: #F1F3F5; color: #495057; }
.ttf-picker__form .ttf-picker__cancel { font-weight: 500; color: #495057; }
.ttf-picker .ttf-picker__toggle:hover,
.ttf-picker__form .ttf-picker__cancel:hover { text-decoration: underline; text-underline-offset: 3px; }
.ttf-picker button:focus-visible,
.ttf-picker a:focus-visible,
.ttf-picker__form button:focus-visible,
.ttf-picker__form select:focus-visible { outline: 2px solid #D81D33; outline-offset: 2px; }

/* The page's count for the car as a pill, then "Shop for your {car}" at the row's end. */
.ttf-picker__fit {
    display: inline-block;
    padding: .3rem .8rem;
    border-radius: 999px;
    background: #F1F3F5;
    font-weight: 600;
    color: var(--color-text-primary, #212529);
    text-decoration: none;
}
a.ttf-picker__fit[href]:hover { background: #E9ECEF; color: #D81D33; }
.ttf-picker .ttf-picker__shop {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-left: auto;
    padding: .4rem 1rem;
    border-radius: 999px;
    background: #D81D33;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.ttf-picker .ttf-picker__shop::after { content: '\2192'; }
.ttf-picker .ttf-picker__shop:hover { background: #B8162B; color: #fff; }

/* The steps: make, model, generation, body style, then "Show parts" (and Cancel when opened). Each select carries
   its name as its first option; the labels are for screen readers. */
.ttf-picker__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    margin: 0;
}
.ttf-picker .ttf-picker__form { display: none; flex: 1 0 100%; padding: 0 0 .85rem; }
.ttf-picker.ttf-picker--open .ttf-picker__form { display: flex; }
.ttf-picker__field { display: block; width: 10rem; max-width: 100%; }
.ttf-picker__field--gen { width: 11.5rem; }
.ttf-picker__field--member { width: 13rem; }
.ttf-picker__field label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.ttf-picker__field select {
    width: 100%;
    height: 2.25rem;
    margin: 0;
    padding: 0 .7rem;
    border: 1.5px solid #CED4DA;
    border-radius: 8px;
    background-color: #fff;
    color: #495057;
    font-family: inherit;
    font-size: .875rem;
}
.ttf-picker__field select:disabled { background-color: #F8F9FA; color: #ADB5BD; }
.ttf-picker__actions { display: flex; align-items: center; gap: .9rem; }
.ttf-picker__form .ttf-picker__save {
    height: 2.25rem;
    margin: 0;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 8px;
    background: #D81D33;
    color: #fff;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
}
.ttf-picker__form .ttf-picker__save:hover { background: #B8162B; }
.ttf-picker__form .ttf-picker__save:disabled { background: #D81D33; opacity: .45; cursor: not-allowed; }

/* The toggle's short form (the car's short name) waits for narrow screens. */
.ttf-picker__narrow { display: none; }

/*
 * The category bar keeps a narrowed count on one line. A link that holds nothing for the car (.ttf-fit--none) keeps
 * full strength: its "0 fit your {car}" says it (owner, 2026-10-06; it was greyed out).
 */
.ttf-catbar small.ttf-fit,
.ttf-chippanel small.ttf-fit { white-space: nowrap; }

/* Desktop: a taller row. Without a car (and not opened), "Shop by car:" and the steps take the row; the toggle and
   Cancel stand down. With a car, "Change" reads as a link. */
@media (min-width: 992px) {
    .ttf-picker__bar { height: 3.25rem; }
    html:not(.ttf-has-car) .ttf-picker:not(.ttf-picker--open) .ttf-picker__bar { flex: 0 0 auto; }
    html:not(.ttf-has-car) .ttf-picker:not(.ttf-picker--open):not(.ttf-picker--away) .ttf-picker__lead { display: inline; }
    html:not(.ttf-has-car) .ttf-picker:not(.ttf-picker--open) .ttf-picker__toggle,
    html:not(.ttf-has-car) .ttf-picker:not(.ttf-picker--open) .ttf-picker__cancel { display: none; }
    html:not(.ttf-has-car) .ttf-picker:not(.ttf-picker--open) .ttf-picker__form {
        display: flex;
        flex: 1 1 0;
        min-width: 0;
        padding: 0;
    }
    .ttf-picker--car .ttf-picker__toggle::after { display: none; }
}
@media (min-width: 1200px) {
    .ttf-picker__field { width: 11rem; }
    .ttf-picker__field--gen { width: 12.5rem; }
    .ttf-picker__field--member { width: 14rem; }
}

/* Narrower screens: the car's years and body go first, then its name (the toggle shows the short name). */
@media (max-width: 1199.98px) {
    .ttf-picker__extra { display: none; }
}
@media (max-width: 991.98px) {
    .ttf-picker--car .ttf-picker__car,
    .ttf-picker__wide { display: none; }
    .ttf-picker__narrow { display: inline; }
    .ttf-picker--car .ttf-picker__toggle { font-weight: 700; color: var(--color-text-primary, #212529); }
}

/* Phones: the page's count leaves the row, which scrolls sideways if it must; the steps stack. */
@media (max-width: 767.98px) {
    .ttf-picker__bar { gap: .35rem .6rem; font-size: .8125rem; }
    .ttf-picker__icon { width: 26px; height: 26px; padding: 4px; }
    .ttf-picker__here { display: none; }
    .ttf-picker .ttf-picker__shop { padding: .32rem .8rem; }
    .ttf-picker.ttf-picker--open .ttf-picker__form { flex-direction: column; align-items: stretch; }
    .ttf-picker__field,
    .ttf-picker__field--gen,
    .ttf-picker__field--member { width: 100%; }
    .ttf-picker__field select { height: 2.625rem; font-size: .9375rem; }
    .ttf-picker__form .ttf-picker__save { height: 2.625rem; }
}

/*
 * While a car is chosen (ttf-has-car on <html>: picker.js, and before the first paint picker.php's head script), the
 * filter sidebar's "Select Vehicle" box on category and brand pages (.ttf-unified, built by the ttf-fitment-ajax
 * plugin) stands down: the picker holds the car (owner, 2026-10-06). A vehicle selected in the box itself keeps the
 * box in view, so that filter can still be changed or removed. Browsers without :has() keep the box.
 */
.ttf-has-car .ttf-unified:not(:has(.ttf-l1 option:checked:not([value=""]))) { display: none; }
