/* =========================================
   ESTILOS EXCLUSIVOS SWISS MILITARY (LIGHT THEME ORIGINAL)
   ========================================= */

/* 1. FONDO DE LA PÁGINA */
body { 
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%) !important;
    color: #1f2937 !important;
}

/* 2. BARRA DE NAVEGACIÓN BLANCA */
.navbar { 
    background: rgba(255, 255, 255, 0.95) !important; 
    border-bottom: 2px solid #ef4444 !important; 
    backdrop-filter: blur(10px); 
}
.navbar a { color: #111 !important; }
.logo span { color: #ef4444 !important; } 
.burger div { background: #111 !important; }

/* 3. HEADER DE MARCA (ROJO DEGRADADO) */
.brand-intro {
    background: linear-gradient(135deg, #991b1b 0%, #ef4444 50%, #b91c1c 100%);
    padding: 5rem 2rem; 
    text-align: center; 
    color: white;
    position: relative; 
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(185, 28, 28, 0.3);
}
.texto-suizo {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 4. CONTROLES DEL CATÁLOGO CLAROS */
.catalog-controls {
    display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap;
}
.catalog-controls input, .catalog-controls select {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    color: #374151 !important;
    border-radius: 4px; 
    padding: 12px 20px;
    font-family: 'Lato', sans-serif;
    transition: 0.3s;
}
.catalog-controls input:focus, .catalog-controls select:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    outline: none;
}

/* 5. TARJETAS DE PRODUCTO (ANIMACIÓN DE BORDE ROJO) */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem; width: 100%; justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

@keyframes borde-rojo {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.product-card {
    position: relative;
    padding: 1.5rem;
    border-radius: 8px;
    background: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    cursor: pointer;
    
    /* El truco del borde mágico de Swiss */
    border: 2px solid transparent;
    background-image: linear-gradient(white, white), 
                      linear-gradient(45deg, #ef4444, #991b1b, #ffffff, #ef4444);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    background-size: 100% 100%, 300% 300%;
    
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.15);
    animation: borde-rojo 4s ease infinite;
}

.product-card img { width: 100%; height: 250px; object-fit: contain; margin-bottom: 1rem; }
.product-card h4 { color: #111; font-weight: bold; margin-bottom: 0.5rem; font-family: 'Cinzel', serif;}
.product-card .price { color: #b91c1c; font-size: 1.4rem; font-weight: 800; }
.category-tag { 
    color: #6b7280; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; 
    background: #f3f4f6; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 5px;
}
/* =========================================
   6. ESTRUCTURA BASE DEL MODAL
   ========================================= */

.modal {
    display: none; 
    position: fixed; 
    z-index: 10000; 
    left: 0; 
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.8); 
    align-items: center; /* Centramos verticalmente en vez de flex-start */
    justify-content: center;
    overflow-y: auto; 
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    position: relative; 
    border-radius: 8px; 
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    
    /* COMPRESIÓN DE ESPACIOS */
    width: 92%; 
    max-width: 420px; /* Un poco más estrecho para guiar la vista */
    padding: 2.5rem 1rem 1rem 1rem; /* Menos padding inferior y lateral */
    margin: auto; 
}

/* Cruz de cerrar más ajustada */
.close-btn {
    position: absolute; top: 5px; right: 10px;
    font-size: 2.5rem; cursor: pointer; line-height: 1;
    z-index: 20; width: 35px; height: 35px;
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}

/* Galería de fotos e imagen */
.galeria-container {
    position: relative; display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.5rem; /* Margen drásticamente reducido */
    width: 100%;
}

.modal-content img { 
    width: 100%; 
    height: auto; 
    max-height: 250px; /* Altura máxima reducida para escritorio */
    object-fit: contain; 
}

/* Flechas de navegación pegadas a los bordes */
.nav-btn {
    border: none; padding: 10px; font-size: 1.2rem; cursor: pointer;
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    transition: 0.3s;
}
.prev { left: -5px; } 
.next { right: -5px; }

/* Textos comprimidos */
#modal-titulo { margin-bottom: 5px; font-size: 1.1rem; }
#modal-precio { margin: 0 0 5px 0 !important; font-size: 1.3rem !important; }
.modal-text { margin-bottom: 5px; font-size: 0.8rem; }

/* Límite de altura para la descripción (Scroll interno SAKO) */
#modal-descripcion {
    margin: 0.5rem 0 !important; 
    padding: 5px 0 !important; 
    font-size: 0.85rem !important; 
    line-height: 1.4 !important;
    max-height: 65px; /* Solo caben unas 3 líneas */
    overflow-y: auto; /* Si es más largo, se hace scroll aquí dentro */
}

/* Scrollbar minimalista para la descripción */
#modal-descripcion::-webkit-scrollbar { width: 3px; }
#modal-descripcion::-webkit-scrollbar-thumb { background: #ef4444; border-radius: 10px; }

/* Compresión de checkboxes legales */
.privacy-wrapper {
    margin: 3px 0 !important; /* Pegados el uno al otro */
    font-size: 0.75rem !important; /* Texto legal más pequeño */
}

/* Botón de WhatsApp más afilado */
.btn-llamada-doble {
    padding: 10px !important; /* Menos alto */
    margin-top: 10px !important;
}
.btn-llamada-doble .texto-grande { font-size: 0.8rem !important; margin-bottom: 2px !important; }
.btn-llamada-doble .texto-pequeno { font-size: 1rem !important; }

/* =========================================
   ADAPTACIÓN MÓVIL EXTREMA
   ========================================= */
@media (max-width: 768px) {
    .modal-content {
        padding: 2rem 0.8rem 1rem 0.8rem; /* Aún más apretado en móvil */
        margin: 2vh auto; /* Despegamos solo un pelín del borde superior */
    }
    .modal-content img { 
        max-height: 180px !important; /* Imagen mucho más pequeña, salva mucho espacio */
    }
    #modal-descripcion {
        max-height: 50px; /* Apenas 2 líneas visibles en móvil */
    }
}

/* MENÚ MÓVIL EN MODO CLARO PARA SWISS */
@media (max-width: 768px) {
    .nav-links {
        background: rgba(255, 255, 255, 0.98) !important;
        border-left: 4px solid #ef4444 !important;
    }
    .nav-links a { color: #111 !important; }
    .burger div { background: #111 !important; }
}