/**
 * Vehículos CR – Comparador de vehículos
 * Frontend 1.0.2
 */

.vcrgc-gallery > .vcrcmp-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 999px;
    background: rgba(7, 22, 36, 0.38);
    color: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.16);
    -webkit-backdrop-filter: blur(4px) saturate(108%);
    backdrop-filter: blur(4px) saturate(108%);
    cursor: pointer;
    line-height: 1;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.vcrgc-gallery > .vcrcmp-toggle:hover,
.vcrgc-gallery > .vcrcmp-toggle:focus-visible {
    background: rgba(7, 22, 36, 0.62);
    border-color: rgba(255, 255, 255, 0.58);
    outline: none;
    transform: scale(1.055);
}

.vcrgc-gallery > .vcrcmp-toggle svg,
.vcrcmp-floating svg {
    width: 16px;
    height: 16px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vcrgc-gallery > .vcrcmp-toggle.is-comparing {
    background: rgba(47, 88, 232, 0.92);
    border-color: rgba(255, 255, 255, 0.76);
    color: #fff;
    box-shadow: 0 2px 9px rgba(20, 57, 175, 0.32);
}

.vcrcmp-floating,
.vcrcmp-dialog,
.vcrcmp-toast,
.vcrcmp-favorite-action {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.vcrcmp-floating {
    position: fixed;
    right: var(--vcrcmp-floating-right, 18px);
    bottom: var(--vcrcmp-floating-bottom, 76px);
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255,255,255,.50);
    border-radius: 999px;
    background: #2f58e8;
    color: #fff;
    box-shadow: 0 8px 24px rgba(20,57,175,.25);
    cursor: pointer;
    transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}
.vcrcmp-floating[hidden] { display: none !important; }
.vcrcmp-floating:hover,
.vcrcmp-floating:focus-visible {
    background: #2448c7;
    outline: 2px solid rgba(53,111,224,.20);
    outline-offset: 2px;
    transform: translateY(-1px);
}
.vcrcmp-floating[aria-busy="true"] { cursor: progress; opacity: .82; }
.vcrcmp-floating:not(.is-ready) { background: #5a687b; }
.vcrcmp-floating svg { width: 18px; height: 18px; }
.vcrcmp-floating__count {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #fff;
    color: #2f58e8;
    box-shadow: 0 2px 7px rgba(16,24,40,.16);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
}

.vcrcmp-toast {
    position: fixed;
    left: 50%;
    bottom: 92px;
    z-index: 100002;
    max-width: min(92vw, 520px);
    padding: 10px 13px;
    border-radius: 7px;
    background: #172033;
    color: #fff;
    box-shadow: 0 8px 28px rgba(16,24,40,.22);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 140ms ease, transform 140ms ease;
}
.vcrcmp-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.vcrcmp-toast[data-type="warning"] { background: #6a4a16; }

.vcrcmp-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5vh 2vw;
    background: rgba(10,18,31,.66);
}
.vcrcmp-overlay[hidden] { display: none !important; }

.vcrcmp-dialog {
    width: min(96vw, 1680px);
    max-width: 1680px;
    min-width: 0;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    box-shadow: 0 24px 70px rgba(7,22,36,.28);
}

.vcrcmp-dialog__top {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #d7dee8;
    background: #fff;
}
.vcrcmp-dialog__heading { min-width: 0; margin-right: auto; }
.vcrcmp-dialog__eyebrow { margin: 0 0 2px; color: #0b4fb3; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.vcrcmp-dialog__top h2 { margin: 0; color: #073e91; font-size: 27px; line-height: 1.18; }
.vcrcmp-dialog__top p { margin: 4px 0 0; color: #5a687b; font-size: 12.5px; line-height: 1.4; }
.vcrcmp-dialog__close {
    appearance: none;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 1px solid #d7dee8;
    border-radius: 7px;
    background: #fff;
    color: #172033;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}
.vcrcmp-dialog__close:hover,
.vcrcmp-dialog__close:focus-visible { border-color: #8ea4de; outline: 2px solid rgba(53,111,224,.16); }

.vcrcmp-scroll {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: auto;
    overscroll-behavior: contain;
}

.vcrcmp-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
    padding: 10px 18px 0;
}
.vcrcmp-diff-toggle { display: inline-flex; align-items: center; gap: 8px; color: #243b7a; font-size: 13px; font-weight: 750; cursor: pointer; }
.vcrcmp-diff-toggle input { width: 17px; height: 17px; margin: 0; accent-color: #2f58e8; }
.vcrcmp-clear-comparison {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid #8ea4de;
    border-radius: 999px;
    background: #fff;
    color: #243b7a;
    cursor: pointer;
}
.vcrcmp-clear-comparison svg { display: block; width: 17px; height: 17px; }
.vcrcmp-clear-comparison:hover { filter: brightness(.97); transform: translateY(-1px); }
.vcrcmp-clear-comparison:focus-visible { outline: 2px solid rgba(53,111,224,.16); outline-offset: 2px; }

.vcrcmp-hero-grid,
.vcrcmp-row {
    --vcrcmp-label: minmax(150px, .42fr);
    display: grid;
    grid-template-columns: var(--vcrcmp-label) repeat(var(--vcrcmp-count, 2), minmax(0, 1fr));
    min-width: 0;
}
.vcrcmp-hero-grid { gap: 12px; padding: 12px 18px 14px; }
.vcrcmp-hero-spacer { min-width: 0; }
.vcrcmp-hero-card {
    display: grid;
    grid-template-columns: minmax(145px, 38%) minmax(0, 1fr);
    min-width: 0;
    min-height: 176px;
    overflow: hidden;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.vcrcmp-hero-card__image { width: 100%; min-width: 0; height: 176px; background: #eef2f5; overflow: hidden; }
.vcrcmp-hero-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vcrcmp-hero-card__body { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; padding: 12px 13px; }
.vcrcmp-hero-card h3 { margin: 0 0 4px; color: #073e91; font-size: 16px; line-height: 1.22; overflow-wrap: anywhere; }
.vcrcmp-hero-card__id { margin: 0 0 8px; color: #5a687b; font-size: 10.5px; font-weight: 750; }
.vcrcmp-hero-card__price { margin: 0 0 3px; color: #db0505; font-size: 20px; font-weight: 800; line-height: 1.18; }
.vcrcmp-hero-card__price del { opacity: .58; font-size: .74em; font-weight: 650; }
.vcrcmp-hero-card__price ins { text-decoration: none; }
.vcrcmp-hero-card__payment { margin: 0 0 8px; color: #0b4fb3; font-size: 15px; font-weight: 800; }
.vcrcmp-hero-card__payment small { font-size: 10px; font-weight: 650; }
.vcrcmp-view-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    color: #243b7a !important;
    font-size: 11.5px;
    font-weight: 750;
    text-decoration: none !important;
}
.vcrcmp-view-link:hover,
.vcrcmp-view-link:focus-visible { color: #0b4fb3 !important; text-decoration: underline !important; outline: none; }

.vcrcmp-section { border-top: 1px solid #e5eaf0; }
.vcrcmp-section[hidden] { display: none !important; }
.vcrcmp-section__title {
    margin: 0;
    padding: 10px 18px;
    color: #073e91;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    background: #f6f8fb;
}
.vcrcmp-section__rows { min-width: 0; }
.vcrcmp-row { border-top: 1px solid #eef1f5; }
.vcrcmp-row[hidden] { display: none !important; }
.vcrcmp-row__label,
.vcrcmp-row__value { min-width: 0; padding: 9px 11px; overflow-wrap: anywhere; }
.vcrcmp-row__label { color: #5a687b; font-size: 11.5px; font-weight: 800; background: #fbfcfd; }
.vcrcmp-row__value { border-left: 1px solid #eef1f5; color: #172033; font-size: 12.5px; font-weight: 650; }
.vcrcmp-row__value del { opacity: .58; }
.vcrcmp-row__value ins { text-decoration: none; }

.vcrcmp-mobile-comparison { display: none; }
.vcrcmp-mobile-nav,
.vcrcmp-mobile-list,
.vcrcmp-mobile-card,
.vcrcmp-mobile-card * { box-sizing: border-box; }

.vcrcmp-legal { margin: 0; padding: 13px 18px 18px; color: #5a687b; font-size: 11px; line-height: 1.45; }

.vcrcmp-favorite-action {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid #8ea4de;
    border-radius: 999px;
    background: #fff;
    color: #243b7a;
    cursor: pointer;
    transition: filter .12s ease, transform .12s ease, box-shadow .12s ease;
}
.vcrcmp-favorite-action svg { display: block; width: 18px; height: 18px; }
.vcrcmp-favorite-action.is-comparing { border-color: #356fe0; background: #eef5ff; color: #0b4fb3; }
.vcrcmp-favorite-action:hover { filter: brightness(.97); transform: translateY(-1px); }
.vcrcmp-favorite-action:focus-visible { outline: 2px solid rgba(53,111,224,.16); outline-offset: 2px; }
.vcrcmp-sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.vcrcmp-modal-open { overflow: hidden; }

@media (max-width: 1100px) {
    .vcrcmp-hero-card { grid-template-columns: minmax(122px, 36%) minmax(0, 1fr); }
    .vcrcmp-hero-card__image { height: 168px; }
    .vcrcmp-hero-card h3 { font-size: 15px; }
    .vcrcmp-hero-card__price { font-size: 18px; }
}

@media (max-width: 980px) {
    .vcrcmp-overlay { padding: 0; }
    .vcrcmp-dialog { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
    .vcrcmp-dialog__top { padding: 12px; }
    .vcrcmp-dialog__top h2 { font-size: 23px; }
    .vcrcmp-dialog__top p { font-size: 12px; }
    .vcrcmp-toolbar { padding: 10px 12px; justify-content: space-between; border-bottom: 1px solid #e5eaf0; }
    .vcrcmp-desktop-comparison { display: none; }
    .vcrcmp-mobile-comparison { display: block; min-width: 0; }

    .vcrcmp-mobile-nav {
        position: sticky;
        top: 0;
        z-index: 6;
        display: grid;
        grid-template-columns: repeat(var(--vcrcmp-mobile-count, 3), minmax(0, 1fr));
        gap: 6px;
        padding: 8px 10px;
        border-bottom: 1px solid #d7dee8;
        background: rgba(255,255,255,.97);
        box-shadow: 0 4px 12px rgba(16,24,40,.06);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }
    .vcrcmp-mobile-nav button {
        appearance: none;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: 0;
        min-height: 38px;
        padding: 6px 8px;
        border: 1px solid #8ea4de;
        border-radius: 7px;
        background: #fff;
        color: #243b7a;
        font: inherit;
        font-size: 10.5px;
        font-weight: 750;
        cursor: pointer;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .vcrcmp-mobile-nav__number {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        border-radius: 999px;
        background: #eef3ff;
        color: #163cae;
        font-size: 9.5px;
        font-weight: 850;
    }
    .vcrcmp-mobile-nav__label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .vcrcmp-mobile-nav button:hover,
    .vcrcmp-mobile-nav button:focus-visible { outline: 2px solid rgba(53,111,224,.16); outline-offset: 1px; }

    .vcrcmp-mobile-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; padding: 12px 10px 4px; min-width: 0; }
    .vcrcmp-mobile-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        border: 1px solid #d7dee8;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(16,24,40,.04);
        scroll-margin-top: 58px;
    }
    .vcrcmp-mobile-card__head { display: grid; grid-template-columns: minmax(116px, 30%) minmax(0,1fr); min-width: 0; }
    .vcrcmp-mobile-card__image { min-width: 0; min-height: 145px; background: #eef2f5; overflow: hidden; }
    .vcrcmp-mobile-card__image img { display: block; width: 100%; height: 100%; min-height: 145px; object-fit: cover; }
    .vcrcmp-mobile-card__summary { position: relative; min-width: 0; padding: 11px 12px; }
    .vcrcmp-mobile-card__number {
        position: absolute;
        top: 8px;
        right: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 23px;
        height: 23px;
        border-radius: 999px;
        background: #eef3ff;
        color: #163cae;
        font-size: 11px;
        font-weight: 850;
    }
    .vcrcmp-mobile-card h3 { margin: 0 28px 4px 0; color: #073e91; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
    .vcrcmp-mobile-card__id { margin-bottom: 8px; color: #5a687b; font-size: 10px; font-weight: 750; }
    .vcrcmp-mobile-card__price { margin-bottom: 3px; color: #db0505; font-size: 18px; font-weight: 800; line-height: 1.18; }
    .vcrcmp-mobile-card__price del { opacity: .58; font-size: .74em; }
    .vcrcmp-mobile-card__price ins { text-decoration: none; }
    .vcrcmp-mobile-card__payment { color: #0b4fb3; font-size: 14px; font-weight: 800; }
    .vcrcmp-mobile-card__payment small { font-size: 10px; }
    .vcrcmp-mobile-card__details { min-width: 0; }
    .vcrcmp-mobile-section[hidden] { display: none !important; }
    .vcrcmp-mobile-section h4 { margin: 0; padding: 8px 11px; border-top: 1px solid #e5eaf0; background: #f6f8fb; color: #073e91; font-size: 12px; font-weight: 800; }
    .vcrcmp-mobile-field { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 10px; min-width: 0; padding: 8px 11px; border-top: 1px solid #eef1f5; }
    .vcrcmp-mobile-field[hidden] { display: none !important; }
    .vcrcmp-mobile-field span { min-width: 0; color: #5a687b; font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
    .vcrcmp-mobile-field strong { min-width: 0; color: #172033; font-size: 11.5px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
    .vcrcmp-mobile-card__link { display: inline-flex; align-items: center; gap: 4px; margin: 10px 11px 12px; color: #243b7a !important; font-size: 11.5px; font-weight: 750; text-decoration: none !important; }
    .vcrcmp-mobile-card__link:hover,
    .vcrcmp-mobile-card__link:focus-visible { color: #0b4fb3 !important; text-decoration: underline !important; outline: none; }
    .vcrcmp-legal { padding: 12px 10px 18px; }
}

@media (max-width: 720px) {
    .vcrgc-gallery > .vcrcmp-toggle { top: 6px; right: 6px; width: 27px; height: 27px; }
    .vcrgc-gallery > .vcrcmp-toggle svg { width: 15px; height: 15px; }
    .vcrcmp-floating { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
    .vcrcmp-toast { bottom: 126px; }
    .vcrcmp-dialog__heading p { display: none; }
    .vcrcmp-toolbar { gap: 8px; }
    .vcrcmp-diff-toggle { font-size: 11.5px; }
}

@media (max-width: 430px) {
    .vcrcmp-dialog__top h2 { font-size: 21px; }
    .vcrcmp-mobile-card__head { grid-template-columns: 105px minmax(0,1fr); }
    .vcrcmp-mobile-card__image,
    .vcrcmp-mobile-card__image img { min-height: 142px; }
    .vcrcmp-mobile-field { grid-template-columns: minmax(0,.82fr) minmax(0,1.18fr); }
    .vcrcmp-mobile-nav button { font-size: 9.8px; padding: 6px 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .vcrgc-gallery > .vcrcmp-toggle,
    .vcrcmp-floating,
    .vcrcmp-toast { transition: none !important; }
}
