/* Variables inyectadas desde PocketBase */
:root {
    --bg-body: #ffffff;       
    --color-accent: #000000;  
    --color-text: #333333;
    --color-titulos: #000000; 
    --font-family: 'Inter', sans-serif; 
    --bg-header: transparent;
    --blur-header: blur(10px);
    --border-header: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Variables de Densidad (Modificadas por JS) */
    --espaciado-seccion: 4rem 5%;
    --gap-grid: 2rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-family); scroll-behavior: smooth; }
body, html { background-color: var(--bg-body); color: var(--color-text); line-height: 1.6; overflow-x: hidden; }
h1, h2, h3, .section-title { color: var(--color-titulos) !important; }
.btn-main { background-color: var(--color-accent) !important; color: var(--bg-body) !important; padding: 1rem 2rem; border: none; border-radius: 50px; font-weight: bold; cursor: pointer; transition: 0.3s; display: inline-block; text-align: center; text-decoration: none;}
.btn-main:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.btn-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* PANTALLA DE CARGA (SPINNER) */
#loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-body); z-index: 9999999; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease; }
.spinner { border: 5px solid rgba(0,0,0,0.1); border-top: 5px solid var(--color-accent); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* MURO DE CAPTURA (GATE) */
body.locked { overflow: hidden; } 
#lead-gate { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(10px); z-index: 999999; display: flex; justify-content: center; align-items: center; }
.gate-content { background: var(--bg-body); padding: 3rem 2rem; border-radius: 16px; width: 90%; max-width: 450px; text-align: center; }
.gate-content input { width: 100%; padding: 10px; margin: 10px 0 20px; border-radius: 8px; border: 1px solid #ccc; }

/* BANNER SUPERIOR FIJO */
#top-banner { position: fixed; top: 0; left: 0; width: 100%; background-color: var(--color-accent); color: var(--bg-body); font-weight: bold; font-size: 0.95rem; z-index: 10001; display: none; box-shadow: 0 2px 10px rgba(0,0,0,0.2); transition: top 0.3s ease; }
.banner-close { cursor: pointer; font-size: 1.4rem; padding: 0 15px; opacity: 0.8; transition: 0.2s; }
.banner-close:hover { opacity: 1; transform: scale(1.2); }

/* HEADER FLOTANTE */
header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 5%; background: var(--bg-header); backdrop-filter: var(--blur-header); -webkit-backdrop-filter: var(--blur-header); position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; border-bottom: var(--border-header); transition: top 0.3s ease, background 0.3s ease; }
.logo-area { display: flex; align-items: center; text-decoration: none; }
#logo-img { max-height: 35px; display: none; }

.header-nombre-derecha { font-size: 1.3rem; font-weight: bold; color: var(--color-accent); margin-right: 15px; }

.icon-nav { font-size: 1.5rem; cursor: pointer; margin-left: 15px; position: relative; transition: transform 0.2s ease, opacity 0.3s ease; color: var(--color-text); }
.icon-nav:hover { transform: scale(1.15); }
.badge { position: absolute; top: -5px; right: -10px; background: red; color: white; font-size: 0.7rem; padding: 2px 6px; border-radius: 50%; display: none; }

.menu-container { position: relative; display: inline-block; }
.dots-menu-btn { font-weight: bold; padding: 0 10px; font-size: 1.8rem !important; }
.dropdown-content { display: none; position: absolute; right: 0; top: 40px; background-color: var(--bg-body); min-width: 200px; box-shadow: 0px 8px 25px 0px rgba(0,0,0,0.2); z-index: 1001; border-radius: 12px; overflow: hidden; border: 1px solid rgba(128,128,128,0.1); }
.dropdown-content.show { display: flex; flex-direction: column; }
.dropdown-content a { color: var(--color-text); padding: 14px 18px; text-decoration: none; display: block; font-weight: 600; font-size: 0.95rem; border-bottom: 1px solid rgba(128,128,128,0.05); }
.dropdown-content a:hover { background-color: var(--color-accent); color: var(--bg-body); }

/* HERO SECTION */
.hero { position: relative; background-color: #000; text-align: center; height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 5% 4rem; overflow: hidden; }
#video-hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; display: none; transition: opacity 0.5s ease; }
.hero::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 50%; background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.3), transparent); z-index: 2; pointer-events: none; }
.hero-content { position: relative; z-index: 3; width: 100%; max-width: 1000px; margin: 0 auto; color: #ffffff; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }

.hero-content h1 { color: #ffffff !important; font-size: clamp(2rem, 6vw, 4rem); margin-bottom: 0.5rem; line-height: 1.1; }
.hero-content p { font-size: clamp(0.95rem, 2vw, 1.2rem); margin-bottom: 2rem; opacity: 0.95; font-weight: 500;}

.btn-sonido { position: absolute; top: 90px; right: 30px; z-index: 10; background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(10px); padding: 8px 18px; border-radius: 30px; cursor: pointer; display: none; font-size: 0.85rem;}

.hero-menu-botones { display: flex; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.btn-hero-opcion { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15); backdrop-filter: blur(8px); color: #ffffff; padding: 7px 15px; border-radius: 30px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 6px; }
.btn-hero-opcion:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-3px) scale(1.02); }
.btn-hero-opcion.activo { background: var(--color-accent); border: 1px solid var(--color-accent); color: var(--bg-body); }

section { padding: var(--espaciado-seccion); }
.section-title { text-align: center; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 3rem; }

/* ACERCA DE */
.about-container { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; background: rgba(128, 128, 128, 0.08); padding: 3rem; border-radius: 20px; border: 1px solid var(--color-accent); }
.about-video { width: 100%; border-radius: 16px; display: none; }

/* =========================================================================
   SISTEMA DE TAMAÑOS MATEMÁTICOS DE 12 COLUMNAS (100% GARANTIZADO)
   ========================================================================= */
.products-grid { 
    display: grid; 
    grid-template-columns: repeat(12, 1fr); 
    gap: var(--gap-grid); 
    align-items: stretch;
}

.product-card { 
    background: var(--bg-body); 
    color: var(--color-text);
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    transition: 0.3s; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    border: 1px solid rgba(128,128,128,0.2);
    height: 100%;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--color-accent); }
.product-img { width: 100%; object-fit: cover; cursor: pointer; }
.btn-fav { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.9); border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; }
.btn-fav.active { color: red; }
.product-info { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.product-desc { opacity:0.7; font-size:0.9rem; flex-grow:1; margin-top:10px; }
.product-price { font-size: 1.3rem; font-weight: bold; color: var(--color-accent); margin: 10px 0; }

/* TAMAÑOS PRODUCTOS */
.product-card.tamano-pequeno { 
    grid-column: span 3; /* Ocupa 25% de la pantalla */
}
.product-card.tamano-pequeno .product-img { height: 150px; }
.product-card.tamano-pequeno h3 { font-size: 1rem; }

.product-card.tamano-estandar { 
    grid-column: span 4; /* Ocupa 33% de la pantalla */
}
.product-card.tamano-estandar .product-img { height: 220px; }

.product-card.tamano-destacado { 
    grid-column: span 6; /* Ocupa 50% de la pantalla (Gigante) */
    border: 3px solid var(--color-accent); 
}
.product-card.tamano-destacado .product-img { height: 300px; }
.product-card.tamano-destacado h3 { font-size: 1.5rem; }

.product-card.tamano-hero { 
    grid-column: span 12; /* Ocupa el 100% de la pantalla */
    border: 4px solid var(--color-accent); 
    background: linear-gradient(135deg, var(--bg-body), rgba(128,128,128, 0.1)); 
    flex-direction: row; 
    align-items: center;
}
.product-card.tamano-hero .product-img { width: 50%; height: 100%; min-height: 350px; border-right: 1px solid rgba(128,128,128,0.2); }
.product-card.tamano-hero .product-info { width: 50%; padding: 4rem; justify-content: center; }
.product-card.tamano-hero h3 { font-size: 2.2rem; }
.product-card.tamano-hero .product-desc { font-size: 1.1rem; }

/* TAMAÑOS CATEGORÍAS */
.product-card.tamano-compacto {
    grid-column: span 3; /* Ocupa 25% */
}
.product-card.tamano-compacto .product-img { height: 120px; }

.product-card.tamano-expandido {
    grid-column: span 6; /* Ocupa 50% */
    border: 2px dashed var(--color-accent);
}
.product-card.tamano-expandido .product-img { height: 250px; }

/* MODALES Y CARRITO */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 10005; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content { background: var(--bg-body); padding: 2rem; border-radius: 16px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; cursor: pointer; z-index: 10; }
#modal-video { width: 100%; border-radius: 12px; margin-bottom: 15px; display: none; background: #000; }

.cart-panel { position: fixed; top: 0; right: -400px; width: 400px; max-width: 100%; height: 100%; background: var(--bg-body); z-index: 10010; box-shadow: -5px 0 20px rgba(0,0,0,0.2); transition: right 0.3s ease; display: flex; flex-direction: column; }
.cart-panel.open { right: 0; }
.cart-header, .cart-footer { padding: 20px; border-bottom: 1px solid #eee; }
.cart-items { flex-grow: 1; overflow-y: auto; padding: 20px; }
.cart-item { margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; display: flex; justify-content: space-between;}

.glass-form { max-width: 600px; margin: 0 auto; background: #f9f9f9; padding: 2rem; border-radius: 16px; border: 1px solid rgba(0,0,0,0.05); }
.glass-form input, .glass-form textarea, .glass-form select { width: 100%; padding: 10px; margin-bottom: 15px; border-radius: 8px; border: 1px solid #ddd; background: var(--bg-body); color: var(--color-text); }
.resenas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin-bottom: 3rem; }
.resena-card { background: var(--bg-body); color: var(--color-text); padding: 1.5rem; border-radius: 12px; border: 1px solid rgba(128,128,128,0.2); }

footer { text-align: center; padding: 4rem 5% 3rem; background: rgba(128, 128, 128, 0.05); }
.social-links { display: flex; justify-content: center; gap: 10px; margin: 1.5rem 0; }
.social-links a { color: var(--bg-body); background-color: var(--color-accent); padding: 0.6rem 1.5rem; border-radius: 30px; text-decoration: none; font-weight: bold; }

/* CHATBOT REPARADO PARA MÓVILES */
#bot-widget { position: fixed; bottom: 20px; right: 20px; z-index: 99999; display: none; }
#bot-button { width: 60px; height: 60px; border-radius: 50%; background: var(--color-accent); color: var(--bg-body); display: flex; justify-content: center; align-items: center; font-size: 28px; cursor: pointer; box-shadow: 0 5px 20px rgba(0,0,0,0.3); }
#bot-window { 
    display: none; flex-direction: column; 
    position: fixed; /* Siempre pegado en pantalla */
    bottom: 90px; right: 20px; 
    width: 350px; 
    max-width: calc(100vw - 40px); /* Nunca se sale del ancho del celular */
    height: 500px; 
    max-height: calc(100vh - 120px); /* Nunca se sale del alto del celular */
    border-radius: 16px; background: var(--bg-body); 
    border: 1px solid rgba(128,128,128,0.2); box-shadow: 0 15px 40px rgba(0,0,0,0.3); overflow: hidden;
}
#bot-header { background: var(--color-accent); color: var(--bg-body); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; font-weight: bold;}
#bot-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 90%; padding: 12px 16px; border-radius: 16px; font-size: 0.95rem; }
.chat-bot { align-self: flex-start; background: rgba(128,128,128,0.1); }
.chat-user { align-self: flex-end; background: var(--color-accent); color: var(--bg-body); }

/* RESPONSIVE PROFESIONAL PARA MÓVILES */
@media (max-width: 768px) {
    .header-nombre-derecha { font-size: 1.05rem; margin-right: 10px; }
    .hero { padding: 0 6% 3rem; }
    .about-container { grid-template-columns: 1fr; padding: 1.5rem; gap: 1.5rem; }
    
    /* Rejilla adaptada a móvil */
    .product-card.tamano-pequeno, .product-card.tamano-compacto { 
        grid-column: span 6; /* 2 por fila en celular */
    }
    .product-card.tamano-estandar, .product-card.tamano-destacado, .product-card.tamano-expandido { 
        grid-column: span 12; /* 1 gigante por fila en celular */
    }
    .product-card.tamano-hero { 
        grid-column: span 12;
        flex-direction: column; 
    }
    .product-card.tamano-hero .product-img { width: 100%; height: 250px; border-right: none; border-bottom: 1px solid rgba(128,128,128,0.2); }
    .product-card.tamano-hero .product-info { width: 100%; padding: 1.5rem; }
}