/* src/styles/design-carousel.css - VERSIÓN LIMPIA (BASE PARA POPUPS NUEVOS) */

body {
    margin: 0;
    background-color: #050505;
    color: white;
    overflow: hidden; /* Scroll virtual */
    width: 100vw; height: 100vh;
    font-family: 'Courier New', monospace;
}

/* === 1. FONDO Y SPLINE === */
.spline-wrapper {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; pointer-events: auto;
}

#design-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}

/* === 2. UNIVERSO 3D === */
.gallery-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 20; 
    pointer-events: none;
    perspective: 2500px; 
    perspective-origin: 50% 40%;
    transform-style: preserve-3d;
}

/* === 3. LA CARTA (CONTENEDOR MAESTRO) === */
.card {
    position: absolute;
    top: 50%; left: 50%;
    width: 240px; height: 240px;
    margin-left: -120px; 
    margin-top: -120px;
    background: transparent;
    border-radius: 45px;
    overflow: visible !important; 
    pointer-events: auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* LA SOLUCIÓN AL OVERFLOW: Ocultar los datos internos que rompen la tarjeta */
.card .detail-box {
    display: none !important;
}

/* === 4. EL ICONO CENTRAL (BURBUJA VISUAL) === */
.card-icon-wrapper {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    
    /* SOLUCIÓN AL RECORTE: Mismo radio que la carta (45px) */
    border-radius: 45px; 
    
    background: rgba(40, 40, 40, 0.4); 
    backdrop-filter: blur(30px) saturate(140%);
    -webkit-backdrop-filter: blur(30px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.05), 0 20px 50px rgba(0, 0, 0, 0.5);
    
    overflow: hidden; 
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    
    /* Hereda el radio curvo perfecto del contenedor */
    border-radius: inherit; 
    
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0.85;
}

/* Texto flotante debajo de la carta */
.card-info {
    position: absolute; bottom: -70px; width: 200px; text-align: center;
    opacity: 0; transform: translateY(-10px); transition: all 0.4s ease; z-index: 20;
}
.card h3 { 
    font-family: -apple-system, sans-serif; font-size: 1rem; font-weight: 600; 
    color: white; margin: 0; text-shadow: 0 2px 10px rgba(0,0,0,0.8); 
}
.card p { 
    font-family: sans-serif; font-size: 0.7rem; color: rgba(255,255,255,0.7); margin-top: 4px; 
}

/* === 5. EFECTOS HOVER === */
.card:hover .card-icon-wrapper {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4), 0 20px 60px rgba(0,0,0,0.6);
    transform: scale(1.05);
}
.card:hover .card-img { transform: scale(1.15); opacity: 1; }
.card:hover .card-info { opacity: 1; transform: translateY(0); }


/* === 6. PANTALLA DE INTRO === */
#intro-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: black;
    z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    pointer-events: none;
}
#intro-text {
    font-family: 'Courier New', monospace;
    font-size: 2rem; color: white; font-weight: bold;
    letter-spacing: 4px; text-align: center; opacity: 0;
}

/* src/styles/design-carousel.css */

/* === 7. BOTÓN DE REGRESO (VOLVER AL CARRUSEL) - CORREGIDO === */
#return-container {
    position: fixed; 
    
    /* === POSICIÓN: ESQUINA INFERIOR IZQUIERDA === */
    top: 40px !important;    
    right: 40px !important;  
    bottom: auto !important; 
    left: auto !important;   /* Anclamos izquierda */
    
    /* === CAPAS (Z-INDEX) === */
    /* Debe ser mayor que #detail-overlay (4000) */
    z-index: 6000; 
    
    pointer-events: none; /* El contenedor no bloquea, el botón sí */
    opacity: 0;           /* Controlado por JS (aparece al abrir proyecto) */
    transition: opacity 0.5s ease;
}

#btn-return {
    pointer-events: auto; /* IMPORTANTE: Permite el click */
    cursor: pointer;
    
    /* Estilo Glass/Tech */
    background: rgba(0, 0, 0, 0.6); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    
    padding: 15px 30px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem; 
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 8px; /* Borde un poco más técnico, menos redondo */
    
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    
    display: flex; align-items: center; gap: 12px;
}

/* Flecha animada */
#btn-return::before {
    content: '←';
    font-size: 1.2rem;
    transition: transform 0.3s;
    color: #00e5ff; /* Toque de color cyan */
}

/* Hover Effect */
#btn-return:hover {
    background: rgba(255, 255, 255, 0.1); 
    border-color: #00e5ff;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}

#btn-return:hover::before {
    transform: translateX(-5px); /* La flecha retrocede */
}

/* RESPONSIVE: En móvil lo centramos abajo */
@media (max-width: 900px) {
    #return-container {
        bottom: 30px !important;
        left: 50% !important;
        transform: translateX(-50%);
        width: max-content;
    }
}

/* src/styles/design-carousel.css */

/* src/styles/design-carousel.css */

/* === OVERLAY CONTENEDOR (FONDO) === */
#detail-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 4000; 
    
    /* CAMBIO: Empieza invisible y no bloquea clicks */
    opacity: 0; 
    pointer-events: none;
    
    display: flex; justify-content: center; align-items: center;
    background: radial-gradient(circle, rgba(0,0,0,0) 0%, rgba(0,0,0,0.85) 100%); /* Tinte oscuro */
    transition: opacity 0.5s ease; /* Transición suave por CSS si se usara, pero usaremos GSAP */
}

/* CONTENEDOR PRINCIPAL (GRID) */
.detail-content {
    position: relative; 
    /* OCUPAR EL 90% DEL ANCHO DE LA PANTALLA */
    width: 92vw; 
    max-width: 2200px; /* Límite muy alto para tu monitor 34" */
    height: 85vh;      /* Ocupar buena altura también */
    
    display: flex; 
    justify-content: center; 
    align-items: center;
    gap: 30px; /* Espacio entre columna izq y der */
    perspective: 1500px; /* Crea la profundidad */
    transform-style: preserve-3d;
}

/* COLUMNAS FLEXIBLES */
.detail-col-left {
    /* La imagen toma el espacio sobrante (se hace gigante) */
    flex: 1; 
    height: 100%;
    display: flex; align-items: center; justify-content: flex-end;
}

.detail-col-right {
    /* La columna derecha tiene ancho fijo pero generoso */
    width: 500px; 
    height: 100%;
    display: flex; flex-direction: column; 
    gap: 20px; /* Espacio vertical entre cajas derechas */
    justify-content: center;
}

/* === ESTILO APPLE GLASS (BASE) === */
.overlay-box {
    background: rgba(20, 20, 20, 0.6); 
    backdrop-filter: blur(50px) saturate(200%); 
    -webkit-backdrop-filter: blur(50px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 100px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.05);
    border-radius: 40px; 
    opacity: 0; 
    overflow: hidden; /* Esto corta las esquinas */
    transform-style: preserve-3d;
    backface-visibility: hidden;
    position: relative; /* CRUCIAL para que el overflow funcione con hijos absolutos */
}

/* FORZAR CONTENIDO DE LA IMAGEN DENTRO DE LA CAJA */
.overlay-box img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block; /* Quita el espacio blanco residual debajo de las imágenes */
    border-radius: inherit; /* Hereda el radio de 40px del padre */
    image-rendering: -webkit-optimize-contrast;
}

/* === 1. IMAGEN PRINCIPAL (GIGANTE) === */
.visual-box-large {
    width: 100%; height: 100%; max-height: 85vh; padding: 0; 
}
.visual-box-large img { 
    transition: transform 1s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transición más suave */
}
.visual-box-large:hover img { transform: scale(1.05); }

/* La caja pequeña secundaria */
.visual-box-small { width: 100%; height: 40%; padding: 0; }

/* === 3. CAJA DE TEXTO (Abajo Derecha) === */
.text-box-side {
    width: 100%; /* Llena los 500px */
    height: 60%; /* Ocupa el 60% restante (más espacio para texto) */
    padding: 50px; 
    box-sizing: border-box;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
}

/* TIPOGRAFÍA MASIVA */
.text-box-side h4 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 3rem; /* Título Gigante */
    font-weight: 700; color: white;
    margin: 0 0 20px 0; letter-spacing: -1px;
    line-height: 1;
}

.text-box-side p {
    font-family: -apple-system, sans-serif;
    font-size: 1.1rem; color: rgba(255,255,255,0.8); 
    line-height: 1.6; margin: 0;
    max-width: 100%;
}

.tags-container { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.text-box-side .tag {
    font-size: 0.85rem; padding: 8px 18px; 
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px; color: #fff; font-weight: 600;
}


/* === RESPONSIVE (ADAPTACIÓN) === */

/* Para Laptops (Full HD) - Reducimos un poco pero mantenemos estructura */
@media (max-width: 1600px) {
    .detail-content { width: 95vw; height: 80vh; gap: 20px; }
    .detail-col-right { width: 400px; }
    .text-box-side h4 { font-size: 2.5rem; }
    .overlay-box { border-radius: 30px; }
}

/* Para Pantallas Pequeñas (Tablet/Laptop pequeña) - Stack Vertical */
@media (max-width: 1100px) {
    .detail-content { 
        flex-direction: column; 
        height: auto; 
        padding: 80px 0; /* Espacio para scroll */
        overflow-y: auto; /* Permitir scroll si no cabe */
        justify-content: flex-start;
    }
    
    .detail-col-left { width: 90vw; height: 50vh; flex: none; }
    .detail-col-right { width: 90vw; height: auto; flex: none; gap: 20px; }
    
    .visual-box-large { height: 100%; }
    .visual-box-small { height: 250px; }
    .text-box-side { height: auto; padding: 30px; }
}

#intro-overlay {
    /* ... tus estilos actuales ... */
    cursor: wait; /* Cursor de espera mientras carga */
    pointer-events: auto; /* Asegura que el overlay capture todo al inicio */
}

/* =========================================
   CONTROLES DEL CARRUSEL (FLECHAS) - AJUSTE ORBITAL EXTERNO
   ========================================= */

.carousel-controls {
    position: fixed;
    top: 50%;
    left: 50%; 
    transform: translate(-50%, -50%); /* Centrado absoluto */
    
    /* CAMBIO CLAVE: */
    /* Usamos 85% del ancho de la pantalla. */
    /* Esto los empuja hacia afuera, pero deja espacio en los bordes. */
    width: 85vw; 
    max-width: 2000px; /* Tope máximo para pantallas ultra-wide */
    
    height: 0px; 
    z-index: 3500; 
    
    display: flex;
    justify-content: space-between; /* Se separan al máximo del contenedor */
    
    pointer-events: none; 
}

/* El estilo de los botones se mantiene igual de elegante */
.control-btn {
    pointer-events: auto; 
    cursor: pointer;
    visibility: visible;
    opacity: 0.6; /* Un poco más sutiles por defecto */
    
    width: 60px; 
    height: 60px;
    border-radius: 50%;
    
    background: rgba(0, 0, 0, 0.4); 
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    
    /* Pequeña sombra para que floten */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.control-btn:hover {
    background: white;
    color: black;
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    border-color: white;
}

.control-btn svg {
    width: 24px; height: 24px;
    stroke: currentColor; stroke-width: 2px; fill: none;
}

/* RESPONSIVE: En móviles los bajamos y juntamos un poco */
@media (max-width: 900px) {
    .carousel-controls {
        width: 100%;
        padding: 0 30px;
        top: auto;
        bottom: 120px; 
        transform: translateX(-50%);
    }
}