/* =========================================================
   Estructura general
========================================================= */

.vehicles {
    padding: 45px 0 70px;
}

.vehicles__layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}


/* =========================================================
   Filtro lateral
========================================================= */

.vehicles-filter {
    border: 1px solid #d2d2d2;
    border-radius: 6px;
    padding: 28px 28px 32px;
    background-color: #fff;
}

.vehicles-filter-toggle,
.vehicles-filter-backdrop,
.vehicles-filter__close,
.vehicles-filter__apply {
    display: none;
}

.vehicles-filter__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vehicles-filter__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 27px;
}

.vehicles-filter__title,
.vehicles-filter__subtitle {
    margin: 0;
    color: #111;
    font-family: var(--font-main);
    font-weight: 400;
}

.vehicles-filter__title {
    font-size: 19px;
    line-height: 1.3;
}

.vehicles-filter__subtitle {
    margin-bottom: 7px;
    font-size: 17px;
    line-height: 1.3;
}

.vehicles-filter__clear {
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: transparent;
    color: #aaa;
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    transition:
        color 0.25s ease,
        opacity 0.25s ease;
}

.vehicles-filter__clear:hover {
    color: var(--color-orange);
}

.vehicles-filter__group {
    margin-bottom: 8px;
}

.vehicles-filter__group:last-child {
    margin-bottom: 0;
}

.vehicles-filter__options {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.vehicles-filter__option {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    color: #181818;
    font-family: var(--font-main);
    font-size: 17px;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.vehicles-filter__option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.vehicles-filter__check {
    position: relative;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    border: 1px solid #d4d4d4;
    border-radius: 5px;
    background-color: #fff;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.vehicles-filter__option input:checked
    + .vehicles-filter__check {
    border-color: var(--color-orange);
    background-color: var(--color-orange);
}

.vehicles-filter__option input:checked
    + .vehicles-filter__check::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 5px;
    width: 4px;
    height: 7px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

.vehicles-filter__option input:focus-visible
    + .vehicles-filter__check {
    outline: 2px solid var(--color-orange);
    outline-offset: 2px;
}

.vehicles-filter__text {
    display: inline-block;
}

.vehicles-filter__count {
    white-space: nowrap;
}


/* =========================================================
   Rango de precios
========================================================= */

.vehicles-price {
    margin-top: 10px;
}

.vehicles-price__values {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 12px 0 15px;
    color: #111;
    font-family: var(--font-main);
    font-size: 17px;
    line-height: 1.2;
}

.vehicles-price__slider {
    --range-start: 0%;
    --range-end: 100%;

    position: relative;
    width: 100%;
    height: 22px;
}

.vehicles-price__track,
.vehicles-price__progress {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 6px;
    border-radius: 10px;
    transform: translateY(-50%);
}

.vehicles-price__track {
    background-color: #d6d6d6;
}

.vehicles-price__progress {
    left: var(--range-start);
    right: calc(100% - var(--range-end));
    background-color: var(--color-orange);
}

.vehicles-price__slider input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}

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

.vehicles-price__slider input[type="range"]::-webkit-slider-thumb {
    width: 17px;
    height: 17px;
    margin-top: -6px;
    border: 2px solid #fff;
    border-radius: 50%;
    background-color: var(--color-orange);
    box-shadow: 0 0 0 1px #bbb;
    cursor: pointer;
    pointer-events: auto;
    appearance: none;
    -webkit-appearance: none;
}

.vehicles-price__slider input[type="range"]::-moz-range-track {
    height: 6px;
    background: transparent;
}

.vehicles-price__slider input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background-color: var(--color-orange);
    box-shadow: 0 0 0 1px #bbb;
    cursor: pointer;
    pointer-events: auto;
}


/* =========================================================
   Resultados
========================================================= */

.vehicles-results {
    min-width: 0;
}

.vehicles-results__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 26px;
    transition: opacity 0.2s ease;
}

.vehicles-results__grid.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.vehicles-results__status {
    min-height: 24px;
    margin-top: 18px;
    color: #666;
    font-family: var(--font-main);
    font-size: 15px;
    text-align: center;
}

.vehicles-results__empty {
    grid-column: 1 / -1;
    padding: 55px 25px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #555;
    font-family: var(--font-main);
    font-size: 18px;
    text-align: center;
}


/* =========================================================
   Card
========================================================= */

.vehicle-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
    border: 1px solid #d2d2d2;
    border-radius: 6px;
    background-color: #fff;
}

.vehicle-card__image-link {
    display: block;
    position: relative;
    overflow: visible;
    background-color: #eee;
}

.vehicle-card__badge {
    position: absolute;
    top: -12px;
    left: -12px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background-color: var(--color-orange);
    color: #fff;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    pointer-events: none;
}

.vehicle-card__image-frame {
    overflow: hidden;
    border-radius: 5px 5px 0 0;
    background-color: #eee;
}

.vehicle-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 1.28 / 1;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.vehicle-card:hover .vehicle-card__image {
    transform: scale(1.035);
}

.vehicle-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1.28 / 1;
    color: #777;
    font-family: var(--font-main);
}

.vehicle-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 18px 16px;
}

.vehicle-card__title {
    margin: 0;
    color: #090909;
    font-family: var(--font-main);
    font-size: clamp(18px, 1.35vw, 26px);
    font-weight: 600;
    line-height: 1.18;
    text-align: center;
}

.vehicle-card__title a {
    color: inherit;
    text-decoration: none;
}

.vehicle-card__specifications {
    margin-top: 18px;
    padding: 17px 12px;
    border-top: 1px solid #d7d7d7;
    border-bottom: 1px solid #d7d7d7;
}

.vehicle-card__specification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: #111;
    font-family: var(--font-main);
    font-size: clamp(15px, 1vw, 18px);
    font-weight: 500;
    line-height: 1.25;
}

.vehicle-card__km {
    color: var(--color-orange);
    text-align: right;
    white-space: nowrap;
}

.vehicle-card__price {
    margin: 23px 0;
    color: #090909;
    font-family: var(--font-main);
    font-size: clamp(19px, 1.55vw, 19px);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.vehicle-card__actions {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-top: auto;
}

.vehicle-card__button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: 100%;
    padding: 12px 18px;
    border: 0;
    border-radius: 5px;
    color: #fff;
    font-family: var(--font-main);
    font-size: clamp(14px, 1vw, 17px);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.vehicle-card__button:hover {
    color: #fff;
    opacity: 0.88;
    transform: translateY(-1px);
}

.vehicle-card__button--information {
    background-color: var(--color-gray);
}

.vehicle-card__button--quote {
    background-color: var(--color-orange);
}


/* =========================================================
   Botón Ver más
========================================================= */

.vehicles-results__more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 280px);
    min-height: 48px;
    margin: 28px auto 0;
    padding: 12px 25px;
    border: 0;
    border-radius: 5px;
    background-color: var(--color-gray);
    color: #fff;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.vehicles-results__more[hidden] {
    display: none;
}

.vehicles-results__more:not(:disabled):hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.vehicles-results__more:disabled {
    background-color: #bdbdbb;
    color: #343434;
    cursor: not-allowed;
    opacity: 1;
}


/* =========================================================
   Responsive
========================================================= */

@media (max-width: 1200px) {
    .vehicles__layout {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 25px;
    }

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

@media (max-width: 850px) {
    .vehicles {
        padding: 30px 0 120px;
    }

    .vehicles > .container {
        z-index: 10000;
    }

    .vehicles__layout {
        grid-template-columns: 1fr;
    }

    body.vehicles-filter-modal-open {
        overflow: hidden;
    }

    .vehicles-filter-toggle {
        position: fixed;
        right: auto;
        bottom: calc(18px + env(safe-area-inset-bottom));
        left: 50%;
        z-index: 1000;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 11px;
        min-width: 155px;
        min-height: 54px;
        padding: 13px 24px;
        border: 0;
        border-radius: 999px;
        background-color: var(--color-orange);
        color: #fff;
        font-family: var(--font-main);
        font-size: 17px;
        font-weight: 700;
        line-height: 1;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
        cursor: pointer;
        transform: translateX(-50%);
        transition:
            transform 0.25s ease,
            box-shadow 0.25s ease,
            opacity 0.25s ease;
    }

    .vehicles-filter-toggle:hover {
        color: #fff;
        transform: translateX(-50%) translateY(-2px);
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
    }

    .vehicles-filter-toggle:focus-visible {
        outline: 3px solid rgba(255, 119, 20, 0.35);
        outline-offset: 4px;
    }

    .vehicles-filter-toggle__icon {
        position: relative;
        width: 20px;
        height: 14px;
    }

    .vehicles-filter-toggle__icon,
    .vehicles-filter-toggle__icon::before,
    .vehicles-filter-toggle__icon::after {
        display: block;
        border-top: 2px solid currentColor;
    }

    .vehicles-filter-toggle__icon::before,
    .vehicles-filter-toggle__icon::after {
        content: "";
        position: absolute;
        left: 0;
        width: 14px;
    }

    .vehicles-filter-toggle__icon::before {
        top: 5px;
    }

    .vehicles-filter-toggle__icon::after {
        top: 12px;
        width: 8px;
    }

    .vehicles-filter-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1001;
        display: block;
        background-color: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 0.25s ease,
            visibility 0.25s ease;
    }

    .vehicles-filter-backdrop[hidden] {
        display: none;
    }

    .vehicles-filter-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    .vehicles-filter {
        position: fixed;
        right: auto;
        bottom: 0;
        left: 50%;
        z-index: 1002;
        width: min(calc(100% - 24px), 460px);
        max-height: min(82vh, 680px);
        padding: 24px 22px 22px;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -14px 35px rgba(0, 0, 0, 0.24);
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, calc(100% + 24px));
        transition:
            transform 0.28s ease,
            opacity 0.28s ease;
    }

    .vehicles-filter.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translate(-50%, 0);
    }

    .vehicles-filter__header {
        position: sticky;
        top: -24px;
        z-index: 1;
        margin: -24px -22px 22px;
        padding: 22px 22px 16px;
        border-bottom: 1px solid #ececec;
        background-color: #fff;
    }

    .vehicles-filter__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 1px solid #dedede;
        border-radius: 50%;
        background-color: #fff;
        color: #111;
        font-family: Arial, sans-serif;
        font-size: 25px;
        line-height: 1;
        cursor: pointer;
    }

    .vehicles-filter__close:focus-visible,
    .vehicles-filter__apply:focus-visible {
        outline: 3px solid rgba(255, 119, 20, 0.35);
        outline-offset: 3px;
    }

    .vehicles-filter__apply {
        position: sticky;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: min(100%, 220px);
        min-height: 50px;
        margin: 24px auto 0;
        padding: 13px 22px;
        border: 0;
        border-radius: 999px;
        background-color: var(--color-orange);
        color: #fff;
        font-family: var(--font-main);
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
    }
}

@media (max-width: 580px) {
    .vehicles-results__grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .vehicles-filter {
        padding: 23px 20px 24px;
    }

    .vehicles-filter__header {
        top: -23px;
        margin: -23px -20px 22px;
        padding: 21px 20px 15px;
    }

    .vehicles-filter__apply {
        margin: 24px auto 0;
    }

    .vehicle-card__title {
        font-size: 23px;
    }

    .vehicle-card__specification {
        font-size: 17px;
    }

    .vehicle-card__price {
        font-size: 19px;
    }

    .vehicle-card__button {
        min-height: 54px;
        font-size: 17px;
    }
}

/* SINGLE */

/* =========================================================
   Nuevos ingresos
========================================================= */

.new-vehicles {
    padding: 65px 0 80px;
    background-color: #fff;
}

.new-vehicles__header {
    max-width: 950px;
    margin: 0 auto 42px;
    text-align: center;
}

.new-vehicles__title {
    margin: 0;
    color: var(--color-black);
    font-family: var(--font-header);
    font-size: clamp(35px, 4vw, 52px);
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
}

.new-vehicles__subtitle {
    margin: 7px 0 0;
    color: var(--color-black);
    font-family: var(--font-main);
    font-size: clamp(16px, 1.5vw, 20px);
    line-height: 1.4;
}

.new-vehicles__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 38px;
}

/*
 * Ajustes de las tarjetas únicamente
 * dentro de Nuevos ingresos.
 */
.new-vehicles .vehicle-card__title {
    font-size: clamp(18px, 1.3vw, 23px);
}

.new-vehicles .vehicle-card__body {
    padding: 17px 17px 15px;
}

.new-vehicles .vehicle-card__specifications {
    margin-top: 14px;
    padding: 13px 7px;
}

.new-vehicles .vehicle-card__specification {
    font-size: 15px;
}

.new-vehicles .vehicle-card__price {
    margin: 18px 0;
    font-size: clamp(19px, 2vw, 19px);
}

.new-vehicles .vehicle-card__button {
    min-height: 48px;
    font-size: 15px;
}

@media (max-width: 1200px) {
    .new-vehicles__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 28px;
    }
}

@media (max-width: 900px) {
    .new-vehicles__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 580px) {
    .new-vehicles {
        padding: 45px 0 60px;
    }

    .new-vehicles__header {
        margin-bottom: 30px;
    }

    .new-vehicles__grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}
