/**
 * Home: bloque “Destinos destacados” con ventanillas (fila horizontal tipo fuselaje).
 * Alcance: solo dentro de .destinations-section--plane
 */

/* Un solo recorrido: izquierda (inicio) → derecha (fin); forwards mantiene el fin mientras hay hover */
@keyframes plane-glass-pan-right {
    from {
        object-position: 0% 42%;
    }

    to {
        object-position: 100% 42%;
    }
}

.destinations-section.destinations-section--plane {
    position: relative;
    padding: 5rem 1.5rem 5.5rem;
    /* Mapa: --destinations-plane-bg la define home.php (URL absoluta). Fallback relativo por si el inline falta. */
    background-color: var(--light);
    background-image: linear-gradient(
            rgba(243, 246, 249, 0.48),
            rgba(243, 246, 249, 0.62)
        ),
        var(--destinations-plane-bg, url('../../images/home/mapa-destinos.webp'));
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    /* scroll: más fiable en hosting/CDN; fixed a veces deja la capa de imagen sin pintar */
    background-attachment: scroll;
}

@media (hover: hover) and (pointer: fine) {
    .destinations-section.destinations-section--plane {
        background-attachment: fixed;
    }
}

@media (prefers-reduced-motion: reduce) {
    .destinations-section.destinations-section--plane {
        background-attachment: scroll !important;
    }
}

/* En dispositivos táctiles fixed con fondo de sección suele fallar o ir a tirones; scroll mantiene el mapa estable */
@media (hover: none) and (pointer: coarse) {
    .destinations-section.destinations-section--plane {
        background-attachment: scroll !important;
    }
}

.destinations-section--plane .section-header {
    margin-bottom: 2.75rem;
}

/* Halo suave para que el encabezado siga leyéndose con el mapa más visible */
.destinations-section--plane .section-badge,
.destinations-section--plane .section-title,
.destinations-section--plane .section-subtitle {
    text-shadow: 0 0 0.35em rgba(255, 255, 255, 0.95), 0 0 0.85em rgba(255, 255, 255, 0.75);
}

.destinations-section--plane .section-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    color: #000;
}

.destinations-section--plane .section-subtitle {
    font-size: 1rem;
    color: #000;
}

.destinations-section--plane .section-badge {
    color: #000;
}

.destinations-section--plane .home-destinations-fuselage {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 0 0.75rem 0.25rem;
}

.destinations-section--plane .destinations-grid.destinations-grid--plane-fuselage {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: clamp(0.5rem, 2vw, 1.25rem);
    width: max-content;
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

.destinations-section--plane .destination-card.destination-card--plane {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    flex: 0 0 clamp(132px, 22vw, 200px);
    width: clamp(132px, 22vw, 200px);
    height: auto;
    min-height: 0;
    overflow: visible;
    border-radius: 0;
    padding: 0 0.2rem 0.75rem;
    background: transparent;
    box-shadow: none;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.destinations-section--plane .destination-card.destination-card--plane:hover {
    transform: none;
    box-shadow: none;
}

.destinations-section--plane .destination-plane-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    gap: 1rem;
}

.destinations-section--plane .destination-plane-window {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    /*
     * Altura fija desde el ancho (824:1023). Con solo hijos absolute, aspect-ratio a veces colapsa en flex
     * y una columna (p. ej. Mérida) quedaba más baja con bandas vacías.
     */
    height: 0;
    padding-bottom: calc(100% * 1023 / 824);
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    --plane-glass-inset-t: 16.5%;
    --plane-glass-inset-r: 10%;
    --plane-glass-inset-b: 20%;
    --plane-glass-inset-l: 10%;
    --plane-glass-round: 47%;
}

/* PNG ya recortado a 824×1023: sin zoom extra; foto y marco alineados */
.destinations-section--plane .destination-plane-window__inner {
    position: absolute;
    inset: 0;
}

.destinations-section--plane .destination-plane-window__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    clip-path: inset(
        var(--plane-glass-inset-t) var(--plane-glass-inset-r) var(--plane-glass-inset-b)
            var(--plane-glass-inset-l) round var(--plane-glass-round)
    );
    -webkit-clip-path: inset(
        var(--plane-glass-inset-t) var(--plane-glass-inset-r) var(--plane-glass-inset-b)
            var(--plane-glass-inset-l) round var(--plane-glass-round)
    );
}

.destinations-section--plane .destination-plane-window__media img {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Estado inicial: encuadre al extremo izquierdo (no centrado) */
    object-position: 0% 42%;
    display: block;
    /* Al quitar el hover, vuelve suave al extremo izquierdo */
    transition: object-position 0.85s ease;
}

/* Hover en toda la tarjeta (ventanilla o texto debajo): pan de la foto detrás del cristal */
.destinations-section--plane .destination-card.destination-card--plane:hover .destination-plane-window__media img {
    animation: plane-glass-pan-right 6.5s ease-in-out forwards;
    transform: none;
    will-change: object-position;
}

@media (prefers-reduced-motion: reduce) {
    .destinations-section--plane .destination-card.destination-card--plane:hover .destination-plane-window__media img {
        animation: none;
        object-position: 100% 42%;
        will-change: auto;
    }
}

/* Franja especular nítida (screen se ve bien sobre fotos claras u oscuras; soft-light casi no actúa) */
.destinations-section--plane .destination-plane-window__media::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        118deg,
        transparent 40%,
        rgba(255, 255, 255, 0.34) 47%,
        rgba(255, 255, 255, 0.62) 50%,
        rgba(255, 255, 255, 0.3) 52.5%,
        transparent 60%
    );
    mix-blend-mode: screen;
    opacity: 0.42;
}

.destinations-section--plane .destination-plane-window__glare {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    /* Mancha de luz arriba-derecha + velo superior */
    background:
        radial-gradient(
            ellipse 120% 62% at 82% 12%,
            rgba(255, 255, 255, 0.62) 0%,
            rgba(255, 255, 255, 0.13) 42%,
            transparent 64%
        ),
        linear-gradient(
            168deg,
            rgba(255, 255, 255, 0.26) 0%,
            transparent 32%
        );
    mix-blend-mode: screen;
    opacity: 0.38;
}

/* Anula el zoom de home.css sobre la foto al hover de la tarjeta (el movimiento es el pan en la ventanilla) */
.destinations-section--plane .destination-card.destination-card--plane:hover .destination-plane-window__media img {
    transform: none;
}

.destinations-section--plane .destination-plane-window__frame-wrap {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    filter: none;
    transform: translateZ(0);
}

.destinations-section--plane .destination-plane-window__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    user-select: none;
    transition: none;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: none;
}

.destinations-section--plane .destination-card.destination-card--plane:hover .destination-plane-window__frame {
    transform: none;
}

.destinations-section--plane .destination-plane-meta {
    text-align: center;
    width: 100%;
    max-width: 12.5rem;
    margin: 0 auto;
    padding: 0 0.15rem;
}

.destinations-section--plane .destination-plane-meta .destination-name,
.destinations-section--plane .destination-plane-meta .destination-desc {
    text-shadow: 0 0 0.3em rgba(255, 255, 255, 0.92), 0 0 0.65em rgba(255, 255, 255, 0.7);
}

.destinations-section--plane .destination-plane-meta .destination-name {
    font-size: clamp(0.98rem, 2.65vw, 1.18rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 0.4rem;
    color: #000;
}

.destinations-section--plane .destination-plane-meta .destination-desc {
    color: #000;
    font-size: clamp(0.74rem, 1.85vw, 0.9rem);
    line-height: 1.4;
    opacity: 1;
    margin: 0;
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

.destinations-section--plane .view-all-container {
    margin-top: 2.5rem;
}

.destinations-section--plane .view-all-container .btn-primary {
    color: #000;
}
