/* ==========================================================================
   COMPONENT: PRODUCTOS
   DESIGN: PREMIUM, MODERN, CLEAN (HERO & RESPONSIVE MODAL FIX)
   ========================================================================== */

/* --- 1. CONTENEDOR PRINCIPAL --- */
.ww-productos-section {
    padding: 100px 20px 80px 20px; /* Espacio generoso para separar de la sección anterior */
    background-color: #f8fafc;
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.ww-productos-container {
    max-width: 1250px;
    margin: 0 auto;
}

/* --- 2. HEADER TIPO HERO (PORTADA) --- */
.ww-productos-header {
    position: relative;
    text-align: center;
    margin: 0 auto 80px auto;
    max-width: 900px;
    background: #ffffff;
    padding: 70px 40px;
    border-radius: 32px;
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    z-index: 1;
}

/* Destellos sutiles en las esquinas del Hero */
.ww-productos-header::before {
    content: '';
    position: absolute;
    top: -120px;
    left: -120px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(224, 242, 254, 0.7) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

.ww-productos-header::after {
    content: '';
    position: absolute;
    bottom: -120px;
    right: -120px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(240, 253, 244, 0.7) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

/* Subtítulo tipo Badge Premium */
.ww-prod-tag {
    display: inline-block;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.1);
}

.ww-prod-maintitle {
    font-family: 'Raleway', sans-serif;
    color: #0f172a;
    margin: 0 0 20px 0;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.ww-prod-desc {
    color: #475569;
    font-size: 1.15rem;
    line-height: 1.8;
    margin: 0 auto;
    max-width: 700px;
}

/* --- 3. GRID DE PRODUCTOS Y TARJETAS --- */
.ww-productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 35px;
}

.ww-prod-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.ww-prod-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border-color: #e2e8f0;
}

/* Área de la Imagen en la Tarjeta */
.ww-prod-img-box {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3; 
    overflow: hidden;
    background: #f1f5f9;
}

.ww-prod-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.ww-prod-card:hover .ww-prod-img-box img {
    transform: scale(1.06); 
}

/* Overlay "Ver Galería" */
.ww-prod-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.ww-prod-card:hover .ww-prod-overlay {
    opacity: 1;
}

.ww-prod-overlay span {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.ww-prod-card:hover .ww-prod-overlay span {
    transform: translateY(0);
}

/* Info debajo de la tarjeta */
.ww-prod-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.ww-prod-badge {
    align-self: flex-start;
    font-size: 0.75rem;
    background: #f1f5f9;
    color: #475569;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ww-prod-info h3 {
    margin: 0;
    font-size: 1.35rem;
    color: #1e293b;
    font-weight: 700;
    line-height: 1.4;
}

/* --- 4. MODAL PREMIUM: ESTRUCTURA Y FIX DE SCROLL (FOCUS) --- */
.ww-prod-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9); /* Un poco más oscuro para dar máximo focus */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    /* FIX DE Z-INDEX: Forzamos que esté por encima de cualquier Navbar o footer de la página */
    z-index: 2147483647 !important; 
    
    display: flex;
    align-items: flex-start; 
    justify-content: center;
    overflow-y: auto; 
    padding: 50px 20px; 
    
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.ww-prod-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.ww-prod-modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 1150px;
    margin: auto; 
    max-height: 85vh; 
    display: flex;
    flex-direction: row; 
    position: relative;
    transform: scale(0.96) translateY(15px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.ww-prod-modal-overlay.active .ww-prod-modal-content {
    transform: scale(1) translateY(0);
}

/* Botón de Cerrar (X) */
.ww-prod-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ww-prod-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg) scale(1.05);
}

/* --- 5. MODAL: DIVISIÓN DE PANTALLA (ESCRITORIO) --- */

/* Izquierda: Zona de Fotografía */
.ww-prod-modal-left {
    width: 55%;
    background: #f8fafc;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.ww-prod-modal-left img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    object-fit: contain; 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s ease;
}

/* Controles de la Galería */
.ww-prod-gallery-nav {
    position: absolute;
    bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ww-prod-gallery-nav button {
    background: #0f172a;
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.ww-prod-gallery-nav button:hover {
    background: #0ea5e9;
}

.ww-prod-gallery-nav span {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    min-width: 45px;
    text-align: center;
}

/* Derecha: Zona de Información */
.ww-prod-modal-right {
    width: 45%;
    padding: 60px 50px 50px 50px; 
    display: flex;
    flex-direction: column;
    overflow-y: auto; 
    background: #ffffff;
    position: relative;
}

.ww-prod-modal-right::-webkit-scrollbar { width: 6px; }
.ww-prod-modal-right::-webkit-scrollbar-track { background: #ffffff; }
.ww-prod-modal-right::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.ww-prod-modal-right::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.ww-prod-modal-sub {
    color: #0ea5e9;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 12px;
}

.ww-prod-modal-title {
    margin: 0 0 25px 0;
    font-size: 2.5rem;
    color: #0f172a;
    font-family: 'Raleway', sans-serif;
    font-weight: 800;
    line-height: 1.15;
}

.ww-prod-modal-desc {
    color: #475569;
    font-size: 1.1rem;
    line-height: 1.8;
    flex-grow: 1; 
    margin-bottom: 40px;
}

.ww-prod-modal-desc p {
    margin-top: 0;
    margin-bottom: 15px;
}

.ww-prod-modal-footer {
    margin-top: auto;
    padding-top: 25px;
    border-top: 1px solid #f1f5f9;
}

.ww-prod-btn {
    display: inline-block;
    background: #0ea5e9;
    color: white;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.3);
    text-align: center;
    width: 100%; 
    box-sizing: border-box;
}

.ww-prod-btn:hover {
    background: #0284c7;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.45);
    transform: translateY(-3px);
}

/* --- 6. RESPONSIVE DESIGN (MÓVIL & TABLET) --- */
@media (max-width: 992px) {
    .ww-productos-header {
        padding: 50px 25px;
        margin-bottom: 50px;
        border-radius: 24px;
    }

    .ww-prod-maintitle {
        font-size: 2.2rem !important; 
    }

    .ww-prod-modal-overlay {
        padding: 15px; 
    }

    .ww-prod-modal-content {
        flex-direction: column; 
        max-height: none; 
        overflow: visible; 
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .ww-prod-modal-left {
        width: 100%;
        min-height: 350px; 
        padding: 40px 20px;
        border-radius: 20px 20px 0 0; 
    }
    
    .ww-prod-modal-left img {
        max-height: 40vh; 
    }
    
    .ww-prod-modal-right {
        width: 100%;
        padding: 40px 25px;
        overflow-y: visible; 
        border-radius: 0 0 20px 20px;
    }
    
    .ww-prod-modal-title {
        font-size: 2rem;
    }

    .ww-prod-modal-close {
        position: fixed;
        top: 20px;
        right: 20px;
        background: #ffffff;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
}

/* --- 7. FIX DE ANIMACIÓN DE APARICIÓN AL HACER SCROLL --- */
.js-scroll-productos {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-scroll-productos.is-visible {
    opacity: 1;
    /* ESTA LÍNEA ES EL FIX MÁGICO PARA EL MODAL */
    /* Remueve el contenedor de transformación para que el position:fixed del modal funcione al 100% de la pantalla */
    transform: none !important; 
}