/* Listados de flota con filtros (/campervan, /motorhome, sus ciudades y las landings de filtro).
   Marcado: inc/fleet_section.php. Comportamiento: assets/js/fleet.js. Las tarjetas, en vehicle-cards.css.
   Viene de assets/css/fleet.css de campervaniceland.com (rama main, noviembre de 2026). */

.fleet-section {
    padding: 28px 0 60px;
    background: #fffefb;
    color: var(--fleet-ink);
}
/* Same widths as step 1 of the booking: results in a 1360px container, filters centred in 1179px */
/* a filter on its way (fleet.js, showListing) */
.fleet-section[aria-busy="true"] .fleet-grid {
    opacity: .5;
}
.fleet-grid {
    transition: opacity .2s ease; /* the dim while a filter applies (JOH-67: the price range too) */
}
.fleet-section .container {
    max-width: 1360px;
}
.fleet-filters {
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Breadcrumbs ---------- */
.fleet-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: var(--fleet-muted);
}
.fleet-breadcrumbs li + li::before {
    content: "›";
    margin-right: 4px;
}
.fleet-breadcrumbs a {
    color: var(--fleet-muted);
    text-decoration: underline;
}

/* ---------- Filter bar ---------- */
/* Same language as step 1 of the booking: label above, round pills, thin vertical rules between groups */
.fleet-mobile-bar {
    display: none;
}
.fleet-filters {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 0;
    border: 0;
    background: transparent;
}
.fleet-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 18px 0;
}
.fleet-facet {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto; /* the groups share the full width: long names get more room, short ones stay tight */
    padding: 0 14px;
}
.fleet-facet:first-child {
    padding-left: 0;
}
.fleet-facet:last-child {
    padding-right: 0;
}
.fleet-facet .fleet-select,
.fleet-facet .fleet-select-toggle {
    width: 100%;
}
.fleet-select-toggle {
    justify-content: space-between;
    padding-left: 18px;
    padding-right: 16px;
    white-space: nowrap;
}
.fleet-facet--bare {
    justify-content: flex-end; /* no label: the button sits on the pills' line */
}
.fleet-facet + .fleet-facet::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px; /* on the pills' line, whether or not the group has a label above */
    width: 1px;
    height: 35px;
    background: var(--fleet-line);
}
.fleet-facet-label {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    color: var(--fleet-ink);
}
.fleet-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.fleet-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 7px 11px;
    border: 2px solid #c4d0d6;
    border-radius: 30px;
    background: #fff;
    color: var(--fleet-ink);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
a.fleet-pill:hover,
.fleet-select-toggle:hover {
    border-color: #f4731f;
    color: #f4731f;
    text-decoration: none;
}
.fleet-pill.is-active {
    border-color: #f4731f;
    background: #f4731f;
    color: #fff;
}
a.fleet-pill.is-active:hover {
    color: #fff;
}
.fleet-pill.is-disabled {
    opacity: .4;
    cursor: not-allowed;
}
.fleet-pills .fleet-pill.is-disabled {
    display: none; /* nothing to filter: keep the row short */
}
.fleet-select-toggle,
.fleet-select-toggle.is-active {
    padding-right: 10px;
    border-color: #c4d0d6;
    background: #fff;
    color: var(--fleet-ink);
}
.fleet-select-toggle.is-active {
    border-color: #f4731f;
    font-weight: 700;
}
.fleet-select-toggle:hover {
    border-color: #f4731f;
    color: #f4731f;
}

/* Dropdowns (category, brand, model): open on click; on focus only without JS (html.fleet-js, fleet.js) */
.fleet-select {
    position: relative;
}
.fleet-select-toggle i,
.fleet-filters-toggle i {
    font-size: 11px;
}
.fleet-select-toggle[aria-expanded="true"] i,
.fleet-filters-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}
@media (prefers-reduced-motion: no-preference) {
    .fleet-select-toggle i,
    .fleet-filters-toggle i {
        transition: transform .2s ease;
    }
}
.fleet-select-menu {
    display: none;
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    width: 100%; /* as wide as its button */
    max-height: 340px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--fleet-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(20, 39, 44, .16);
}
.fleet-select-menu.is-right {
    left: auto;
    right: 0;
}
.fleet-select.is-open .fleet-select-menu,
html:not(.fleet-js) .fleet-select:focus-within .fleet-select-menu {
    display: block;
}
.fleet-select-menu a,
.fleet-select-menu span.is-active,
.fleet-select-menu span[data-href], /* the chosen option keeps its look when the phone «Clear» unticks it (fleet.js drops is-active only) */
.fleet-select-menu span.is-disabled {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--fleet-ink);
    font-size: 16px;
    text-decoration: none;
}
.fleet-select-menu a:hover {
    background: var(--fleet-soft);
    color: var(--fleet-ink);
    text-decoration: none;
}
.fleet-select-menu a.is-active,
.fleet-select-menu span.is-active {
    font-weight: 700;
}
.fleet-select-menu span.is-active {
    background: var(--fleet-soft);
}
.fleet-select-menu span.is-disabled {
    opacity: .4;
}
.fleet-select-heading {
    padding: 10px 10px 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--fleet-muted);
}
.fleet-select-count {
    margin-left: auto;
    font-size: 14px;
    color: var(--fleet-muted);
}
/* chosen-count badge on the button, and radio / check boxes in the menus */
.fleet-select-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin: 0 6px 0 -2px;
    padding: 0 6px;
    border-radius: 10px;
    background: #f4731f;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.fleet-select-badge[hidden] {
    display: none;
}
.fleet-select-menu :is(a, span)[data-value]::before {
    content: "";
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 2px solid #c4d0d6;
    border-radius: 4px; /* same box whether the facet is single or multi-choice */
    background: #fff;
    box-sizing: border-box;
}
.fleet-select-menu :is(a, span)[data-value].is-active::before {
    border-color: #f4731f;
    background: #f4731f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.fleet-select-menu :is(a, span)[data-value].is-active {
    background: var(--fleet-soft);
}
/* JOS-19: the chosen option is a span (no link) that still takes the filter off on a tap */
.fleet-select-menu span[data-href] { cursor: pointer; }
.fleet-select-menu span[data-href]:hover { background: var(--fleet-soft); }
.fleet-select-menu span[data-href]:focus-visible { outline: 2px solid var(--fleet-accent); outline-offset: 1px; }
.fleet-select-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
/* Price range: two native range inputs over one track, inside the "Price" menu */
.fleet-select-list {
    margin: 0;
    padding: 0;
    list-style: none; /* classed on purpose: the site gives "ul:not([class]) li" a dot */
}
.fleet-select-list li {
    margin: 0;
    padding: 0;
}
.fleet-select-section + .fleet-select-heading {
    margin-top: 6px;
    border-top: 1px solid var(--fleet-line);
    padding-top: 12px;
}
.fleet-select-brand + .fleet-select-brand {
    margin-top: 6px;
    border-top: 1px solid var(--fleet-line);
    padding-top: 6px;
}
.fleet-select-brand-head {
    font-weight: 600;
}
.fleet-select-menu a.fleet-select-model,
.fleet-select-menu span.fleet-select-model {
    padding-left: 34px; /* under the brand it belongs to */
}
.fleet-select-subheading {
    padding: 8px 10px 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--fleet-ink);
}
.fleet-select-range {
    padding: 4px 10px 10px;
}
.fleet-select-range .fleet-range {
    width: 100%;
}
.fleet-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    line-height: 16px;
}
.fleet-range-track {
    position: relative;
    height: 24px;
}
.fleet-range-track::before,
.fleet-range-bar {
    content: "";
    position: absolute;
    top: 8px;
    height: 8px;
    border-radius: 4px;
}
.fleet-range-track::before {
    left: 0;
    right: 0;
    background: var(--fleet-line);
}
.fleet-range-bar {
    left: 0;
    width: 100%;
    background: var(--fleet-accent);
}
.fleet-range-track input[type="range"] {
    position: absolute;
    left: 0;
    top: 2px;
    width: 100%;
    height: 20px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}
.fleet-range-track input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--fleet-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    pointer-events: auto;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
/* JOH-67: how many vehicles the range leaves, live while dragging */
.fleet-range-count {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 16px;
    color: var(--fleet-ink);
}
.fleet-range-track input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--fleet-accent);
    pointer-events: auto;
    cursor: pointer;
}

/* the «Clear / Apply» bar of the menus with several choices is for phones only (rules in the max-width: 767px block) */
@media (min-width: 768px) {
    .fleet-select-actions { display: none; }
}

/* ---------- Toolbar ---------- */
.fleet-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 24px 0 16px;
}
.fleet-count {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #1a2b29;
}
.fleet-active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.fleet-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1.5px solid var(--fleet-line);
    border-radius: 999px;
    background: #fff;
    color: var(--fleet-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}
.fleet-chip span {
    color: var(--fleet-accent);
    font-size: 16px;
}
.fleet-chip:hover {
    background: var(--fleet-line);
    color: var(--fleet-ink);
    text-decoration: none;
}
.fleet-clear {
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--fleet-muted);
    text-decoration: underline;
    cursor: pointer;
}
.fleet-active[hidden] {
    display: none;
}

/* ---------- Rejilla ---------- */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
}
.fleet-empty {
    padding: 40px 20px;
    border: 1px dashed var(--fleet-line);
    border-radius: 16px;
    text-align: center;
}
.fleet-empty[hidden] {
    display: none;
}
.fleet-empty p {
    font-size: 18px;
}

@media (max-width: 1359px) {
    /* small desktop and tablet: tighter so the filter row still fits in one line */
    .fleet-facet {
        padding: 0 10px;
    }
    .fleet-select-toggle {
        padding-left: 14px;
        padding-right: 12px;
    }
    .fleet-facet + .fleet-facet::before {
        height: 32px;
    }
    .fleet-pill {
        min-height: 36px;
        padding: 5px 10px;
        font-size: 15px;
    }
    .fleet-pills {
        gap: 6px;
    }
}
@media (max-width: 1199px) {
    .fleet-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    /* tablet landscape: smallest sizes that keep the nine groups in one line */
    .fleet-facet {
        padding: 0 6px;
    }
    .fleet-select-toggle {
        padding-left: 10px;
        padding-right: 8px;
    }
    .fleet-pill {
        min-height: 34px;
        padding: 4px 8px;
        font-size: 14px;
    }
    .fleet-pills {
        gap: 5px;
    }
    .fleet-range-labels {
        font-size: 12px;
    }
}
@media (max-width: 991px) {
    .fleet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
    .fleet-facet {
        padding: 0 16px;
    }
}
@media (max-width: 767px) {
    .fleet-facet {
        flex: 0 0 auto;
        padding: 0;
    }
    .fleet-facet + .fleet-facet::before {
        display: none;
    }
    .fleet-mobile-bar {
        display: block;
        margin-bottom: 12px;
    }
    .fleet-filters-toggle {
        width: 100%;
        padding: 12px 16px;
        border: 1px solid var(--fleet-line);
        border-radius: 12px;
        background: #fff;
        font-size: 16px;
        font-weight: 700;
        text-align: left;
    }
    .fleet-filters-toggle i {
        float: right;
        margin-top: 4px;
    }
    .fleet-filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    .fleet-filters {
        display: none;
        flex-direction: column;
        gap: 18px;
        padding: 16px;
        border: 1px solid var(--fleet-line);
        border-radius: 16px;
        background: #fff;
    }
    .fleet-filters.is-open {
        display: flex;
    }
    .fleet-select-menu {
        position: static;
        box-shadow: none;
        margin-top: 4px;
        max-height: none; /* the whole list in the page: no scroll box inside the scrolling page; the «Apply» bar sticks to the screen's foot */
        overflow: visible;
    }
    /* Vehicle, Price and Brand & Model gather several choices: «Clear» and «Apply» stay at the foot of the menu (fleet.js) */
    .fleet-select-actions {
        position: sticky;
        bottom: 0;
        z-index: 1;
        display: flex;
        gap: 8px;
        margin: 8px -6px -6px; /* edge to edge of the menu (its padding is 6px) */
        padding: 10px;
        border-top: 1px solid var(--fleet-line);
        border-radius: 0 0 12px 12px;
        background: #fff;
    }
    .fleet-select-clear,
    .fleet-select-apply {
        flex: 1;
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.2;
        cursor: pointer;
    }
    .fleet-select-clear {
        border: 1px solid var(--fleet-line);
        background: #fff;
        color: var(--fleet-ink);
    }
    .fleet-select-apply {
        flex: 2;
        border: 0;
        background: var(--fleet-accent);
        color: #fff;
    }
    .fleet-select-apply:disabled {
        opacity: .45;
        cursor: default;
    }
    .fleet-select-clear:focus-visible,
    .fleet-select-apply:focus-visible {
        outline: 2px solid var(--fleet-accent);
        outline-offset: 2px;
    }
    .fleet-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
