/* --- PALETA DE COLORES Y FUENTES PREMIUM --- */
:root {
    --primary: #c0c5ce; /* Plateado elegante para botones/bordes */
    --secondary: #12151c; /* Azul medianoche / Antracita profundo (cielo nocturno) */
    --accent: #d4af37; /* Oro champán para precios y detalles */
    --bg-color: #f8f7f5; /* Gris/Crema muy cálido y suave */
    --text-color: #333333;
    
    /* Fuentes inspiradas en tu logo */
    --font-serif: 'Playfair Display', serif; /* Para Títulos (ESTRELLITA) */
    --font-sans: 'Montserrat', sans-serif;   /* Para Textos (joyeria) */
}

/* --- ESTILOS BASE --- */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
}

/* Bloquear scroll mientras carga */
body.loading-state {
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    color: var(--secondary);
    font-weight: 600;
}

/* --- PANTALLA DE CARGA (LOADER) --- */
.loader-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background-color: var(--secondary); /* Fondo oscuro profundo */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s ease;
}

.loader-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-logo {
    width: 280px; /* Tamaño de tu logo en la carga */
    opacity: 0;
    z-index: 2;
    /* Animación: Aparece suavemente, crece un poco y luego se mantiene */
    animation: fadeInGlow 2s ease forwards 0.5s;
    filter: drop-shadow(0 0 15px rgba(192, 197, 206, 0.2));
}

/* Efecto de destello giratorio detrás del logo */
.sparkle-effect {
    position: absolute;
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    z-index: 1;
    animation: twinkleSpin 3s linear infinite 0.5s;
}

@keyframes fadeInGlow {
    0% { opacity: 0; transform: scale(0.9); filter: brightness(0.5); }
    50% { opacity: 1; transform: scale(1.05); filter: brightness(1.2); }
    100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}

@keyframes twinkleSpin {
    0% { transform: scale(0.5) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.6; }
    100% { transform: scale(0.5) rotate(360deg); opacity: 0; }
}

.loader-container.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* --- HEADER PREMIUM --- */
header {
    background-color: var(--secondary);
    color: white;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header-logo {
    height: 90px; /* Ajusta el tamaño de tu logo en el menú */
    object-fit: contain;
    width: auto;
    /* Si tu logo tiene letras negras y el fondo es oscuro, usa este filtro para volverlo blanco/plateado: */
    /* filter: brightness(0) invert(1); */
}

/* --- BOTONES ESTILO PLATA --- */
.btn-primary {
    background: #12151c;
    color: var(--secondary);
    border: 1px solid #c0c5ce;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0; /* Bordes rectos para mayor elegancia */
}

.btn-primary:hover {
    background: #12151c;
    box-shadow: 0 5px 15px rgba(192, 197, 206, 0.4);
    transform: translateY(-2px);
}

/* --- TARJETAS DE PRODUCTO (Ajustes elegantes) --- */
.product-card {
    border: 1px solid #eaeaea;
    border-radius: 0;
    background: white;
    padding: 1.5rem;
    text-align: center;
}
.product-card h3 {
    font-size: 1.3rem;
    margin: 1rem 0 0.5rem 0;
}
.product-card .price {
    color: var(--accent); /* Precios en Dorado Champán */
    font-size: 1.2rem;
    font-weight: 500;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background-color: var(--bg-light); color: var(--text); }

header {
    background-color: var(--secondary);
    color: white;
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo { font-size: 1.5rem; font-weight: bold; letter-spacing: 1px;}
.cart-icon { font-weight: bold; cursor: pointer; background: rgba(255,255,255,0.1); padding: 0.5rem 1rem; border-radius: 20px;}

.container {
    display: flex;
    padding: 2rem 5%;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}
/* --- ESTILOS PARA EL FOOTER Y ADMIN OCULTO --- */

/* Creamos la base del pie de página para estructurar nuestra sección final */
footer {
    background-color: var(--secondary);
    color: white;
    padding: 1.5rem 5%;
    margin-top: 3rem;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Configuramos el estilo sutil para que el enlace pase desapercibido */
.admin-discreto {
    color: rgba(255, 255, 255, 0.15); /* Muy baja opacidad para camuflarlo */
    text-decoration: none;
    transition: all 0.4s ease;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Revelamos el enlace con el color dorado champán solo al hacer hover */
.admin-discreto:hover {
    color: var(--accent); 
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Ajustamos el comportamiento responsivo para dispositivos móviles */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Filtros */
.filters {
    width: 260px;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    height: fit-content;
    position: sticky;
    top: 90px;
}
.filters h3 { margin-bottom: 1.5rem; color: var(--secondary); font-size: 1.3rem;}
.filter-group { margin-bottom: 1.5rem; }
.filter-group h4 { margin-bottom: 0.8rem; font-size: 0.95rem; color: #666; text-transform: uppercase; letter-spacing: 0.5px;}
.filter-group label { display: flex; align-items: center; gap: 8px; margin-bottom: 0.6rem; cursor: pointer; font-size: 1rem; color: #444;}
.filter-group input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.filter-group select { width: 100%; padding: 0.7rem; border-radius: 8px; border: 1px solid #ddd; font-size: 1rem; color: #333; outline: none;}
.filter-group select:focus { border-color: var(--primary); }

/* Grid de Productos */
.catalog {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}
.product-card:hover { transform: translateY(-8px); box-shadow: 0 12px 25px rgba(0,0,0,0.1); }
.product-card img { width: 100%; height: 240px; object-fit: cover; }
.product-info { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.product-info h3 { font-size: 1.15rem; margin-bottom: 0.5rem; color: var(--secondary); line-height: 1.3;}
.product-info .price { font-weight: 700; font-size: 1.3rem; color: var(--accent); margin-bottom: 0.8rem; }

.badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    width: fit-content;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge.existencia { background-color: var(--stock-ok); }
.badge.resurtiendo { background-color: var(--stock-wait); }

.btn-primary {
    background-color: #12151c;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    margin-top: auto;
    transition: all 0.2s;
    width: 100%;
}
.btn-primary:hover { background-color: #d68910; transform: scale(1.02); }
.btn-primary:disabled { background-color: #e0e0e0; color: #999; cursor: not-allowed; transform: none;}

/* Modal */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal.hidden { opacity: 0; pointer-events: none; }
.modal-content {
    background: white; width: 90%; max-width: 900px;
    border-radius: 16px; padding: 2.5rem; position: relative;
    max-height: 90vh; overflow-y: auto;
    transform: translateY(0);
    transition: transform 0.3s ease;
}
.modal.hidden .modal-content { transform: translateY(20px); }
.close-modal {
    position: absolute; top: 15px; right: 20px;
    font-size: 2.5rem; border: none; background: none; cursor: pointer; color: #888;
    transition: color 0.2s;
}
.close-modal:hover { color: #333; }
.modal-body { display: flex; gap: 3rem; }
.modal-gallery { flex: 1; max-width: 50%; }
.modal-gallery img#modal-main-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);}
.modal-thumbnails { display: flex; gap: 0.8rem; margin-top: 1rem; overflow-x: auto; padding-bottom: 0.5rem;}
.modal-thumbnails img { width: 70px; height: 70px; object-fit: cover; cursor: pointer; border: 2px solid transparent; border-radius: 8px; opacity: 0.6; transition: all 0.2s;}
.modal-thumbnails img:hover { opacity: 1; }
.modal-thumbnails img.active { border-color: var(--primary); opacity: 1; }
.modal-info { flex: 1; display: flex; flex-direction: column; justify-content: center;}
.modal-info h2 { margin-bottom: 0.5rem; color: var(--secondary); font-size: 2rem;}
.modal-info .price { font-size: 1.8rem; color:var(--accent); font-weight: bold; margin-bottom: 1rem;}
.modal-info .description { margin: 1.5rem 0 2.5rem; line-height: 1.7; color: #555; font-size: 1.05rem;}

/* Responsive */
@media (max-width: 850px) {
    .container { flex-direction: column; padding: 1.5rem 5%;}
    .filters { width: 100%; position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem;}
    .filters h3 { grid-column: 1 / -1; margin-bottom: 0.5rem;}
    .filter-group { margin-bottom: 0;}
    .modal-body { flex-direction: column; gap: 1.5rem;}
    .modal-gallery { max-width: 100%; }
    .modal-content { padding: 1.5rem; }
}
/* Estilos Específicos para el Carrito */
.cart-empty-msg { text-align: center; color: #888; font-size: 1.1rem; margin: 2rem 0; }
.cart-item { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    margin-bottom: 1rem; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 1rem; 
}
.cart-item img { 
    width: 60px; 
    height: 60px; 
    object-fit: cover; 
    border-radius: 8px; 
}
.cart-item-info { flex: 1; }
.cart-item-title { font-size: 1rem; font-weight: 600; color: var(--secondary); margin-bottom: 0.2rem;}
.cart-item-price { font-size: 0.95rem; color: var(--primary); font-weight: bold;}
.cart-item-controls { 
    display: flex; 
    align-items: center; 
    gap: 0.8rem; 
    margin-top: 0.5rem; 
}
.qty-btn { 
    background: #f0f0f0; border: none; width: 28px; height: 28px; 
    border-radius: 6px; cursor: pointer; font-weight: bold; color: #333;
    transition: background 0.2s;
}
.qty-btn:hover { background: #e0e0e0; }
.remove-btn { 
    background: transparent; color: #e74c3c; border: none; 
    cursor: pointer; font-size: 0.85rem; text-decoration: underline; margin-left: auto;
}
.remove-btn:hover { color: #c0392b; }
/* Asegura que el contenido del loader esté alineado correctamente */
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Estilos para el texto y el cursor parpadeante */
.typewriter {
    margin-top: 20px; /* Separación de la imagen */
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: white; /* Cambia esto si tu fondo es oscuro */
    min-height: 1.5em; /* Evita que el contenedor cambie de tamaño */
    border-right: 2px solid #333; /* Este es el cursor */
    padding-right: 5px;
    white-space: nowrap; /* Evita que el texto salte de línea mientras se escribe */
    animation: blinkCursor 0.75s step-end infinite;
}

/* Animación del cursor */
@keyframes blinkCursor {
    from, to { border-color: transparent; }
    50% { border-color: inherit; }
}
/* --- AJUSTES PARA 2 COLUMNAS EN CELULARES --- */
@media (max-width: 768px) {
    .catalog {
        grid-template-columns: repeat(2, 1fr); /* Fuerza 2 columnas iguales */
        gap: 10px; /* Reduce el espacio entre productos para que quepan mejor */
    }

    /* Ajustamos el tamaño de la tarjeta y los textos para móviles */
    .product-card {
        padding: 0; /* Quitamos padding extra para maximizar espacio */
    }

    .product-card img {
        height: 150px; /* Reducimos la altura de la imagen en celulares */
    }

    .product-info {
        padding: 1rem 0.5rem; /* Menos relleno en los lados */
    }

    .product-info h3 {
        font-size: 0.95rem; /* Letra un poco más pequeña para el título */
        margin-bottom: 0.3rem;
    }

    .product-info .price {
        font-size: 1.1rem; /* Ajuste del precio */
    }

    .btn-primary {
        padding: 0.6rem;
        font-size: 0.85rem; /* Botón un poco más compacto */
    }
}
/* --- EFECTO SLIDE PARA IMÁGENES DE PRODUCTOS --- */
.slider-container {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; /* Hace que el slide se "enganche" en cada foto */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Deslizamiento suave en iOS */
    scrollbar-width: none; /* Oculta la barra en Firefox */
}

/* Oculta la barra de scroll en Chrome, Safari y Edge */
.slider-track::-webkit-scrollbar {
    display: none;
}

.slider-track img {
    width: 100%;
    flex: 0 0 100%; /* Cada imagen ocupa el 100% del ancho de la tarjeta */
    scroll-snap-align: start; /* Punto de anclaje al deslizar */
    object-fit: cover;
}

/* Opcional: Indicador visual sutil para que el usuario sepa que puede deslizar */
.slider-container::after {
    content: '↔';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(18, 21, 28, 0.6);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    pointer-events: none; /* Para que no interfiera al tocar */
    opacity: 0.7;
}