/* =========================================
       1. PORTADA GIGANTE DEL PRODUCTO (HERO) - VERSIÓN LIMPIA + SOMBRA 3D
       ========================================= */
.product-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 65vh;
    min-height: 400px;
    margin-top: -2rem;
    margin-bottom: 4rem;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: #0a0a0a;

    /* Textura técnica de fondo (Sutil) */
    background-image:
        linear-gradient(rgba(192, 8, 18, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(192, 8, 18, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Texto gigante fantasma adaptado a la categoría */
.product-hero::before {
    content: attr(data-category);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Montserrat', sans-serif;
    font-size: 12vw;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.02);
    text-transform: uppercase;
    letter-spacing: 15px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    width: 100%;
    text-align: center;
}

.product-hero img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
    opacity: 1;
    z-index: 2;
    position: relative;
}

/* Degradado clásico y limpio desde abajo */
.product-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4rem 10%;
    z-index: 3;
    background: linear-gradient(to top, var(--negro) 0%, rgba(10, 10, 10, 0.2) 60%, transparent 100%);
    animation: fadeUp 1s ease-out forwards;
    pointer-events: none;
}

/* Categoría arriba del título */
.product-hero-category {
    color: var(--rojo-rvm);
    font-size: 1rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 12px;
    margin-bottom: 0.5rem;
    display: block;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
}

/* Título Gigante RECTO con el nuevo efecto de sombra 3D */
.product-hero-title {
    font-size: 7rem;
    font-weight: 900;
    color: var(--blanco);
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 0.9;
    margin: 0;

    /* 👇 ¡TOTALMENTE RECTO! 👇 */
    transform: none;

    /* 👇 EL NUEVO EFECTO DE SOMBRA 3D 👇 */
    text-shadow:
        0 5px 15px rgba(192, 8, 18, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.9);
}

/* Ajuste responsivo para celulares */
@media (max-width: 768px) {
    .product-hero {
        height: 40vh;
        min-height: 300px;
    }

    .product-hero-title {
        font-size: 3.5rem;
    }
}

/* =========================================
       2. ESTILOS ESTRUCTURALES (LAYOUT PREMIUM)
       ========================================= */
.detalle-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2em;
    background: rgba(15, 15, 15, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 2.5em;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 2;
    margin-top: -80px;
}

@media (min-width: 768px) {
    .detalle-layout {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

/* =========================================
       3. CARRUSEL INTERACTIVO CON FONDO BLANCO
       ========================================= */
.carrusel {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    z-index: 10;
    border-radius: 12px;

    /* LA MAGIA: Todo el bloque ahora es blanco puro */
    background: #ffffff;

    min-height: 400px;
    border: none;
    /* Quitamos el bordecito gris que tenía */

    /* Cambiamos la sombra para que el bloque blanco flote sobre el fondo oscuro */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    cursor: crosshair;
}

.carrusel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    height: 100%;
    align-items: stretch;

    /* MAGIA ANTI-GLITCH 1: Prepara a la tarjeta de video */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.carrusel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;

    /* MAGIA ANTI-GLITCH 2 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.carrusel-slide.hidden {
    display: none;
}

.carrusel-slide img {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
    display: block;

    /* MAGIA ANTI-GLITCH 3: Protege la imagen durante el zoom */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

.carrusel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(15, 15, 15, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.carrusel-btn:hover {
    background-color: var(--rojo-rvm);
    border-color: var(--rojo-rvm);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 5px 15px rgba(192, 8, 18, 0.5);
}

.carrusel-btn.prev {
    left: 15px;
}

.carrusel-btn.next {
    right: 15px;
}

.carrusel-btn.js-hidden {
    display: none;
}

/* =========================================
       4. INFORMACIÓN Y ESPECIFICACIONES
       ========================================= */
.detalle-info {
    animation: fadeUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.detalle-info h1 {
    margin: 0 0 0.2em 0;
    color: var(--blanco);
    font-size: 2.5em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.categoria-breadcrumb {
    margin-bottom: 1em;
    font-size: 0.95em;
    color: #aaa;
}

.categoria-breadcrumb a {
    color: var(--rojo-rvm);
    text-decoration: none;
}

.categoria-breadcrumb a:hover {
    color: #ff4a55;
}

.detalle-info .precio {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--rojo-rvm);
    margin: 0.5em 0;
    display: block;
}

/* =========================================
       TEXTO Y DESCRIPCIÓN (MODO PANEL CON SCROLL)
       ========================================= */
.descripcion-larga {
    margin: 1.5em 0;
    color: #d1d1d1;
    font-size: 1.05em;
    line-height: 1.8;

    /* Contenedor con altura máxima y scroll */
    max-height: 400px;
    overflow-y: auto;
    padding-right: 15px;

    /* Scrollbar personalizado para Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--rojo-rvm) rgba(255, 255, 255, 0.05);
}

/* Scrollbar personalizado para Chrome/Edge/Safari */
.descripcion-larga::-webkit-scrollbar {
    width: 6px;
}

.descripcion-larga::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.descripcion-larga::-webkit-scrollbar-thumb {
    background: var(--rojo-rvm);
    border-radius: 10px;
}

/* Diseño moderno para cada párrafo */
.descripcion-larga p {
    margin-bottom: 1em;
    padding-bottom: 1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Línea divisoria muy fina */
    transition: color 0.3s ease;
}

/* El último párrafo no necesita línea abajo */
.descripcion-larga p:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Efecto de iluminación al pasar el mouse */
.descripcion-larga p:hover {
    color: #ffffff;
}

.especificaciones {
    margin: 2em 0;
    padding: 1.5em;
    background: transparent;
    border-radius: 8px;
    border: none;
}

.especificaciones h3 {
    color: var(--blanco);
    margin-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5em;
}

.especificaciones-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
}

.especificaciones-list li {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.especificaciones-list li strong {
    color: var(--blanco);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.especificaciones-list li span {
    color: var(--rojo-rvm);
    font-weight: 600;
    font-size: 1.1em;
}

.especificaciones-list li:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(192, 8, 18, 0.4);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.acciones-compra {
    margin-top: 2em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5em;
}

.btn-agregar {
    background: linear-gradient(135deg, var(--rojo-rvm) 0%, #a0060e 100%);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1em;
    display: inline-block;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-agregar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(192, 8, 18, 0.4);
}

.color-selector-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 1.5em 0;
}

.selector-color {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.selector-color.active {
    border-color: var(--blanco) !important;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

.color-selector-title {
    color: var(--blanco);
    margin-bottom: 10px;
    font-weight: 600;
}

.paused-badge {
    background: var(--rojo-rvm);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 10px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
       5. SECCIÓN MULTIMEDIA (GRILLA MASONRY ESTILO PINTEREST)
       ========================================= */
.media-section {
    margin-top: 5rem;
    padding: 0 5%;
}

.section-title {
    color: var(--blanco);
    font-size: 2em;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--rojo-rvm);
    padding-bottom: 10px;
    display: inline-block;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* El video principal centrado y a TODO lo ancho de la galería */
.video-destacado {
    width: 100%;
    margin: 0 auto 4rem auto;
    /* Espacio abajo para separarlo de las fotos */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #000;
}

.video-destacado video {
    width: 100%;
    height: auto;
    display: block;
}

/* Magia del layout Masonry (Cascada sin recortes) */
.galeria-grid {
    column-count: 3;
    column-gap: 1.5rem;
    margin-bottom: 5rem;
}

.galeria-item {
    break-inside: avoid;
    /* Evita que una foto se parta a la mitad entre columnas */
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: #0a0a0a;
}

.galeria-item img,
.galeria-item video {
    width: 100%;
    height: auto;
    /* LA CLAVE: Respeta el formato original, CERO recortes */
    display: block;
    transition: transform 0.5s ease;
}

.galeria-item:hover img {
    transform: scale(1.05);
    /* Un zoom más sutil para que no se salga del cuadro */
}

/* Responsivo para Tablets y Celulares */
@media (max-width: 1024px) {
    .galeria-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .galeria-grid {
        column-count: 1;
    }
}

/* =========================================
       6. LIGHTBOX (PANTALLA COMPLETA)
       ========================================= */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.activo {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    object-fit: contain;
}

.lightbox.activo img {
    transform: scale(1);
}

.lightbox-cerrar {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 4rem;
    color: white;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.lightbox-cerrar:hover {
    color: var(--rojo-rvm);
}

/* =========================================================
   CORRECCIÓN DEL CARRUSEL FIJO EN CELULARES
   ========================================================= */
@media (max-width: 767px) {
    .carrusel {
        /* Desactiva el candado (esto ya lo tenías) */
        position: relative !important;
        top: auto !important;
        z-index: 1 !important;
        margin-bottom: 2rem !important;

        /* LO NUEVO: Formato Tarjeta */
        min-height: 250px !important;
        height: 250px !important;
        padding: 15px !important;
        /* Le da aire a la moto para que no toque los bordes */
        border-radius: 12px !important;
        margin-top: 1rem !important;
    }

    /* Achicamos la imagen para que entre perfecta en su nueva caja */
    .carrusel-slide img {
        max-height: 220px !important;
    }
}