/* ==========================================================================
   1. VARIABLES, BASE & UTILIDADES
   ========================================================================== */
: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;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { 
  scroll-behavior: smooth; 
  font-size: 16px; 
  scroll-padding-top: 100px;
}

body {
  font-family: var(--font-family);
  overflow-x: hidden;
  line-height: 1.7;
  color: var(--text-dark);
}

section { scroll-margin-top: 90px; }
a { text-decoration: none; color: inherit; transition: var(--transition); }

/* --- Utilidades Generales --- */
.section-padding-compact { padding: 5rem 0; }
.overflow-visible { overflow: visible !important; }
.ls-1 { letter-spacing: 1px; }

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--brand-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
}

.title-divider {
  width: 3.75rem; 
  height: 0.25rem; 
  background-color: var(--brand-cyan); 
  border-radius: 2px;
}

.text-cyan { color: #00E5FF !important; }
.text-light-muted { color: rgba(255, 255, 255, 0.6) !important; }

/* ==========================================================================
   2. NAVBAR
   ========================================================================== */
.navbar {
  padding: 1.2rem 0;
  background: transparent;
  transition: var(--transition);
}

.navbar-scrolled {
  background: rgba(11, 30, 45, 0.98) !important;
  padding: 0.8rem 0;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.brand-img { height: 4.5rem; width: auto; }

.nav-link {
  color: rgba(255,255,255,0.95) !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem !important;
  letter-spacing: 1px;
}

.nav-link:hover, .nav-link.active { color: var(--brand-cyan) !important; }

.btn-contact-nav {
  border: 2px solid var(--brand-cyan);
  color: var(--brand-cyan);
  padding: 0.5rem 1.8rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-contact-nav:hover {
  background: var(--brand-cyan);
  color: #0B1E2D;
  box-shadow: 0 0 15px rgba(43, 196, 243, 0.4);
}

.dropdown-menu { border: none !important; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.dropdown-item { color: #cbd5e1; padding: 0.5rem 0; }
.dropdown-item:hover { color: white; background: transparent; padding-left: 5px; }

/* ==========================================================================
   3. HERO SECTION
   ========================================================================== */
.hero {
  background: url('Imagenes/Background.webp') no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex; align-items: center; position: relative;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(4, 13, 20, 0.9) 0%, rgba(11, 30, 45, 0.6) 100%);
}

.hero-content { position: relative; z-index: 5; margin-top: 3rem; }

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  color: white;
  text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-title span { color: var(--brand-cyan); }
.hero-desc { font-size: 1.1rem; color: rgba(255,255,255,0.85); max-width: 600px; }

.btn-primary-custom, .btn-outline-custom {
  font-weight: 700; padding: 0.8rem 2rem; border-radius: 4px; transition: var(--transition);
}

.btn-primary-custom { background: var(--brand-cyan); color: #0B1E2D; border: none; }
.btn-primary-custom:hover { 
  background: #ffffff; 
  color: #0B1E2D !important; 
  transform: translateY(-2px); 
  box-shadow: 0 10px 20px rgba(43, 196, 243, 0.3); 
}

.btn-outline-custom {
  background: rgba(255,255,255,0.1) !important; color: #fff !important;
  border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(5px);
}
.btn-outline-custom:hover { background: #fff !important; color: #0B1E2D !important; transform: translateY(-2px); }

/* ==========================================================================
   4. NOSOTROS (Cards Híbridas)
   ========================================================================== */
.section-bg-nosotros {
  position: relative;
  background: linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)), url(Imagenes/BackgroundBody.webp);
  background-size: cover; background-position: center; background-attachment: fixed;
}

.card-sitlab-hybrid {
  background: #ffffff; padding: 3rem 2rem; border-radius: 12px;
  position: relative; z-index: 2; transition: all 0.4s ease;
  border: 1px solid #e2e8f0; border-bottom: 6px solid #0b1e2d;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); height: 100%;
}

.card-sitlab-hybrid::before {
  content: ""; position: absolute; top: 0; left: 0; width: 0%; height: 100%;
  background: #0b1e2d; transition: all 0.5s ease; z-index: -1;
}

.card-sitlab-hybrid:hover { transform: translateY(-10px); border-bottom-color: var(--brand-cyan); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); }
.card-sitlab-hybrid:hover::before { width: 100%; }
.card-sitlab-hybrid:hover h4 { color: #fff !important; }
.card-sitlab-hybrid:hover p { color: #cbd5e1 !important; }

.icon-box {
  font-size: 2.5rem; color: var(--brand-cyan); margin-bottom: 1.5rem;
  background: #45484a; width: 70px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; transition: 0.4s;
}
.card-sitlab-hybrid:hover .icon-box { background: rgba(255,255,255,0.1); color: #fff; transform: rotate(10deg); }

/* ==========================================================================
   5. ENSAYOS (Service Items Premium)
   ========================================================================== */
.section-dark-blue { background-color: var(--bg-dark-blue); color: white; position: relative; }

#ensayos .container { overflow: visible !important; }

.swiperEnsayos {
  margin-top: 0.1rem !important;
  padding-top: 20px !important;
  padding-bottom: 60px !important;
  overflow: visible !important;
}

.service-item-premium {
  position: relative; border: none; border-radius: 20px; overflow: hidden;
  text-align: center; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 110%; min-height: 26rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background-size: cover; background-position: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.service-item-premium::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(11, 30, 45, 0.88), rgba(11, 30, 45, 0.98));
  z-index: 1; transition: all 0.4s ease;
}

.service-item-premium:hover::before { background: linear-gradient(to bottom, rgba(11, 30, 45, 0.5), rgba(11, 30, 45, 0.8)); }
.service-item-premium:hover { transform: translateY(-15px); box-shadow: 0 0 0 2px var(--bg-dark-blue), 0 20px 40px rgba(0,0,0,0.5); }

.card-content-wrap { position: relative; z-index: 2; padding: 2rem; width: 100%; }

/* Fondos Ensayos */
.bg-electrico { background-image: url(Imagenes/E.Electricos.webp); }
.bg-seguridad { background-image: url(Imagenes/E.Proteccion.webp); }
.bg-dimensional { background-image: url(Imagenes/E.Dimensionales.webp); }
.bg-termico { background-image: url(Imagenes/E.Termicos.webp); }
.bg-mecanico { background-image: url(Imagenes/E.Mecanicos.webp); }
.bg-quimico { background-image: url(Imagenes/E.Quimicos.webp); }

.icon-main { font-size: 3.5rem; color: var(--brand-cyan); margin-bottom: 1.5rem; filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.3)); }
.card-line { width: 50px; height: 3px; background: var(--brand-cyan); margin: 0 auto 1.5rem auto; transition: width 0.3s ease; }
.service-item-premium:hover .card-line { width: 80px; }

/* Swiper Arrows */
.nav-arrow-custom::after, .nav-arrow-dark::after { font-size: 1.5rem; font-weight: 800; }
.nav-arrow-custom {
  background: rgba(255,255,255,0.05); width: 3rem; height: 3rem; border-radius: 50%;
  backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.2);
}
.nav-arrow-custom:hover { background: var(--brand-cyan); border-color: var(--brand-cyan); }
.nav-arrow-custom:hover::after { color: #0B1E2D; }
.nav-arrow-custom::after { color: var(--brand-cyan); }

/* ==========================================================================
   6. RESPALDO (Catálogo Compacto)
   ========================================================================== */
.section-bg-respaldo {
  position: relative;
  background: linear-gradient(rgba(255, 255, 255, 0.90), rgba(255, 255, 255, 0.90)), url(Imagenes/BackgroundBody.webp);
  background-size: cover; background-attachment: fixed; 
  padding: 5rem 0 !important;
}

.product-card-compact {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0.8rem 0.5rem; text-align: center; height: 100%;
  min-height: 5.5rem; display: flex; flex-direction: column;
  justify-content: center; align-items: center; transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.product-card-compact i { font-size: 1.5rem; margin-bottom: 0.3rem; }
.product-card-compact span { font-weight: 700; color: #334155; font-size: 0.75rem; line-height: 1.2; }

.product-card-compact:hover {
  border-color: var(--brand-cyan); transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.08); background: #f8fdff;
}

/* ==========================================================================
   7. ECOSISTEMA DE CALIDAD (Swiper Dark)
   ========================================================================== */
.section-ecosistema-dark {
    background-color: var(--bg-dark-blue);
    padding: 5rem 0 6rem 0 !important;
    position: relative;
    overflow: hidden; 
    width: 100%;
}

.swiper-viewport-area {
    max-width: 1300px; 
    margin: 0 auto;
    position: relative;
}

.section-ecosistema-dark .swiperCalidad {
    max-width: 1140px;          
    margin: 0 auto !important; 
    padding: 10px 0 50px 0 !important; 
    overflow: hidden !important;
    display: block;
}

.section-ecosistema-dark .swiper-slide {
    height: auto !important; 
    display: flex;           
    justify-content: center;
    opacity: 1 !important;
}

.quality-card-pro {
  background: #ffffff; border-radius: 12px; overflow: hidden;
  border: 1px solid #e9ecef; box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  text-align: center; transition: var(--transition); height: 100%;
  position: relative; padding-bottom: 1.5rem; margin-top: 1rem;
  display: flex; flex-direction: column; 
}

/* Líneas de color superior */
.card-top-accent { height: 4px; width: 100%; }
.accent-blue { background: #0056b3; }
.accent-cyan { background: #17a2b8; }
.accent-green { background: #28a745; }
.accent-orange { background: #fd7e14; }

.cert-logo {
    width: auto !important;
    height: 80px !important;      
    max-width: 90%;               
    object-fit: contain !important; 
    margin: 0 auto;
    display: block;
    filter: brightness(1.05);     
    transition: transform 0.3s ease;
}

.quality-card-pro:hover .cert-logo { transform: scale(1.05); }

.badge-pill {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  color: white; white-space: nowrap; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-top: 5px; 
}

.badge-accredited { background: #0056b3; }
.badge-recognized { background: #17a2b8; }
.badge-certified { background: #28a745; }

.quality-body { padding-top: 1rem; }
.code-text { font-family: monospace; color: #64748b; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.2rem; }
.desc-text { color: #64748b; padding: 0 1rem; line-height: 1.4; font-size: 0.9rem; }

/* Controles Swiper Dark */
.section-ecosistema-dark .nav-arrow-dark {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 100; width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: all 0.3s ease;
}

.section-ecosistema-dark .swiper-button-prev { left: -30px !important; }
.section-ecosistema-dark .swiper-button-next { right: -30px !important; }
.section-ecosistema-dark .nav-arrow-dark:hover {
    background: var(--brand-cyan); border-color: var(--brand-cyan);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.section-ecosistema-dark .swiper-pagination { bottom: 0px !important; text-align: center; }
.section-ecosistema-dark .swiper-pagination-bullet-active { background: var(--brand-cyan); width: 25px; border-radius: 10px; }

/* ==========================================================================
   8. ALIANZAS ESTRATÉGICAS
   ========================================================================== */
.bg-light-gray { background-color: #f8f9fa; border-top: 1px solid #e9ecef; }

.partner-card {
    background: #ffffff; border-radius: 20px;      
    display: flex; align-items: center; justify-content: center;
    padding: 15px; height: 220px; width: 100%;               
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.07); border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.4s ease;
}

.partner-logo {
    max-height: 170px !important; width: auto; max-width: 95% !important; 
    object-fit: contain; filter: none !important;
    image-rendering: -webkit-optimize-contrast; 
    transition: transform 0.4s ease;
}

.partner-card:hover { transform: scale(1.03) translateY(-10px); box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12); }

/* ==========================================================================
   9. CONTACTO & FOOTER
   ========================================================================== */
.contact-form-wrapper {
  background: var(--bg-dark-card); padding: 2.5rem;
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.form-control {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: white; padding: 0.8rem; border-radius: 6px;
}

.form-control:focus {
  background: rgba(255,255,255,0.1); border-color: var(--brand-cyan);
  color: white; box-shadow: 0 0 0 0.2rem rgba(43, 196, 243, 0.25);
}

.map-container {
  width: 100%; height: 100%; min-height: 400px;
  border-radius: 12px; overflow: hidden;
  border: 4px solid rgba(255,255,255,0.1); position: relative;
}

.map-iframe { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }

.main-footer { 
    background-color: #050e14; 
    padding-top: 5rem; 
    border-top: 3px solid var(--brand-cyan); 
    color: white; 
    font-size: 0.95rem;
}

.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; background: rgba(255,255,255,0.05);
  color: white; border-radius: 50%; margin-right: 10px;
  transition: var(--transition); border: 1px solid rgba(255,255,255,0.1);
}

.social-link:hover { background: #00E5FF; color: #000; transform: translateY(-3px) scale(1.1); }

.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; }
.dev-link:hover { color: #fff; text-decoration: underline; }

/* Botón Global Cyan */
.btn-cyan {
    background-color: #00E5FF; color: #0B1E2D; border: none;
    font-weight: 700; transition: all 0.3s ease;
}
.btn-cyan:hover {
    background-color: #ffffff; transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.4);
}

/* ==========================================================================
   10. WHATSAPP & ANIMACIONES
   ========================================================================== */
.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); }
}
/* ==========================================================================
   11. RESPONSIVE DESIGN (MEDIA QUERIES ROBUSTECIDAS)
   ========================================================================== */

/* --- A. Pantallas Grandes y Ultra-Wide (Escritorio Pro) --- */
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
    .hero-title { font-size: 4.5rem; } /* Título más imponente en pantallas grandes */
}

/* --- B. Laptops y PCs estándar (1200px a 1399px) --- */
@media (max-width: 1200px) {
    .hero-title { font-size: 3.5rem; }
    .service-item-premium { min-height: 24rem; }
}

/* --- C. Tablets y Laptops Pequeñas (Punto de quiebre de Navbar) --- */
@media (max-width: 991px) {
    /* Navbar móvil */
    .navbar-collapse {
        background: var(--bg-dark-blue);
        padding: 1.5rem;
        border-radius: 12px;
        margin-top: 10px;
        border: 1px solid rgba(255,255,255,0.1);
    }
    .nav-link { padding: 0.8rem 0 !important; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .btn-contact-nav { margin-top: 1rem; width: 100%; text-align: center; }

    /* Hero & Contenido */
    .hero { text-align: center; padding-top: 80px; }
    .hero-desc { margin: 0 auto; }
    .hero-title { font-size: 3rem; }
    
    /* Utilidades */
    .ps-lg-5 { padding-left: 0 !important; }
    
    /* Alianzas */
    .partner-card { height: 180px; }
    .partner-logo { max-height: 130px !important; }
}

/* --- D. Móviles Grandes y Tablets en vertical (768px a 990px) --- */
@media (max-width: 767px) {
    .section-padding-compact { padding: 4rem 0; }
    
    .hero-title { font-size: 2.5rem; }
    
    /* Swiper: Ocultar flechas para navegación táctil limpia */
    .nav-arrow-custom, .nav-arrow-dark { display: none !important; }
    
    /* Cards de Ensayos */
    .service-item-premium { min-height: 22rem; }

    /* Botón flotante WhatsApp */
    .whatsapp-btn { 
        width: 50px; 
        height: 50px; 
        bottom: 20px; 
        right: 20px; 
        font-size: 24px;
    }
    
    /* Formularios */
    .contact-form-wrapper { padding: 1.5rem; }
}

/* --- E. Móviles Estándar (576px a 767px) --- */
@media (max-width: 576px) {
    .section-title { font-size: 1.8rem; }
    .hero-title { font-size: 2.2rem; }
    
    /* Ajuste de Alianzas para no ocupar toda la pantalla */
    .partner-card { height: 140px; border-radius: 15px; }
    .partner-logo { max-height: 90px !important; }
    
    /* Botones de acción en una sola columna */
    .hero .d-flex { 
        flex-direction: column; 
        gap: 10px !important; 
    }
    .hero .btn { width: 100%; margin-right: 0 !important; }

    /* Footer: Centrado de textos para mejor estética */
    .main-footer { text-align: center; }
    .social-icons { justify-content: center; display: flex; }
    .footer-links-list a { display: block; padding: 5px 0; }
}

/* --- F. Móviles muy pequeños (iPhone SE, etc. <360px) --- */
@media (max-width: 360px) {
    .hero-title { font-size: 1.8rem; }
    .section-subtitle { font-size: 0.75rem; }
    .brand-img { height: 3.5rem; }
}