/* ==========================================
   RESETEO GLOBAL ANTI-DESBORDAMIENTO
   ========================================== */
html, body {
    max-width: 100%;
    overflow-x: hidden; /* Mata cualquier scroll horizontal */
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box; /* Obliga a que el padding no engorde los elementos */
}

/* =========================================
   VARIABLES DE COLOR (LOS TEMAS)
   ========================================= */
/* 1. TEMA DE CORTE LÁSER - PALETA TIERRA/TEAL */
:root {
    --color-fondo: #e1dbcf; 
    --color-header: #224b51; 
    --color-menu: #c65427; 
    --color-hover: #c5a38b; 
    --color-texto-principal: #ffffff; 
    --color-precio: #c65427; 
    --color-boton: #224b51; 
    --color-boton-hover: #d67f56; 
}

/* 2. TEMA DE IMPRESIÓN 3D - PALETA PASTEL VIBRANTE */
body.tema-vivo {
    --color-fondo: #e9ff70; 
    --color-header: #ff70a6; 
    --color-menu: #70d6ff; 
    --color-hover: #ffd670; 
    --color-texto-principal: #ffffff; 
    --color-precio: #ff9770; 
    --color-boton: #70d6ff; 
    --color-boton-hover: #ff70a6; 
}

/* 3. TEMA DE RENDERS - PALETA DE GRISES COOLS */
body.tema-sobrio {
    --color-fondo: #b5bac9; 
    --color-header: #666F88; 
    --color-menu: #788199; 
    --color-hover: #8990a2; 
    --color-texto-principal: #ffffff; 
    --color-precio: #666F88; 
    --color-boton: #788199; 
    --color-boton-hover: #666F88; 
}

/* =========================================
   ESTILOS GENERALES Y DISEÑO
   ========================================= */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-fondo);
    transition: background-color 0.5s ease; 
}

header {
    background-color: var(--color-header);
    background-size: cover; /* Hace que la imagen cubra toda el área */
    background-position: center; /* Centra la imagen */
    color: var(--color-texto-principal);
    padding: 6rem 2rem 4rem 2rem; /* Lo hicimos un poquito más alto para que luzca la foto */
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    transition: background-image 0.5s ease; /* Transición suave al cambiar de sección */
}

.contenedor-logo-texto {
    width: 100%;
    max-width: 1000px;
    display: flex;
    align-items: center;
    justify-content: center; 
    margin-bottom: 2rem; 
    flex-wrap: wrap; 
}

.logo {
    max-width: 170px; 
    height: auto;
    margin-right: 20px; 
    margin-bottom: 10px; 
}

.textos-header {
    display: flex;
    flex-direction: column;
    width: fit-content; 
}

.textos-header h1 {
    margin: 0 0 5px 0; 
    font-size: 2.2em; 
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3); 
    line-height: 1; 
    width: 100%;
    text-align: justify;
    text-align-last: justify; 
}

.textos-header p {
    margin: 0;
    opacity: 0.9; 
    font-size: 1.05em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    width: 100%;
    text-align: justify;
    text-align-last: justify; 
}

@media (max-width: 600px) {
    .textos-header {
        align-items: center; 
        text-align: center; 
    }
    .logo {
        margin-right: 0; 
    }
    .textos-header h1, .textos-header p {
        text-align-last: center; 
        text-align: center;
    }
}

.banner-alargado {
    width: 100%;
    max-width: 900px; 
    height: 150px; 
    object-fit: cover;
    border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.fondo-menu {
    background-color: var(--color-menu);
    transition: background-color 0.5s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.menu {
    display: flex;
    width: 100%;
    max-width: 900px; 
    margin: 0 auto;
}

.boton-menu {
    flex: 1; 
    background: none;
    color: #ffffff; 
    border: none;
    padding: 10px 5px; 
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.boton-menu:hover, .boton-menu.activo { 
    background-color: var(--color-hover); 
    font-weight: bold;
    color: #ffffff; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4); 
}

.seccion {
    display: none; 
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.seccion.activa {
    display: block; 
    animation: aparecer 0.5s; 
}

@keyframes aparecer {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tarjeta {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.foto-producto {
    width: 100%; 
    height: auto; 
    max-height: 350px; 
    object-fit: contain; 
    border-radius: 4px;
    margin-bottom: 15px;
    background-color: #f4f4f4; 
    cursor: pointer; 
    transition: transform 0.3s ease; /* Controla la suavidad del zoom */
}

.foto-producto:hover {
    transform: scale(1.3); /* ¡Hace que crezca al doble (200%)! */
    position: relative; /* Necesario para que el z-index funcione */
    z-index: 50; /* ¡Hace que la foto brinque al frente y no se esconda detrás de otras! */
    box-shadow: 0 10px 20px rgba(0,0,0,0.4); /* Le pone una sombra para que el efecto lupa resalte más */
}

.precio {
    color: var(--color-precio);
    font-size: 1.5em;
    font-weight: bold;
    margin: 10px 0;
    transition: color 0.5s ease;
}

/* NUEVO: Selector de Cantidad */
.selector-cantidad {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}
.selector-cantidad input {
    width: 50px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.boton-comprar {
    background-color: var(--color-boton);
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.boton-comprar:hover {
    background-color: var(--color-boton-hover);
}

/* Botón principal para cotizar renders */
.boton-cotizar {
    background-color: var(--color-boton);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.boton-cotizar:hover {
    background-color: var(--color-boton-hover);
    transform: scale(1.05); 
}

/* Modal General */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6); 
    align-items: center;
    justify-content: center;
}

.modal-contenido {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: left;
}

.modal-contenido h2 {
    margin-top: 0;
    color: #333;
}

.modal-contenido label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.modal-contenido input, .modal-contenido textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; 
    font-family: Arial, sans-serif;
}

.grupo-botones-modal {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn-enviar-pedido {
    background-color: #25D366; 
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-cancelar {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

/* Modal de Galería Multimedia */
.modal-galeria {
    display: none;
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9); 
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.img-principal-galeria {
    max-width: 90%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    object-fit: contain;
}

.controles-galeria {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-galeria {
    background-color: #ffffff;
    color: #333;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-galeria:hover {
    background-color: #dddddd;
}

.btn-cerrar-galeria {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

/* ==========================================
   WIDGET DE CHAT DE WHATSAPP
   ========================================== */
.contenedor-widget-wa {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.btn-whatsapp-flotante {
    background-color: #25D366;
    border: none;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn-whatsapp-flotante:hover {
    transform: scale(1.1);
    background-color: #20b858;
}

/* La ventana oculta por defecto */
.ventana-chat {
    display: none; /* Se mantiene oculta hasta que damos clic */
    flex-direction: column;
    width: 300px;
    background-color: #e5ddd5; /* Color de fondo de WhatsApp */
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    margin-bottom: 15px;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

.cabecera-chat {
    background-color: #075e54;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cerrar-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.cuerpo-chat {
    padding: 20px;
    min-height: 100px;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* Fondo de doodles de WA */
}

.burbuja-mensaje {
    background-color: white;
    color: black;
    padding: 10px 15px;
    border-radius: 0 15px 15px 15px;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: inline-block;
    max-width: 90%;
}

.pie-chat {
    background-color: #f0f0f0;
    padding: 10px;
    display: flex;
    gap: 10px;
}

.pie-chat input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    outline: none;
}

.btn-enviar-chat {
    background-color: #128C7E;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==========================================
   BARRA DE CONFIANZA (MERCADO PAGO)
   ========================================== */
.barra-pagos {
    background-color: #009ee3 !important; /* El important fuerza el color azul */
    color: white !important;
    text-align: center;
    padding: 12px 20px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    z-index: 10;
    position: relative;
}

.barra-pagos b {
    font-weight: bold;
    color: #ffffff;
}

/* Ocultar el salto de línea en computadoras para que se vea en un solo renglón */
.salto-movil {
    display: none;
}

/* Hacer que en celulares el texto se acomode bonito en dos renglones */
@media (max-width: 600px) {
    .barra-pagos {
        font-size: 13px;
        padding: 10px 15px;
    }
    .salto-movil {
        display: block;
    }
}

/* ==========================================
   MENÚ DESPLEGABLE (DROPDOWN CORREGIDO)
   ========================================== */
.contenedor-dropdown {
    position: relative;
    display: inline-block; /* Mantiene el tamaño original de tu botón */
}

/* El cuadro que contiene las subopciones */
.dropdown-contenido {
    display: none !important; /* Forzamos a que esté oculto por defecto */
    position: absolute;
    top: 100%; /* Cae justo pegadito abajo del botón principal */
    left: 0; /* Se alinea perfectamente a la izquierda del botón padre */
    width: 100%; /* ¡ESTO HACE QUE MIDA EXACTAMENTE LO MISMO QUE EL BOTÓN! */
    background-color: rgba(0, 0, 0, 0.9); 
    box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
    z-index: 999;
    border-radius: 0 0 8px 8px; /* Redondeado solo en la parte de abajo */
}

/* Forzar que aparezca al pasar el cursor */
.contenedor-dropdown:hover .dropdown-contenido {
    display: block !important;
}

/* El diseño de los botones de MDF y Acrílico */
.dropdown-contenido button {
    color: white;
    padding: 12px 0; /* Ajustamos el relleno para que se vean proporcionales */
    text-decoration: none;
    display: block;
    width: 100%; /* Llenan todo el cuadro */
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Una rayita muy sutil para separarlos */
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-family: Arial, sans-serif;
    transition: background 0.3s;
}

/* Color azul al pasar el cursor sobre MDF o Acrílico */
.dropdown-contenido button:hover {
    background-color: #009ee3;
}

/* ==========================================
   ESTILOS DEL CARRITO
   ========================================== */
#boton-carrito-flotante {
    position: fixed;
    bottom: 20px;
    left: 20px; /* Flota a la izquierda */
    background-color: #009ee3; /* Azul para combinar con Mercado Pago */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s;
}

#boton-carrito-flotante:hover {
    transform: scale(1.05);
}

/* Estilo para cada producto dentro del carrito */
.item-carrito {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    font-size: 14px;
}

.btn-eliminar-item {
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}

/* ==========================================
   CARRITO SUPERIOR DERECHO
   ========================================== */
#icono-carrito-superior {
    position: fixed; /* Se queda fijo al hacer scroll */
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.6); /* Círculo oscuro semitransparente */
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050; /* Por encima de todo */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

#icono-carrito-superior:hover {
    background-color: #009ee3; /* Se pinta de azul al pasar el cursor */
    transform: scale(1.1);
}

/* Bolita roja de notificación */
#badge-carrito {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff3333; /* Rojo alerta */
    color: white;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* ==========================================
   ANIMACIONES DE ENTRADA (CABECERA)
   ========================================== */

/* Animación 1: Zoom suave para el logo */
@keyframes aparecerLogo {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

/* Animación 2 y 3: Deslizamiento hacia arriba para los textos */
@keyframes subirTexto {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 1. Aplicamos la animación al Logo (dura 1 segundo) */
.contenedor-logo-texto .logo {
    animation: aparecerLogo 1s ease-out forwards;
}

/* 2. Aplicamos al Título H1 (espera medio segundo antes de salir) */
.contenedor-logo-texto .textos-header h1 {
    opacity: 0; /* Inicia invisible */
    animation: subirTexto 0.8s ease-out 0.4s forwards; 
}

/* 3. Aplicamos al Subtítulo P (espera casi un segundo para hacer el efecto cascada) */
.contenedor-logo-texto .textos-header p {
    opacity: 0; /* Inicia invisible */
    animation: subirTexto 0.8s ease-out 0.7s forwards; 
}