/**
 * Vehículos CR – Favoritos del catálogo
 * Frontend 1.2.0
 */

.vcrgc-gallery > .vcrf-heart {
    position: absolute;
    left: 7px;
    bottom: 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;
}

.vcrgc-gallery > .vcrf-heart:hover,
.vcrgc-gallery > .vcrf-heart: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 > .vcrf-heart svg {
    width: 16px;
    height: 16px;
    overflow: visible;
    fill: transparent;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linejoin: round;
    transition: fill 150ms ease, stroke 150ms ease, transform 150ms ease;
}

.vcrgc-gallery > .vcrf-heart.is-favorite {
    background: rgba(210, 27, 55, 0.86);
    border-color: rgba(255, 255, 255, 0.70);
    color: #ffffff;
}

.vcrgc-gallery > .vcrf-heart.is-favorite svg {
    fill: currentColor;
    stroke: currentColor;
    transform: scale(1.04);
}

.vcrf-floating {
    position: fixed;
    right: var(--vcrf-floating-right, 18px);
    bottom: var(--vcrf-floating-bottom, 18px);
    z-index: 9997;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: #004aad;
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 43, 105, 0.26);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none !important;
}

.vcrf-floating[hidden] { display: none !important; }
.vcrf-floating:hover,
.vcrf-floating:focus-visible { background: #003b89; outline: none; transform: translateY(-1px); }
.vcrf-floating__heart { color: #ffffff; font-size: 16px; }

.vcrf-toast {
    position: fixed;
    left: 50%;
    bottom: 78px;
    z-index: 100000;
    max-width: min(88vw, 420px);
    padding: 11px 16px;
    border-radius: 9px;
    background: rgba(7, 22, 36, 0.94);
    color: #ffffff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.vcrf-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.vcrf-toast[data-type="warning"] { background: rgba(122, 55, 7, 0.96); }

.vcrf-context-mount {
    display: grid;
    gap: 3px;
    width: 100%;
    margin: 0 0 14px;
    padding: 11px 14px;
    border: 1px solid #b9ddff;
    border-radius: 9px;
    background: #eef7ff;
    color: #123f69;
    box-sizing: border-box;
}

.vcrf-context-mount[hidden] { display: none !important; }
.vcrf-context-mount strong { font-size: 13px; }
.vcrf-context-mount strong em { margin-left: 5px; font-style: normal; font-weight: 800; }
.vcrf-context-mount span { font-size: 12px; line-height: 1.45; }
.vcrf-context-mount.is-warning { border-color: #f0d29b; background: #fff8e9; color: #684512; }

.vcrf-selection {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 24px 16px 48px;
    box-sizing: border-box;
}

.vcrf-selection__header { margin-bottom: 18px; }
.vcrf-selection__eyebrow { margin: 0 0 4px; color: #004aad; font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.vcrf-selection__header h1 { margin: 0 0 7px; color: #10283d; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; }
.vcrf-selection__header p { margin: 0; color: #52687a; font-size: 15px; }

.vcrf-selection__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 22px;
    align-items: start;
}

.vcrf-selection__status { margin: 0 0 10px; padding: 9px 12px; border: 1px solid #f0d29b; border-radius: 8px; background: #fff8e9; color: #6a4a16; font-size: 12px; font-weight: 700; line-height: 1.35; }
.vcrf-selection__status[hidden] { display: none !important; }
.vcrf-selection__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.vcrf-product {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    overflow: hidden;
    min-width: 0;
    border: 1px solid #dce6ee;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(16, 40, 61, 0.07);
}

.vcrf-product__image { display: block; min-height: 100%; background: #eef2f5; }
.vcrf-product__image img { display: block; width: 100%; height: 100%; min-height: 190px; object-fit: cover; }
.vcrf-product__body { display: flex; flex-direction: column; min-width: 0; padding: 13px; }
.vcrf-product__id { align-self: flex-start; margin-bottom: 5px; padding: 2px 7px; border: 1px solid #dbe5ee; border-radius: 999px; background: #f4f7fa; color: #496176; font-size: 9px; font-weight: 750; }
.vcrf-product h2 { margin: 0 0 10px; font-size: 16px; line-height: 1.22; }
.vcrf-product h2 a { color: #004aad; text-decoration: none; }
.vcrf-product__price,
.vcrf-product__payment { display: grid; gap: 2px; margin-bottom: 9px; }
.vcrf-product__price > span,
.vcrf-product__payment > span { color: #667987; font-size: 10px; font-weight: 750; }
.vcrf-product__price strong { color: #db0505; font-size: 17px; line-height: 1.15; }
.vcrf-product__payment strong { color: #004aad; font-size: 17px; line-height: 1.15; }
.vcrf-product__payment small { margin-left: 3px; font-size: 10px; }
.vcrf-product__controls { display: flex; gap: 8px; margin-top: auto; padding-top: 7px; }
.vcrf-product__open,
.vcrf-product__remove { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 10px; border-radius: 7px; font-size: 11px; font-weight: 800; text-decoration: none !important; }
.vcrf-product__open { flex: 1; border: 1px solid #004aad; background: #004aad; color: #ffffff !important; }
.vcrf-product__remove { border: 1px solid #dce4ea; background: #ffffff; color: #667987; cursor: pointer; }

.vcrf-selection__actions {
    position: sticky;
    top: var(--vcrf-sticky-top, 146px);
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid #dce6ee;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(16, 40, 61, 0.08);
    align-self: start;
    max-height: calc(100vh - var(--vcrf-sticky-top, 146px) - 18px);
    overflow: auto;
    overscroll-behavior: contain;
}
.vcrf-selection__actions[hidden] { display: none !important; }
.vcrf-selection__actions h2 { margin: 0; color: #10283d; font-size: 20px; }
.vcrf-selection__actions p { margin: 0 0 5px; color: #52687a; font-size: 12px; font-weight: 750; }
.vcrf-selection__actions small { margin-top: 5px; color: #718390; font-size: 10px; line-height: 1.45; }

.vcrf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
}
.vcrf-button--primary { width: auto; background: #004aad; color: #ffffff !important; }
.vcrf-button--whatsapp { background: #20c96b; color: #ffffff !important; }
.vcrf-button--email { background: #004aad; color: #ffffff !important; }
.vcrf-button--secondary { border-color: #bfd0dd; background: #f6f9fb; color: #24445e; }
.vcrf-button--clear { border: 0; background: transparent; color: #8a4d4d; min-height: 34px; }
.vcrf-button[aria-busy="true"] { opacity: .72; cursor: progress; }

.vcrf-selection__empty { padding: 50px 18px; border: 1px dashed #cbd8e1; border-radius: 12px; background: #f8fafb; text-align: center; }
.vcrf-selection__empty[hidden] { display: none !important; }
.vcrf-selection__empty-icon { display: block; margin-bottom: 7px; color: #c5d1da; font-size: 52px; line-height: 1; }
.vcrf-selection__empty h2 { margin: 0 0 7px; color: #223b50; }
.vcrf-selection__empty p { margin: 0 0 18px; color: #667987; }

@media (max-width: 980px) {
    .vcrf-selection__layout { grid-template-columns: 1fr; }
    .vcrf-selection__actions { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 720px) {
    .vcrgc-gallery > .vcrf-heart { left: 6px; bottom: 6px; width: 27px; height: 27px; }
    .vcrgc-gallery > .vcrf-heart svg { width: 15px; height: 15px; }
    .vcrf-floating { right: 12px; bottom: 76px; min-height: 42px; padding: 9px 13px; font-size: 11.5px; }
    .vcrf-toast { bottom: 126px; }
    .vcrf-selection { padding: 18px 11px 36px; }
    .vcrf-selection__grid { grid-template-columns: 1fr; }
    .vcrf-product { grid-template-columns: 118px minmax(0, 1fr); }
    .vcrf-product__image img { min-height: 176px; }
    .vcrf-product__body { padding: 10px; }
    .vcrf-product h2 { font-size: 14px; }
    .vcrf-product__price strong,
    .vcrf-product__payment strong { font-size: 15px; }
}

@media (max-width: 430px) {
    .vcrf-product { grid-template-columns: 105px minmax(0, 1fr); }
    .vcrf-product__image img { min-height: 170px; }
    .vcrf-product__controls { flex-direction: column; }
    .vcrf-product__open,
    .vcrf-product__remove { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .vcrf-heart,
    .vcrf-floating,
    .vcrf-toast { transition: none !important; }
}


/* v1.2.2: el enlace se prepara antes de abrir WhatsApp. */
.vcrf-button.is-preparing,
.vcrf-button[aria-disabled="true"] {
    opacity: .72;
    cursor: progress;
}
