/* ============================================
   ENCAPSULADO NISSAN - Que te mueve
   Prefijo: txp-nissan-
   No interfiere con estilos globales
   ============================================ */
/* CONTENEDOR PRINCIPAL ENCAPSULADO */
.txp-nissan-container {
    width: 100%;
    background-color: #000;
    position: relative;
    isolation: isolate;
}

/* IMÁGENES ENCAPSULADAS */
.txp-nissan-top-image,
.txp-nissan-bottom-image {
    display: block;
    width: 100%;
    height: auto;
}

/* WRAPPER DEL SWF (con botón de play) */
.txp-nissan-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1024 / 539;
    background-color: #000;
    overflow: hidden;
}

/* CONTENEDOR DEL REPRODUCTOR RUFFLE */
.txp-nissan-flash-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* REPRODUCTOR RUFFLE */
.txp-nissan-flash-container ruffle-player {
    width: 100% !important;
    height: 100% !important;
    display: block;
    margin: 0 auto;
}

/* COVER (pantalla negra antes de reproducir) */
.txp-nissan-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 2;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
    opacity: 1;
}

/* ============================================
   TRAUMA-XP PLAY BUTTON
   ============================================ */
.txp-nissan-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.35s ease,
        background 0.35s ease,
        opacity 0.3s ease;
    will-change: transform;
    color: rgb(255, 255, 255);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    font-weight: 600;
    font-family: "TheGoodMonolith", monospace;
    min-width: 220px;
    justify-content: center;
}

/* Línea superior animada */
.txp-nissan-play-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.9);
    transition: left 0.5s ease;
}

/* Glow lateral */
.txp-nissan-play-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.05),
            transparent
        );
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Hover */
.txp-nissan-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.03);
    border-color: rgba(255,255,255,0.45);
    background: rgba(0, 0, 0, 0.55);
}

.txp-nissan-play-btn:hover::before {
    left: 100%;
}

.txp-nissan-play-btn:hover::after {
    opacity: 1;
}

/* SVG */
.txp-nissan-play-btn svg {
    width: 25px;
    height: 25px;
    fill: white;
    flex-shrink: 0;
    opacity: 0.9;
}

/* Texto */
.txp-nissan-play-btn span {
    position: relative;
    top: 1px;
    color: rgb(255, 255, 255);
}

/* Estado oculto */
.txp-nissan-play-btn.txp-nissan-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   RESPONSIVE ENCAPSULADO
   ============================================ */
/* Pantallas grandes */
@media screen and (min-width: 1200px) {
    .txp-nissan-container {
        max-width: 1024px;
        box-shadow: 0 0 20px rgba(0,0,0,0.5);
        margin: 0 auto;
    }
}

/* Laptops */
@media screen and (min-width: 1024px) and (max-width: 1199px) {
    .txp-nissan-container {
        max-width: 100%;
        padding: 0 10px;
    }
}

/* Tablets horizontal */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .txp-nissan-container {
        max-width: 100%;
        padding: 0 10px;
    }
}

/* Tablets vertical */
@media screen and (min-width: 481px) and (max-width: 767px) {
    .txp-nissan-container {
        max-width: 100%;
        padding: 0 8px;
    }

    .txp-nissan-wrapper {
        margin: 5px 0;
    }
}

/* Móviles horizontal */
@media screen and (min-width: 375px) and (max-width: 480px) and (orientation: landscape) {
    .txp-nissan-container {
        max-width: 100%;
        padding: 0 5px;
    }

    .txp-nissan-wrapper {
        margin: 3px 0;
    }
}

/* Móviles vertical */
@media screen and (min-width: 320px) and (max-width: 480px) and (orientation: portrait) {
    .txp-nissan-container {
        max-width: 100%;
        padding: 0 5px;
    }

    .txp-nissan-wrapper {
        margin: 5px 0;
    }
}

/* Móviles muy pequeños */
@media screen and (max-width: 319px) {
    .txp-nissan-container {
        max-width: 100%;
        padding: 0 3px;
    }

    .txp-nissan-wrapper {
        margin: 3px 0;
    }
}

/* Pantallas 4K */
@media screen and (min-width: 2000px) {
    .txp-nissan-container {
        max-width: 1024px;
        transform: scale(1.2);
        transform-origin: center;
    }
}

/* Prefiere movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .txp-nissan-cover,
    .txp-nissan-play-btn {
        transition: none;
    }
}

/* Asegurar que el botón se oculte correctamente */
.txp-nissan-play-btn.txp-nissan-hidden,
.txp-nissan-play-btn[style*="opacity: 0"] {
    opacity: 0 !important;
    pointer-events: none !important;
}

.txp-nissan-cover.txp-nissan-hidden,
.txp-nissan-cover[style*="opacity: 0"] {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* WRAPPER FULL WIDTH */
.txp-nissan-fullwidth {
    position: relative;
    width: 100%;
    background: #000;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: 0;
    padding-right: 0;
}

/* CONTENIDO CENTRADO */
.txp-nissan-container {
    width: 1024px !important;
    max-width: 1024px !important;
    margin: 0 !important;
}

/* RUFFLE */
.txp-nissan-wrapper {
    position: relative;
    width: 100%;
}

.txp-nissan-fullwidth {
    display: flex;
    justify-content: center;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    background: #000;
}
