/* ==========================================================================
   Golden Drive — Search filters
   Markup: resources/views/website/components/search-filters.blade.php
   ========================================================================== */

.gd-filters {
    /* The children (rail, sticky bar) live in the results container so the bar stays sticky */
    display: contents;

    --gd-gold: #be944e;
    --gd-gold-dark: #a37b39;
    --gd-gold-soft: #f7f0e4;
    --gd-gold-softer: #fbf7f0;
    --gd-ink: #201f1d;
    --gd-ink-2: #4a4740;
    --gd-muted: #8a857b;
    --gd-line: #ece6db;
    --gd-field: #f8f6f2;
}

.gd-filters :where(button) {
    font: inherit;
}

.gd-filters [hidden] {
    display: none !important;
}

/* ---------- Car type rail ---------- */

.gd-rail {
    min-height: 104px;
    margin: 4px 0 14px;
}

.gd-rail__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
}

[dir="rtl"] .gd-rail__track {
    mask-image: linear-gradient(to left, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
}

.gd-rail__track::-webkit-scrollbar {
    display: none;
}

.gd-rail__item {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    grid-template-rows: 52px auto;
    justify-items: center;
    align-items: center;
    gap: 6px;
    width: 112px;
    padding: 10px 8px 9px;
    border: 1px solid var(--gd-line);
    border-radius: 16px;
    background: #fff;
    color: var(--gd-ink);
    cursor: pointer;
    scroll-snap-align: start;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.gd-rail__item:hover:not(:disabled) {
    border-color: rgba(190, 148, 78, 0.6);
    box-shadow: 0 10px 22px -14px rgba(61, 41, 7, 0.45);
    transform: translateY(-1px);
}

.gd-rail__item.is-active {
    border-color: var(--gd-ink);
    background: var(--gd-gold-soft);
    color: var(--gd-ink);
    box-shadow: 0 0 0 1px var(--gd-ink), 0 12px 24px -16px rgba(32, 31, 29, 0.6);
}

.gd-rail__item.is-empty {
    opacity: 0.45;
    cursor: not-allowed;
}

.gd-rail__img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
}

.gd-rail__img img {
    max-width: 86px;
    max-height: 48px;
    object-fit: contain;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.gd-rail__item:hover .gd-rail__img img {
    transform: scale(1.06);
}

.gd-rail__img i {
    font-size: 24px;
    color: var(--gd-gold);
}

.gd-rail__img--all {
    width: 44px;
    height: 44px;
    margin-top: 4px;
    border-radius: 14px;
    background: var(--gd-gold-soft);
}

.gd-rail__item.is-active .gd-rail__img--all {
    background: var(--gd-ink);
}

.gd-rail__item.is-active .gd-rail__img i {
    color: #ffd38a;
}

.gd-rail__name {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.gd-rail__count {
    position: absolute;
    top: 7px;
    inset-inline-end: 7px;
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--gd-field);
    color: var(--gd-ink-2);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.gd-rail__item.is-active .gd-rail__count {
    background: var(--gd-gold);
    color: #fff;
}

/* ---------- Sticky bar ---------- */

.gd-fbar {
    position: sticky;
    top: var(--gd-sticky-top, 0px);
    z-index: 40;
    margin: 0 0 18px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--gd-line);
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(32, 31, 29, 0.04);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    transition: box-shadow 0.25s ease, border-radius 0.25s ease;
}

.gd-fbar.is-stuck {
    box-shadow: 0 18px 36px -24px rgba(32, 31, 29, 0.45);
}

.gd-fbar__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.gd-fbar__end {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}

/* Search field */
.gd-fsearch {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 240px;
    min-width: 160px;
    height: 44px;
    margin: 0;
    padding: 0 12px;
    gap: 8px;
    border: 1px solid var(--gd-line);
    border-radius: 12px;
    background: var(--gd-field);
    color: var(--gd-muted);
    cursor: text;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.gd-fsearch:focus-within {
    border-color: var(--gd-gold);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(190, 148, 78, 0.15);
}

.gd-fsearch input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--gd-ink);
    font-size: 14px;
    font-weight: 500;
}

.gd-fsearch input::-webkit-search-cancel-button {
    display: none;
}

.gd-fsearch input::placeholder {
    color: var(--gd-muted);
}

.gd-fsearch__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #e7e1d6;
    color: var(--gd-ink-2);
    font-size: 12px;
    cursor: pointer;
}

.gd-fsearch--block {
    flex: none;
    width: 100%;
    min-width: 0;
    height: 48px;
}

.gd-fsearch--sm {
    height: 40px;
    margin-bottom: 10px;
}

/* Quick filter pills */
.gd-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

/* soft edge when the pills scroll on narrower laptops */
.gd-pills.is-overflowing {
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
    padding-inline-end: 18px;
}

[dir="rtl"] .gd-pills.is-overflowing {
    mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
}

.gd-pills::-webkit-scrollbar {
    display: none;
}

.gd-pill,
.gd-tbtn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--gd-line);
    border-radius: 12px;
    background: #fff;
    color: var(--gd-ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.gd-pill i,
.gd-tbtn__chev {
    font-size: 14px;
    color: var(--gd-muted);
    transition: transform 0.2s ease;
}

.gd-pill:hover,
.gd-tbtn:hover {
    border-color: rgba(190, 148, 78, 0.7);
    background: var(--gd-gold-softer);
}

.gd-pill.is-open,
.gd-tbtn[aria-expanded="true"] {
    border-color: var(--gd-ink);
    box-shadow: 0 0 0 1px var(--gd-ink);
}

.gd-pill.is-open i,
.gd-tbtn[aria-expanded="true"] .gd-tbtn__chev {
    transform: rotate(180deg);
}

.gd-pill.is-active {
    border-color: var(--gd-ink);
    background: var(--gd-ink);
    color: #fff;
}

.gd-pill.is-active i {
    color: rgba(255, 255, 255, 0.7);
}

.gd-pill:focus-visible,
.gd-tbtn:focus-visible,
.gd-view__btn:focus-visible {
    outline: 2px solid var(--gd-gold);
    outline-offset: 2px;
}

.gd-tbtn > i:first-child {
    font-size: 16px;
    color: var(--gd-gold-dark);
}

.gd-tbtn__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gd-gold);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
}

.gd-tbtn__label {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gd-rot {
    display: inline-block;
    transform: rotate(90deg);
}

/* Grid / list toggle */
.gd-view {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--gd-line);
    border-radius: 12px;
    background: var(--gd-field);
}

.gd-view__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--gd-muted);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.gd-view__btn.active {
    background: #fff;
    color: var(--gd-ink);
    box-shadow: 0 2px 6px rgba(32, 31, 29, 0.12);
}

/* Active chips + result count */
.gd-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 0 4px;
}

.gd-filters:not(.has-active-filters) .gd-active,
.gd-active:has(.gd-active__chips:empty) {
    margin-top: 8px;
}

.gd-active__chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.gd-chip-x {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 8px 0 12px;
    border: 1px solid rgba(190, 148, 78, 0.35);
    border-radius: 999px;
    background: var(--gd-gold-softer);
    color: var(--gd-ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    animation: gdf-pop-in 0.2s ease;
    transition: background 0.15s ease, border-color 0.15s ease;
}

[dir="rtl"] .gd-chip-x {
    padding: 0 12px 0 8px;
}

.gd-chip-x i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(190, 148, 78, 0.2);
    color: var(--gd-gold-dark);
    font-size: 11px;
}

.gd-chip-x:hover {
    border-color: var(--gd-gold);
    background: var(--gd-gold-soft);
}

.gd-chip-x:hover i {
    background: var(--gd-gold);
    color: #fff;
}

.gd-clear-all,
.gd-link {
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--gd-ink);
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.gd-clear-all:hover,
.gd-link:hover {
    color: var(--gd-gold-dark);
}

.gd-active__count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gd-ink-2);
    white-space: nowrap;
}

.gd-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ea866;
    box-shadow: 0 0 0 0 rgba(46, 168, 102, 0.5);
    animation: gdf-pulse 2s ease infinite;
}

.gd-active__count.is-loading .gd-pulse {
    background: var(--gd-gold);
    animation: gdf-blink 0.8s ease infinite;
}

/* ---------- Desktop popover ---------- */

.gd-fpop {
    position: absolute;
    z-index: 50;
    width: 340px;
    max-width: calc(100vw - 32px);
    padding: 16px;
    background: #fff;
    border: 1px solid var(--gd-line);
    border-radius: 18px;
    box-shadow: 0 30px 70px -20px rgba(32, 31, 29, 0.35), 0 4px 14px rgba(32, 31, 29, 0.08);
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
    transform-origin: top center;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.gd-fpop.is-open {
    opacity: 1;
    transform: none;
}

.gd-fpop--price {
    width: 380px;
}

.gd-fpop--brands {
    width: 420px;
}

.gd-fpop--sort {
    width: 280px;
    padding: 10px;
}

.gd-fpop--sort .gd-fpop__head {
    padding: 4px 8px 8px;
}

.gd-fpop__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gd-ink);
}

.gd-fpop__body {
    max-height: min(60vh, 440px);
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

/* ---------- Sections ---------- */

/* Price */
.gd-price {
    padding: 4px 2px 0;
}

.gd-hist {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 64px;
    padding: 0 9px;
}

.gd-hist__bar {
    flex: 1;
    min-height: 4px;
    border-radius: 3px 3px 0 0;
    background: #e8e2d6;
    transition: background 0.15s ease;
}

.gd-hist__bar.is-in {
    background: linear-gradient(to top, var(--gd-gold-dark), #d6b273);
}

.gd-range {
    position: relative;
    height: 28px;
    margin-top: -2px;
}

.gd-range__track {
    position: absolute;
    left: 9px;
    right: 9px;
    top: 12px;
    height: 4px;
    border-radius: 4px;
    background: #e8e2d6;
}

.gd-range__track::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--lo);
    right: calc(100% - var(--hi));
    border-radius: 4px;
    background: var(--gd-ink);
}

/* The price axis (histogram, slider, min/max boxes) reads low -> high, left to right, in both
   languages so the bars always line up with the handles; the box text itself stays RTL. */
[dir="rtl"] .gd-hist,
[dir="rtl"] .gd-range,
[dir="rtl"] .gd-price__boxes {
    direction: ltr;
}

[dir="rtl"] .gd-price__box {
    direction: rtl;
}

.gd-range input[type="range"] {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 3;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.gd-range input[type="range"]::-webkit-slider-runnable-track {
    height: 28px;
    background: transparent;
}

.gd-range input[type="range"]::-moz-range-track {
    height: 28px;
    background: transparent;
}

.gd-range input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: 2px;
    border: 2px solid var(--gd-ink);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    cursor: grab;
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gd-range input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gd-ink);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    cursor: grab;
    pointer-events: auto;
}

.gd-range input[type="range"]:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(190, 148, 78, 0.2), 0 3px 10px rgba(0, 0, 0, 0.18);
}

.gd-range input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(190, 148, 78, 0.35);
}

.gd-price__boxes {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.gd-price__box {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gd-line);
    border-radius: 12px;
}

.gd-price__box small {
    display: block;
    font-size: 11.5px;
    color: var(--gd-muted);
}

.gd-price__box b {
    font-size: 15px;
    font-weight: 700;
    color: var(--gd-ink);
}

.gd-price__dash {
    width: 10px;
    height: 2px;
    background: var(--gd-line);
}

.gd-price__note {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--gd-muted);
}

/* Type tiles */
.gd-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.gd-tile,
.gd-brand {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    border: 1px solid var(--gd-line);
    border-radius: 14px;
    background: #fff;
    color: var(--gd-ink);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.gd-tile {
    flex-direction: column;
    gap: 4px;
    padding: 10px 6px 8px;
}

.gd-tile:hover:not(:disabled),
.gd-brand:hover:not(:disabled) {
    border-color: rgba(190, 148, 78, 0.7);
}

.gd-tile.is-active,
.gd-brand.is-active {
    border-color: var(--gd-ink);
    background: var(--gd-gold-softer);
    box-shadow: 0 0 0 1px var(--gd-ink);
}

.gd-tile:disabled,
.gd-brand:disabled,
.gd-choice:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gd-tile__media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
}

.gd-tile__media img {
    max-width: 70px;
    max-height: 34px;
    object-fit: contain;
}

.gd-tile__media i {
    font-size: 20px;
    color: var(--gd-gold);
}

.gd-tile__name {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 700;
}

.gd-tile__count,
.gd-brand__count {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gd-muted);
}

.gd-tile__check {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gd-ink);
    color: #fff;
    font-size: 11px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.is-active > .gd-tile__check {
    opacity: 1;
    transform: none;
}

/* Brands */
.gd-brands {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.gd-brand {
    gap: 10px;
    padding: 8px 30px 8px 8px;
    text-align: start;
}

[dir="rtl"] .gd-brand {
    padding: 8px 8px 8px 30px;
}

.gd-brand__logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--gd-field);
    color: var(--gd-gold-dark);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
}

.gd-brand__logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.gd-brand__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13.5px;
    font-weight: 600;
}

.gd-brand .gd-tile__check {
    top: 50%;
    margin-top: -9px;
    inset-inline-end: 8px;
}

.gd-brand.is-active .gd-brand__count {
    display: none;
}

.gd-empty-note {
    grid-column: 1 / -1;
    margin: 8px 0;
    font-size: 13px;
    color: var(--gd-muted);
    text-align: center;
}

/* Single-choice chips */
.gd-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gd-choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--gd-line);
    border-radius: 999px;
    background: #fff;
    color: var(--gd-ink);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gd-choice small {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gd-muted);
}

.gd-choice:hover:not(:disabled) {
    border-color: var(--gd-gold);
    background: var(--gd-gold-softer);
}

.gd-choice.is-active {
    border-color: var(--gd-ink);
    background: var(--gd-ink);
    color: #fff;
}

.gd-choice.is-active small {
    color: rgba(255, 255, 255, 0.65);
}

/* Sort list */
.gd-sortlist {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gd-sortopt {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--gd-ink);
    font-size: 14px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gd-sortopt > i:first-child {
    width: 18px;
    font-size: 15px;
    color: var(--gd-muted);
}

.gd-sortopt span {
    flex: 1;
}

.gd-sortopt__check {
    color: var(--gd-gold-dark);
    opacity: 0;
}

.gd-sortopt:hover {
    background: var(--gd-field);
}

.gd-sortopt.is-active {
    background: var(--gd-gold-softer);
}

.gd-sortopt.is-active > i:first-child {
    color: var(--gd-gold-dark);
}

.gd-sortopt.is-active .gd-sortopt__check {
    opacity: 1;
}

/* ---------- Filter panel: drawer (desktop) / bottom sheet (phones) ---------- */

.gd-fbackdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(20, 18, 14, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gd-fbackdrop.is-open {
    opacity: 1;
}

.gd-sheet {
    position: fixed;
    z-index: 1100;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    display: flex;
    flex-direction: column;
    width: 440px;
    max-width: 100%;
    background: #fff;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

[dir="rtl"] .gd-sheet {
    transform: translateX(-100%);
}

.gd-sheet.is-open {
    transform: none !important;
}

.gd-sheet__handle {
    display: none;
}

.gd-sheet__head {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gd-line);
}

.gd-sheet__title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--gd-ink);
    text-align: center;
}

.gd-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gd-field);
    color: var(--gd-ink);
    font-size: 16px;
    cursor: pointer;
}

.gd-sheet__close:hover {
    background: var(--gd-gold-soft);
}

.gd-sheet__reset {
    padding: 6px 4px;
    border: 0;
    background: none;
    color: var(--gd-ink);
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.gd-sheet__reset:disabled {
    color: #c9c3b8;
    text-decoration: none;
    cursor: default;
}

.gd-sheet--sort .gd-sheet__head {
    grid-template-columns: 40px 1fr 40px;
}

.gd-sheet__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 18px 20px;
}

.gd-sheet--sort .gd-sheet__body {
    padding: 10px;
}

.gd-sec {
    padding: 18px 0;
    border-bottom: 1px solid var(--gd-line);
}

.gd-sec:last-child {
    border-bottom: 0;
}

.gd-sec--search {
    padding-top: 12px;
    border-bottom: 0;
    padding-bottom: 4px;
}

.gd-sec__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.gd-sec__head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--gd-ink);
}

.gd-sheet__foot {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--gd-line);
    background: #fff;
}

.gd-sheet__apply {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #cfa862 0%, var(--gd-gold) 45%, var(--gd-gold-dark) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 24px -12px rgba(163, 123, 57, 0.9);
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.gd-sheet__apply:hover {
    filter: brightness(1.05);
}

.gd-sheet__apply:disabled {
    background: #d9d3c8;
    box-shadow: none;
    cursor: not-allowed;
}

.gd-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gdf-spin 0.7s linear infinite;
}

.gd-sheet__apply.is-loading .gd-spinner {
    display: inline-block;
}

.gd-sheet .gd-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

html.gd-scroll-lock,
html.gd-scroll-lock body {
    overflow: hidden !important;
}

/* Results dim while they reload after a filter change (the cards stay put, no jump) */
#car-results {
    transition: opacity 0.2s ease;
}

#car-results.is-refreshing {
    opacity: 0.45;
    pointer-events: none;
}

/* Thin progress line under the bar while loading */
.gd-filters.is-loading .gd-fbar::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--gd-gold), transparent);
    background-size: 40% 100%;
    background-repeat: no-repeat;
    animation: gdf-progress 1s ease-in-out infinite;
}

@keyframes gdf-progress {
    from { background-position: -40% 0; }
    to { background-position: 140% 0; }
}

/* Empty state */
.gd-empty {
    max-width: 520px;
    margin: 24px auto;
    padding: 36px 24px;
    text-align: center;
    background: #fff;
    border: 1px dashed #e2d9c8;
    border-radius: 20px;
}

.gd-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 20px;
    background: #f7f0e4;
    color: #a37b39;
    font-size: 26px;
}

.gd-empty h4 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 800;
    color: #201f1d;
}

.gd-empty p {
    margin: 0 0 18px;
    font-size: 14px;
    color: #8a857b;
}

.gd-empty__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.gd-empty__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 1px solid #201f1d;
    border-radius: 12px;
    background: #201f1d;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.gd-empty__btn--ghost {
    background: #fff;
    color: #201f1d;
    border-color: #ece6db;
}

.gd-empty__btn:hover {
    filter: brightness(1.1);
}

.gd-empty__btn--ghost:hover {
    border-color: #be944e;
    filter: none;
}

/* ---------- Animations ---------- */

@keyframes gdf-spin {
    to { transform: rotate(360deg); }
}

@keyframes gdf-pop-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: none; }
}

@keyframes gdf-pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 168, 102, 0.45); }
    70% { box-shadow: 0 0 0 7px rgba(46, 168, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 168, 102, 0); }
}

@keyframes gdf-blink {
    50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
    .gd-filters *,
    .gd-sheet,
    .gd-fpop {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Tablet & phones ---------- */

@media (max-width: 991.98px) {
    .gd-rail {
        min-height: 88px;
        margin: 0 -12px 8px;
    }

    .gd-rail__track {
        gap: 8px;
        padding: 2px 12px 6px;
    }

    .gd-rail__item {
        grid-template-rows: 40px auto;
        width: 92px;
        padding: 8px 6px 7px;
        border-radius: 14px;
    }

    .gd-rail__img {
        height: 40px;
    }

    .gd-rail__img img {
        max-width: 70px;
        max-height: 36px;
    }

    .gd-rail__img--all {
        width: 36px;
        height: 36px;
        margin-top: 2px;
    }

    .gd-rail__name {
        font-size: 12px;
    }

    .gd-rail__count {
        top: 5px;
        inset-inline-end: 5px;
        min-width: 18px;
        padding: 0 5px;
        font-size: 10px;
        line-height: 16px;
    }

    .gd-fbar {
        margin: 0 -12px 12px;
        padding: 8px 12px;
        border-width: 0 0 1px;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.95);
    }

    .gd-fbar.is-stuck {
        box-shadow: 0 10px 24px -18px rgba(32, 31, 29, 0.55);
    }

    .gd-tbtn {
        height: 42px;
        padding: 0 12px;
        font-size: 13.5px;
    }

    .gd-tbtn--filters {
        flex: 1 1 auto;
        justify-content: center;
    }

    .gd-fbar__end {
        gap: 6px;
    }

    .gd-tbtn--sort .gd-tbtn__label {
        max-width: 92px;
    }

    .gd-view__btn {
        width: 34px;
        height: 34px;
    }

    .gd-active {
        margin-top: 8px;
        padding: 0;
    }

    .gd-active__chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .gd-active__chips::-webkit-scrollbar {
        display: none;
    }

    .gd-chip-x {
        flex: 0 0 auto;
        height: 28px;
        font-size: 12.5px;
    }

    .gd-clear-all {
        flex: 0 0 auto;
    }

    .gd-active__count {
        font-size: 12.5px;
    }

    /* Panel becomes a bottom sheet */
    .gd-sheet {
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 92vh;
        height: 92dvh;
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.2);
        transform: translateY(100%);
    }

    [dir="rtl"] .gd-sheet {
        transform: translateY(100%);
    }

    .gd-sheet--sort {
        height: auto;
        max-height: 80vh;
    }

    .gd-sheet__handle {
        display: block;
        width: 40px;
        height: 4px;
        margin: 8px auto 0;
        border-radius: 4px;
        background: #ddd6ca;
    }

    .gd-sheet__head {
        padding: 8px 16px 12px;
    }

    .gd-sheet__body {
        padding: 4px 16px 16px;
    }

    .gd-sheet--sort .gd-sheet__body {
        padding: 8px 10px calc(14px + env(safe-area-inset-bottom));
    }

    .gd-sheet__foot {
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    }

    .gd-brands {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 359.98px) {
    .gd-tbtn--sort .gd-tbtn__label {
        display: none;
    }

    .gd-sheet .gd-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
