/* ============================================================
   1. VARIABLES Y CONFIGURACIÓN GENERAL 
   ============================================================ */
:root {
    --azul: #004a99;
    --celeste: #00c3ff;
    --oscuro: #1a1a1a;
    --gris: #f4f4f4;
    --whatsapp: #25d366;
    --blanco: #ffffff;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    line-height: 1.6;
    color: var(--oscuro);
    background-color: var(--blanco);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

html { scroll-behavior: smooth; }

/* ============================================================
   2. NAVEGACIÓN Y BARRA DE CONFIANZA 
   ============================================================ */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 10px 5%; 
    background: var(--blanco); 
    position: sticky; 
    top: 0; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    z-index: 1000; 
}

.logo img { height: 80px; width: auto; }

.nav-links { list-style: none; display: flex; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--oscuro); font-weight: 600; transition: 0.3s; }
.nav-links a:hover { color: var(--azul); }

.trust-bar {
    background: var(--oscuro);
    color: var(--blanco);
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    border-bottom: 2px solid var(--celeste);
}

/* ============================================================
   3. HERO SECCIÓN 
   ============================================================ */
.hero { 
    height: 70vh; 
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                url('img/trabajo7.jpg'); 
    background-size: cover;
    background-position: center;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    color: var(--blanco);
}

.hero-text h1 { font-size: 3rem; margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.hero-text p { font-size: 1.3rem; margin-bottom: 25px; }

.btn-cotizar {
    background: var(--celeste);
    color: var(--blanco);
    padding: 18px 35px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    transition: 0.3s;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 195, 255, 0.4);
}

.btn-cotizar:hover { background: var(--azul); transform: scale(1.05); }

.btn-cotizar2 {
    background: var(--celeste);
    color: var(--blanco);
    padding: 18px 35px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    transition: 0.3s;
    font-size: 0.7rem;
    box-shadow: 0 4px 15px rgba(0, 195, 255, 0.4);
}

.btn-cotizar2:hover { background: var(--azul); transform: scale(1.05); }

/* ============================================================
   4. CONTENEDORES Y SECCIONES 
   ============================================================ */
.container { padding: 80px 5%; text-align: center; max-width: 1200px; margin: auto; }
.section-title { font-size: 2.2rem; color: var(--azul); margin-bottom: 45px; font-weight: 800; }

.features { display: flex; gap: 25px; flex-wrap: wrap; justify-content: center; }
.feature-card { 
    flex: 1; 
    min-width: 280px; 
    padding: 40px; 
    background: var(--gris); 
    border-radius: 15px; 
    transition: 0.3s;
    border: 1px solid #eee;
}
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.feature-card i { font-size: 3rem; color: var(--azul); margin-bottom: 20px; }

/* ============================================================
   5. GALERÍA DE TRABAJOS 
   ============================================================ */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }
.gallery-item { position: relative; overflow: hidden; border-radius: 10px; height: 260px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.gallery-item:hover img { transform: scale(1.1); }
.gallery-overlay {
    position: absolute; bottom: 0; background: rgba(0, 74, 153, 0.9);
    color: white; width: 100%; padding: 15px; font-weight: bold;
}

/* ============================================================
   6. APP DE COTIZACIÓN (FORMULARIO) 
   ============================================================ */
.contact-section { padding: 80px 5%; background: var(--azul); color: var(--blanco); text-align: center; overflow: visible !important; }

#contactForm { max-width: 1000px; margin: 40px auto; display: flex; flex-direction: column; gap: 15px; }

#contactForm input, #contactForm select, #contactForm textarea { 
    padding: 15px; border-radius: 8px; border: none; font-size: 1rem; width: 100%;
}

.form-group-row { display: flex; gap: 10px; }

.form-group-medidas { 
    background: rgba(255,255,255,0.1); 
    padding: 30px; 
    border-radius: 15px; 
    border: 1px dashed rgba(255,255,255,0.4);
    text-align: left;
    overflow: visible !important;
}

.medida-row {
    display: flex; gap: 15px; margin-bottom: 15px; background: var(--blanco);
    padding: 20px; border-radius: 10px; flex-wrap: wrap; align-items: flex-end;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: visible !important;
}

.medida-row .col { display: flex; flex-direction: column; flex: 1; min-width: 130px; }
.medida-row label { 
    font-size: 0.75rem; font-weight: bold; color: #666; 
    margin-bottom: 8px; text-transform: uppercase; 
}

/* INPUTS DE MEDIDAS */
.ancho-v, .alto-v { 
    border: 2px solid var(--celeste) !important; 
    background: #f0faff !important; 
    font-weight: bold;
    color: var(--azul);
}

.btn-secundario {
    background: var(--oscuro); color: var(--blanco); padding: 12px 25px;
    border: none; border-radius: 8px; cursor: pointer; font-weight: bold;
    transition: 0.3s;
}
.btn-secundario:hover { background: #333; }

/* TOTAL FINAL */
#box-total {
    background: var(--blanco);
    padding: 30px;
    border-radius: 15px;
    text-align: right;
    color: var(--oscuro);
    border: 3px solid var(--celeste);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

#precioTotal {
    font-size: 3.5rem;
    color: var(--azul);
    line-height: 1.2;
    margin: 10px 0;
    font-weight: 800;
}

/* ============================================================
   7. BOTÓN DE ENVÍO Y WHATSAPP 
   ============================================================ */
.btn-submit { 
    background: var(--whatsapp); 
    color: var(--blanco); 
    border: none; 
    padding: 22px; 
    font-weight: 800; 
    cursor: pointer; 
    border-radius: 10px; 
    font-size: 1.3rem;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    animation: pulse-green 2s infinite;
    text-transform: uppercase;
}

@keyframes pulse-green {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { transform: scale(1.03); box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

footer { padding: 40px; text-align: center; background: #eee; font-size: 0.9rem; }

/* ============================================================
   8. SELECT2 PERSONALIZADO (TEXTO LIMPIO)
   ============================================================ */
.select2-container--default .select2-selection--single {
    height: 50px !important;
    border: 2px solid var(--celeste) !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    font-weight: 600;
    color: var(--oscuro) !important;
}
.select2-dropdown { border: 2px solid var(--celeste) !important; z-index: 9999; }

/* ============================================================
   9. EFECTO LUPA GIGANTE (PREVIEW VIDRIOS)
   ============================================================ */
.preview-vidrio {
    margin-top: 15px;
    text-align: center;
    height: 65px; 
    position: relative;
    z-index: 5;
}

.img-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #ddd;
    object-fit: cover;
    cursor: zoom-in;
    background-color: #fff;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease, 
                border-color 0.3s ease;
    position: relative;
    z-index: 1;
}

.img-preview:hover {
    transform: scale(6.5); /* EXPANSIÓN GIGANTE */
    z-index: 99999 !important; 
    box-shadow: 0 15px 45px rgba(0,0,0,0.6);
    border-color: var(--celeste);
}

/* ============================================================
   10. RESPONSIVE 
   ============================================================ */
@media (max-width: 768px) {
    .hero-text h1 { font-size: 2.2rem; }
    .navbar { flex-direction: column; padding: 20px; }
    .nav-links { margin-top: 15px; font-size: 0.9rem; }
    .form-group-row { flex-direction: column; }

    .medida-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .col-cant, .col-lamina, .col-sub-tipo, .col-subtotal { grid-column: span 2; }
    #precioTotal { font-size: 2.5rem; }

    /* Ajuste de lupa para móviles */
    .img-preview:hover { transform: scale(3.5); }
}

@media (min-width: 1024px) {
    .hero { background-attachment: fixed; }
}
.info-uv {
    background: #f4f4f4; /* Un fondo sutil para separar el bloque */
    padding: 15px;
    border-radius: 8px;
    
}

.texto-uv {
    font-size: 0.9rem; /* Letra más chica */
    line-height: 1.5;  /* Espacio entre líneas para mejor lectura */
    color: #444;       /* Un gris oscuro que cansa menos la vista que el negro */
    margin-bottom: 10px;
}

.texto-uv strong {
    color: #1a1a1a;    /* Destaca más la negrita */
    font-weight: 700;
}

/* Estilos para el Modal de Galería */
.modal-galeria {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
}

.modal-contenido {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform: scale(0)} 
    to {transform: scale(1)}
}

.cerrar-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
}

#caption-modal {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 1.2rem;
}

/* Responsivo para celulares */
@media only screen and (max-width: 700px){
    .modal-contenido { width: 100%; }
}

.gallery-item {
    cursor: pointer; /* Indica al iPhone que es un botón */
    -webkit-tap-highlight-color: transparent; /* Quita el cuadro azul feo al tocar */
}

/* Evita que el overlay bloquee el click en móviles */
.gallery-overlay {
    pointer-events: none; 
}

/* Esto evita que el iPhone abra el menú de 'Guardar Imagen' y priorice el clic */
.gallery-item img {
    -webkit-touch-callout: none !important; /* Desactiva el menú contextual de iOS */
    -webkit-user-select: none !important;    /* Evita selección */
    user-select: none !important;
    pointer-events: none;                   /* El toque pasa a través de la imagen hacia el contenedor */
}

.gallery-item {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}