/* ==========================================================================
   1. VARIABLES Y ESTILOS BASE
   ========================================================================== */
:root {
    --brand-cyan: #2BC4F3;
    --brand-cyan-dark: #009dff;
    --bg-dark-blue: #0B1E2D;
    --bg-dark-card: #08141f;
    --text-dark: #111827;
    --text-white: #ffffff;
    --text-muted-light: #9ca3af;
    --font-family: 'Montserrat', sans-serif;
    --transition: all 0.3s ease;
}

/* --- Utilidades Globales --- */
.text-cyan { color: #00E5FF !important; }
.text-light-muted { color: rgba(255, 255, 255, 0.6) !important; }
.ls-1 { letter-spacing: 1px; }

.btn-cyan {
    background-color: #00E5FF;
    color: #0B1E2D;
    border: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-cyan:hover {
    background-color: #ffffff;
    color: #0B1E2D;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.4);
}

/* ==========================================================================
   2. HEADER / HERO (CATÁLOGO)
   ========================================================================== */
.catalog-header {
    padding-top: 160px;
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.catalog-header::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(11, 30, 45, 0.85), rgba(11, 30, 45, 0.85)),
        url(Imagenes/BackgroundheaderEnsayos1.webp);
    background-size: cover;
    filter: blur(1px);
    transform: scale(1.1);
    z-index: -1;
}

/* ==========================================================================
   3. PANEL DE CONTROLES Y FILTROS
   ========================================================================== */
.section-background-lab {
    position: relative;
    padding: 60px 0;
    background: 
        linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)),
        url('Imagenes/BackgroundEnsayos_1.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.controls-panel {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.btn-pill {
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-pill:hover { border-color: var(--brand-cyan); color: var(--brand-cyan); }

.btn-pill.active {
    background: var(--brand-cyan);
    color: #0B1E2D;
    border-color: var(--brand-cyan);
    box-shadow: 0 4px 10px rgba(43, 196, 243, 0.3);
}

/* Buscador */
.search-wrapper { position: relative; }
.search-wrapper i {
    position: absolute;
    left: 15px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.form-control-search {
    width: 100%;
    padding: 0.6rem 0.6rem 0.6rem 2.5rem;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    outline: none;
    transition: 0.3s;
}

.form-control-search:focus {
    background: white;
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 3px rgba(43, 196, 243, 0.1);
}

/* ==========================================================================
   4. TARJETAS DEL CATÁLOGO (CARDS)
   ========================================================================== */
.catalog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
    border: 1px solid #cddceb;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.catalog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: var(--brand-cyan);
}

/* Header de imagen en tarjeta */
.card-image-header {
    height: 140px; 
    width: 100%;
    position: relative;
    overflow: hidden; 
}

.card-img-bg {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: transform 0.5s ease;
}

.catalog-card:hover .card-img-bg { transform: scale(1.1); }

.card-image-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent);
    z-index: 1;
}

/* Cuerpo de la tarjeta */
.card-body {
    padding: 1.2rem 1.5rem; 
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title-text {
    color: #0B1E2D; 
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.3;
}

.card-icon { color: #9ca3af; transition: 0.3s; }
.catalog-card:hover .card-icon { color: var(--brand-cyan); }

/* Etiquetas y Acentos */
.card-top-accent { height: 4px; width: 100%; z-index: 2; position: relative; }
.acc-mecanico { background: #f97316; }
.acc-electrico { background: #facc15; }
.acc-termico { background: #ef4444; }
.acc-dimensional { background: #3b82f6; }
.acc-quimico { background: #8b5cf6; }
.acc-seguridad { background: #22c55e; }

.status-badge {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 10;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 30px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    border: none;
}

.badge-acreditado { background: linear-gradient(135deg, #00b09b, #96c93d); color: white; }
.badge-verificacion { background: linear-gradient(135deg, #fce38a, #f38181); color: #333; }

/* Lista de productos internos */
.products-block {
    background: #f8fafc; 
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--brand-cyan);
    margin-top: auto;
}

.product-list-ul {
    padding-left: 0; margin-bottom: 0; list-style: none; font-size: 0.85rem; color: #555; 
}

.product-list-ul li { margin-bottom: 5px; position: relative; padding-left: 15px; }
.product-list-ul li::before {
    content: "•"; color: var(--brand-cyan); font-weight: bold; position: absolute; left: 0;
}

/* ==========================================================================
   5. SECCIÓN ACREDITACIÓN (DISEÑO LEGAL)
   ========================================================================== */
.section-acreditacion {
    padding: 80px 0;
    background-color: #16324a; 
    background-image: linear-gradient(135deg, #16324a 0%, #1e405e 100%);
    position: relative;
}

.certificate-card-legal {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.certificate-card-legal .col-md-7 {
    max-width: 350px !important; 
    flex: 0 0 350px !important;
}

.certificate-card-legal .col-md-5 {
    flex: 1 !important; 
    max-width: none !important;
}

.certificate-card-legal .bg-white {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1.5rem !important;
}

.certificate-card-legal .img-fluid {
    max-height: 120px !important;
    width: auto;
    object-fit: contain;
}

.badge-container-legal {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.02);
}

.alcance-box {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--brand-cyan);
}

.glow-effect {
    position: absolute;
    top: -30px; right: -30px;
    width: 150px; height: 150px;
    background: var(--brand-cyan);
    filter: blur(70px); opacity: 0.15;
    pointer-events: none;
}

.extra-small { font-size: 0.75rem; }
.font-italic { font-style: italic; }

/* ==========================================================================
   6. FOOTER Y BOTONES GLOBALES
   ========================================================================== */
.main-footer {
    background-color: #050e14; 
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.95rem;
}

.social-link {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    color: white; border-radius: 50%; margin-right: 10px;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #00E5FF; 
    color: #000;
    transform: translateY(-3px);
}

.footer-links-list li { margin-bottom: 8px; }
.footer-links-list a:hover { color: #00E5FF !important; padding-left: 5px; }

.developer-bar {
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.dev-link { font-weight: bold; color: #00E5FF; transition: color 0.3s; }

/* Whatsapp Flotante */
.whatsapp-btn {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 60px; height: 60px;
    background-color: #25d366;
    color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; z-index: 9999;
    animation: pulse-green 2s infinite, fadeInUp 1s ease;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   7. MEDIA QUERIES (RESPONSIVE DESIGN ROBUSTO)
   ========================================================================== */

/* --- A. Pantallas Ultra-Wide (>1400px) --- */
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
    .display-4 { font-size: 3.5rem; }
    .catalog-card { min-height: 450px; }
}

/* --- B. Laptops y PCs estándar (992px a 1399px) --- */
@media (max-width: 1200px) {
    .card-title-text { font-size: 1.1rem; }
    .btn-pill { padding: 0.5rem 1rem; font-size: 0.85rem; }
}

/* --- C. Tablets y Laptops Pequeñas (768px a 991px) --- */
@media (max-width: 991px) {
    /* Header */
    .catalog-header { padding-top: 140px; padding-bottom: 60px; text-align: center; }
    .display-4 { font-size: 2.8rem; }
    
    /* Filtros */
    .controls-panel { padding: 1.25rem; }
    .filter-group { 
        display: flex; 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 8px; 
    }
    
    /* Grid de tarjetas */
    .catalog-card { margin-bottom: 1rem; }
    .card-image-header { height: 130px; }

    /* Acreditación */
    .certificate-card-legal .col-md-7 {
        max-width: 100% !important;
        flex: 0 0 100% !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* --- D. Móviles Grandes (576px a 767px) --- */
@media (max-width: 767.98px) {
    .section-background-lab { padding: 40px 0; }
    
    /* Header */
    .catalog-header { padding-top: 120px; padding-bottom: 50px; }
    .display-4 { font-size: 2.2rem; }
    .lead { font-size: 1rem; }

    /* Controles */
    .btn-pill { 
        flex: 1 1 auto; 
        min-width: 120px; 
        font-size: 0.8rem; 
        text-align: center; 
    }
    .search-wrapper { margin-top: 1rem; }

    /* Tarjetas */
    .card-image-header { height: 160px; }
    .card-title-text { font-size: 1.2rem; } /* Más grande para legibilidad en una sola columna */

    /* Acreditación */
    .section-acreditacion { padding: 50px 0; text-align: center; }
    .d-flex.gap-3 { flex-direction: column; gap: 15px !important; }
    .badge-container-legal { width: 100%; justify-content: center; }
    
    /* Botón flotante */
    .whatsapp-btn { 
        width: 50px; 
        height: 50px; 
        font-size: 24px; 
        bottom: 20px; 
        right: 20px; 
        animation: fadeInUp 1s ease; 
    }
}

/* --- E. Móviles Pequeños (iPhone SE / Pantallas <400px) --- */
@media (max-width: 400px) {
    .display-4 { font-size: 1.8rem; }
    .btn-pill { padding: 5px 10px; font-size: 0.75rem; }
    .card-body { padding: 1rem; }
    .products-block { padding: 0.75rem; }
    .product-list-ul { font-size: 0.8rem; }
}