/* =========================================
       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;

    background-image:
        linear-gradient(rgba(204, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(204, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

.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;
}

.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;
}

.product-hero-category {
    color: var(--brand-primary);
    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);
}

.product-hero-title {
    font-size: 7rem;
    font-weight: 900;
    color: var(--blanco);
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 0.9;
    margin: 0;
    transform: none;
    text-shadow:
        0 5px 15px rgba(204, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.9);
}

@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: calc(var(--header-height, 100px) + 100px);
    z-index: 10;
    border-radius: 12px;
    background: #ffffff;
    min-height: 400px;
    border: none;
    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;
    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;
    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;
    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(--brand-primary);
    border-color: var(--brand-primary);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 5px 15px rgba(204, 0, 0, 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(--brand-primary);
    text-decoration: none;
}

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

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

.descripcion-larga {
    margin: 1.5em 0;
    color: #d1d1d1;
    font-size: 1.05em;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-primary) rgba(255, 255, 255, 0.05);
}

.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(--brand-primary);
    border-radius: 10px;
}

.descripcion-larga p {
    margin-bottom: 1em;
    padding-bottom: 1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.3s ease;
}

.descripcion-larga p:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.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(--brand-primary);
    font-weight: 600;
    font-size: 1.1em;
}

.especificaciones-list li:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(204, 0, 0, 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(--brand-primary) 0%, #A30000 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(204, 0, 0, 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(--brand-primary);
    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(--brand-primary);
    padding-bottom: 10px;
    display: inline-block;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.video-destacado {
    width: 100%;
    margin: 0 auto 4rem auto;
    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;
}

.galeria-grid {
    column-count: 3;
    column-gap: 1.5rem;
    margin-bottom: 5rem;
}

.galeria-item {
    break-inside: avoid;
    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;
    display: block;
    transition: transform 0.5s ease;
}

.galeria-item:hover img {
    transform: scale(1.05);
}

@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(--brand-primary);
}

@media (max-width: 767px) {
    .carrusel {
        position: relative !important;
        top: auto !important;
        z-index: 1 !important;
        margin-bottom: 2rem !important;
        min-height: 250px !important;
        height: 250px !important;
        padding: 15px !important;
        border-radius: 12px !important;
        margin-top: 1rem !important;
    }

    .carrusel-slide img {
        max-height: 220px !important;
    }
}

/* =========================================
   7. PÁGINA DETALLE — LIENZO OSCURO EN SITIO CLARO
   ========================================= */
.product-detail-page {
    background-color: #0a0a0a;
    color: var(--blanco);
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-bottom: 4rem;
}

.product-detail-page .product-hero {
    margin-top: 0;
}

.product-detail-page .detalle-layout,
.product-detail-page .media-section {
    max-width: var(--max-width, 1400px);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

.product-detail-page .detalle-layout {
    box-sizing: border-box;
}

.product-detail-page .media-section {
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (max-width: 768px) {
    .product-detail-page .detalle-layout,
    .product-detail-page .media-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
