/* ChileWheels Adventures · ui.css
   Componentes transversales: selector de idioma, burbuja de WhatsApp
   y ajustes de grilla. Se carga en todas las páginas. */

/* ===============================================================
   Selector de idioma fijo
   =============================================================== */
.lang-switch {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 9500;
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 14px rgba(0, 0, 0, .14);
}

.lang-btn {
    border: 0;
    cursor: pointer;
    padding: 6px 13px;
    border-radius: 999px;
    background: transparent;
    color: #16212B;
    font: 700 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    letter-spacing: .04em;
    transition: background .2s ease, color .2s ease;
}

.lang-btn:hover { background: rgba(0, 0, 0, .06); }

.lang-btn.active {
    background: #0F3D5C;
    color: #fff;
}

@media (max-width: 768px) {
    .lang-switch { top: auto; bottom: 14px; left: 14px; right: auto; }
    .lang-btn { padding: 5px 11px; font-size: 12px; }
}

/* ===============================================================
   Cartel de bienvenida de idioma
   =============================================================== */
.lang-gate {
    position: fixed;
    inset: 0;
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.lang-gate.open { opacity: 1; pointer-events: auto; }

.lang-gate-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 18, .72);
    backdrop-filter: blur(4px);
}

.lang-gate-card {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 2.4rem 2rem 2rem;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    transform: translateY(18px) scale(.97);
    transition: transform .34s cubic-bezier(.2, .8, .2, 1);
}

.lang-gate.open .lang-gate-card { transform: translateY(0) scale(1); }

.lang-gate-logo {
    width: 150px;
    height: auto;
    margin: 0 auto 1.4rem;
    display: block;
}

.lang-gate-title {
    margin: 0 0 .35rem;
    font: 600 1.06rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #16212B;
}

.lang-gate-title-en {
    margin-bottom: 1.6rem;
    font-size: .95rem;
    font-weight: 400;
    color: #6B7785;
}

.lang-gate-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
}

.lang-gate-btn {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: 1rem .8rem;
    border: 1px solid #D7DFE6;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.lang-gate-btn:hover {
    border-color: #0F3D5C;
    background: #F4F8FB;
    transform: translateY(-2px);
}

.lang-gate-btn strong {
    font-size: 1.02rem;
    color: #16212B;
}

.lang-gate-btn span {
    font-size: .78rem;
    color: #8899A8;
}

@media (max-width: 420px) {
    .lang-gate-actions { grid-template-columns: 1fr; }
}

/* ===============================================================
   Burbuja del botón de WhatsApp
   =============================================================== */
.wa-bubble {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    white-space: nowrap;
    background: #fff;
    color: #16212B;
    padding: .55rem .95rem;
    border-radius: 999px;
    font: 600 .82rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease, transform .4s ease;
}

.wa-bubble::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #fff;
}

.wa-bubble.visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 560px) {
    .wa-bubble { display: none; }
}

/* ===============================================================
   Ajustes de grilla y tarjetas de destino enlazadas
   =============================================================== */
.vehicles-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

a.destination-card-float {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform .3s ease, box-shadow .3s ease;
}

a.destination-card-float:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

/* Reserva el alto de las imágenes para que la página no salte
   mientras cargan (evita el CLS que penaliza Google). */
.vehicle-image-wrapper { aspect-ratio: 4 / 3; overflow: hidden; }
.vehicle-image { width: 100%; height: 100%; object-fit: cover; }

/* Quien prefiere menos animación, no la recibe. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
