/* =============================================================
   STELLA JOYEROS - ESTILO DEFINITIVO (CORRECCIÓN MÓVIL)
   ============================================================= */

/* --- 1. CONFIGURACIÓN BASE BLINDADA --- */
:root {
    --gold: #D1D5DB;       /* Plata Titanio */
    --dark: #0f0f0f;       /* Negro Onyx */
    --grey: #1a1a1a;       /* Gris Carbón */
    --text: #e5e5e5;       /* Blanco Humo */
    --white: #ffffff;      /* Blanco Puro */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* TRUCO ANTI-DESBORDE: Aplicado a HTML y BODY */
html, body {
    width: 100%;
    overflow-x: hidden; /* Corta cualquier cosa que sobresalga horizontalmente */
    position: relative;
    font-family: 'Lato', sans-serif;
    color: var(--text);
    line-height: 1.7;
    background-color: var(--dark);
}

h1, h2, h3, h4 { font-family: 'Cinzel', serif; color: var(--white); }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; height: auto; } /* Imágenes flexibles siempre */

/* --- 2. BARRA DE NAVEGACIÓN --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 5%; background-color: var(--dark);
    box-shadow: 0 2px 10px rgba(255,255,255,0.05);
    position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid #333;
}
.logo {
    font-size: 1.5rem; font-weight: 700; letter-spacing: 2px;
    display: flex; align-items: center; gap: 12px;
}
.logo img { height: 45px; width: auto; object-fit: contain; }
.logo span { color: var(--gold); }

.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a { color: var(--text); font-size: 0.9rem; letter-spacing: 1px; }
.nav-links a:hover { color: var(--gold); }

.btn-cita {
    padding: 8px 20px; border: 1px solid var(--gold); color: var(--gold);
    text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px;
}
.btn-cita:hover { background: var(--gold); color: var(--dark); }

.burger { display: none; cursor: pointer; }
.burger div { width: 25px; height: 2px; background: var(--white); margin: 5px; transition: all 0.3s ease; }
.toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); background: var(--gold); }
.toggle .line2 { opacity: 0; }
.toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); background: var(--gold); }

/* --- 3. SECCIÓN HERO --- */
.hero {
    height: 85vh; position: relative; display: flex; align-items: center; justify-content: center;
    text-align: center; color: var(--white);
    background: url('img/home/portada-joyeria.jpg'); background-size: cover; background-position: center;
}
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); }
.hero-content { position: relative; z-index: 2; padding: 20px; width: 100%; } /* Width 100% para evitar desbordes */
.hero-content h1 { font-size: 3.5rem; margin-bottom: 1rem; letter-spacing: 3px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-content p { font-size: 1.2rem; margin-bottom: 2rem; font-weight: 300; color: #ddd; }

.btn-gold {
    border: 1px solid var(--gold); color: var(--gold); padding: 15px 35px;
    text-transform: uppercase; letter-spacing: 2px; font-weight: bold; display: inline-block;
}
.btn-gold:hover { background-color: var(--gold); color: var(--dark); box-shadow: 0 0 15px rgba(209, 213, 219, 0.4); }

/* --- 4. SECCIONES GENERALES --- */
.section-padding { padding: 5rem 5%; }
.text-center { text-align: center; }
.bg-light { background-color: var(--grey); } 
.bg-dark { background-color: #000; border-top: 1px solid #333; }
.gold-line { width: 60px; height: 3px; background: var(--gold); margin: 1.5rem auto; }

.split { display: flex; align-items: center; gap: 4rem; }
.reverse { flex-direction: row-reverse; }
.image-block, .text-block { flex: 1; min-width: 0; } /* Min-width 0 evita flexbox overflow bugs */

.image-block img { width: 100%; box-shadow: 10px 10px 0px #333; filter: grayscale(20%); transition: 0.5s; }
.image-block img:hover { filter: grayscale(0%); }
.service-list li { margin-bottom: 0.8rem; font-size: 1.1rem; color: #ccc; }

.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 3rem; }
.review-card { background: rgba(255,255,255,0.03); padding: 2rem; border: 1px solid rgba(255,255,255,0.1); text-align: center; }
.stars { color: var(--gold); margin-bottom: 1rem; letter-spacing: 5px; }
.review-card span { display: block; margin-top: 1rem; color: var(--gold); font-style: italic; }

/* --- 5. FOOTER --- */
footer { background: #050505; color: #666; padding: 4rem 5% 1rem; border-top: 1px solid #222; }
.footer-content { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.contact-details p { margin-bottom: 0.5rem; }
.map-box { flex: 1; min-width: 300px; filter: grayscale(100%) invert(100%); opacity: 0.7; }
.copyright { text-align: center; border-top: 1px solid #222; margin-top: 3rem; padding-top: 1rem; font-size: 0.8rem; }

/* --- 6. CATÁLOGO --- */
.catalog-controls { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
input, select { padding: 10px; border: 1px solid #444; background: #222; color: var(--white); font-family: 'Lato', sans-serif; max-width: 100%; }

.catalog-grid {
    display: grid;
    /* 250px es bueno, pero auto-fill lo gestiona */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem; width: 100%; justify-content: center;
}

.product-card {
    background-color: #151515; border: 1px solid #333; padding: 1rem;
    text-align: center; cursor: pointer; transition: 0.3s;
}
.product-card:hover { border-color: var(--gold); box-shadow: 0 0 20px rgba(255,255,255,0.05); transform: translateY(-5px); }
.product-card img { width: 100%; height: 250px; object-fit: contain; margin-bottom: 1rem; filter: brightness(0.9); transition: 0.3s; }
.product-card:hover img { filter: brightness(1.1); }
.product-card h4 { margin-bottom: 0.5rem; color: var(--white); }
.product-card .price { color: var(--gold); font-weight: bold; font-size: 1.2rem; }

/* =============================================================
   7. MODAL DEFINITIVO (SIN ZOOM RARO Y SIN FONDO NEGRO)
   ============================================================= */
.modal {
    display: none; position: fixed; z-index: 10000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.95);
    align-items: flex-start; justify-content: center;
    overflow-y: auto; padding: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background-color: #1a1a1a; color: var(--white);
    padding: 3rem 1.5rem 2rem 1.5rem; text-align: center;
    
    /* ANCHO SEGURO PARA MÓVIL */
    width: 90%; 
    max-width: 500px;
    
    margin: 10vh auto 50px auto;
    position: relative; border: 1px solid var(--gold);
    border-radius: 8px; box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

/* CRUZ DE CERRAR */
.close-btn {
    position: absolute; top: 10px; right: 15px;
    font-size: 2.5rem; color: var(--white); cursor: pointer; line-height: 1;
    z-index: 20; width: 40px; height: 40px;
    background: rgba(0,0,0,0.5); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { color: var(--gold); background: rgba(255,255,255,0.1); }

/* Galería de Fotos (LIMPIA, SIN FONDO NEGRO) */
.galeria-container {
    position: relative; display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
    border-radius: 8px; overflow: hidden;
    /* Fondo eliminado */
}

/* IMAGEN DEL MODAL: CRUCIAL PARA EVITAR ZOOM */
.modal-content img { 
    width: 100%; 
    height: auto;
    max-height: 400px; 
    object-fit: contain; 
}

.nav-btn {
    background: rgba(0,0,0,0.6); color: white; border: none;
    padding: 15px; font-size: 1.2rem; cursor: pointer;
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
}
.nav-btn:hover { background: var(--gold); color: #000; }
.prev { left: 0; } .next { right: 0; }

/* Botón WhatsApp */
.btn-llamada-doble {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 15px; 
    width: 100%; 
    /* MAX-WIDTH 100% PARA QUE NO REVIENTE EN MÓVILES PEQUEÑOS */
    max-width: 100%; 
    margin: 0 auto;
    text-align: center; white-space: normal;
    background: var(--gold); color: var(--dark); border-radius: 4px;
}
.btn-llamada-doble:hover { background: var(--white); box-shadow: 0 0 15px rgba(255,255,255,0.5); }
.btn-llamada-doble .texto-grande { font-size: 0.9rem; font-weight: bold; margin-bottom: 5px; display: block; }
.btn-llamada-doble .texto-pequeno { font-size: 0.9rem; opacity: 0.9; }

/* --- 8. ADAPTACIÓN MÓVIL (CORREGIDA) --- */
@media (max-width: 768px) {
    /* Menú lateral oculto a la derecha */
    .nav-links {
        position: absolute; right: 0; top: 70px; height: 90vh;
        background: var(--dark); flex-direction: column; 
        /* WIDTH 80% en vez de 100% para evitar problemas de scroll */
        width: 80%;
        transform: translateX(100%); transition: 0.5s ease;
        justify-content: center; border-top: 1px solid var(--gold);
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }
    .nav-active { transform: translateX(0%); }
    .burger { display: block; }
    
    .split { flex-direction: column; }
    .hero-content h1 { font-size: 2.2rem; }
    .image-block img { margin-bottom: 2rem; }
    
    /* Ajustes del Modal en Móvil */
    .modal-content {
        margin-top: 20px; 
        margin-bottom: 40px;
        width: 92%; /* Un poco más de margen lateral */
        padding: 3rem 1rem 1.5rem 1rem;
    }
    
    .modal-content img {
        max-height: 250px; 
        max-width: 100%; /* Cinturón de seguridad */
    }
    
    /* Botón WhatsApp en móvil */
    .btn-llamada-doble .texto-grande { font-size: 0.8rem; }
    
    .close-btn { top: 5px; right: 5px; width: 35px; height: 35px; font-size: 2rem; }
    
    /* Grid de productos en móvil */
    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}
