/* ==========================================================================
   1. Variables y ConfiguraciÃ³n General
   ========================================================================== */
:root {
  --primary-color: #003e5f;  /* Azul AtlasMex */
  --secondary-color: #007bff; /* Azul brillante */
  --accent-color: #ffffff;
  --text-dark: #111111;
  --font-main: sans-serif;
}

body {
  background-color: var(--primary-color);
  font-family: var(--font-main);
  color: #444;
  overflow-x: hidden;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: 0.3s;
}

a:hover {
  color: var(--secondary-color);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 800;
}

.fw-bold {
    font-weight: 900 !important;
}

/* ==========================================================================
   2. Top Bar & Header (NavegaciÃ³n)
   ========================================================================== */
#topbar {
  height: 40px;
  background: rgba(0, 62, 95, 0.95);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 14px;
  color: #fff;
  z-index: 1031;
  transition: all 0.5s;
}

#topbar a {
  color: #fff;
  font-weight: 500;
}

#header {
  height: 90px;
  transition: all 0.5s;
  z-index: 1030;
  background: var(--primary-color);
  top: 40px;
}

#header.header-scrolled {
  background: rgba(0, 62, 95, 0.95);
  height: 70px;
  top: 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body:has(#header.header-scrolled) #topbar {
  top: -40px;
}

.logo img {
  max-height: 85px; 
  transition: 0.3s;
}

.navbar-nav .nav-link {
  color: #fff !important;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 1px;
  padding-left: 15px !important;
  padding-right: 15px !important;
  transition: 0.3s;
  position: relative;
}

@media (min-width: 992px) {
  .navbar-nav .nav-item:not(:last-child):not(.ms-lg-3) .nav-link::after {
    content: "|";
    color: #fff;
    position: absolute;
    right: 0;
    opacity: 0.7;
    font-weight: 300;
  }
  .navbar-nav .nav-item:not(:last-child):not(.ms-lg-3) .nav-link {
    padding-right: 20px !important;
  }
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link.active {
  color: #9acfff !important;
}

.navbar-toggler {
  border: none;
  outline: none;
  color: #fff;
}

/* ==========================================================================
   3. Hero Section (SOLO PORTADA / INDEX)
   ========================================================================== */
#hero {
  width: 100%;
  height: 100vh;
  min-height: 700px;
  background: linear-gradient(rgb(255 255 255 / 0%), rgb(168 168 168 / 0%)), url('../img/slider2.jpg') center center;
  background-size: cover;
  background-attachment: fixed;
  position: relative;
}

@media (min-width: 992px) {
    #hero { padding-top: 100px; }
    .hero-left-col { min-height: 75vh; padding-bottom: 20px; }
}

.hero-text h1 { text-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
.display-4 { font-size: 2.6rem; }

/* ==========================================================================
   4. Page Header (PARA NOSOTROS, CERTIFICACIONES, SERVICIOS)
   ========================================================================== */
.page-header {
    margin-top: 130px; 
    height: 300px;
    background: linear-gradient(rgba(0, 62, 95, 0.85), rgba(0, 62, 95, 0.85)), url('../img/slider2.jpg') center center;
    background-size: cover;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   5. Componentes Generales
   ========================================================================== */

/* Tarjeta Formulario - Efecto Liquid Glass */
.contact-form-card {
    background: rgb(68 68 68 / 42%);
    backdrop-filter: blur(6px) saturate(150%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-top: 1px solid rgb(83 83 83 / 0%);
    border-left: 1px solid rgb(0 0 0 / 0%);
    border-bottom: 1px solid rgb(0 0 0 / 0%);
    border-right: 1px solid rgb(0 0 0 / 0%);
    box-shadow: 0 8px 32px 0 rgb(103 0 0 / 30%);
    border-radius: 25px;
    color: #fff;
}

.contact-form-card input, 
.contact-form-card textarea {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  color: #333;
  font-size: 14px;
  padding: 10px;
}

.contact-form-card .btn-primary {
  background-color: var(--secondary-color);
  border: none;
  transition: 0.3s;
  border-radius: 50px;
}

.contact-form-card .btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

/* Logos de CertificaciÃ³n */
.hero-cert-img {
    height: 85px;
    width: auto;
    transition: 0.3s;
}

.hero-cert-img:hover {
  transform: scale(1.1);
  opacity: 1;
}

/* BotÃ³n Mobile */
.btn-custom-dark {
  background-color: #003e5f;
  border: 1px solid #005cbf;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
/* ... (Mismo CSS base de arriba para root, body, header, etc.) ... */
/* ... Pega aquÃ­ el CSS que te di en el paso anterior para el Header y todo lo demÃ¡s ... */
/* SOLO VOY A PONER AQUI LA SECCIÃ“N DE TARJETAS CORREGIDA: */

/* ==========================================================================
   6. ESTILOS TARJETAS SERVICIOS (CORREGIDO DEFINITIVO)
   ========================================================================== */

.service-card {
    position: relative;
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
}

/* TÃ­tulo: Franja blanca al fondo */
.service-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  color: #000; /* Texto negro o gris oscuro */
  padding: 15px;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1rem;
  z-index: 3;
}

/* Overlay Azul (Capa de color) */
.service-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Azul AtlasMex con transparencia */
  background: rgba(0, 62, 95, 0.7); 
  opacity: 0; 
  transition: opacity 0.3s ease;
  z-index: 1;
}

/* Contenido interior (BotÃ³n) */
.service-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centrado vertical */
  align-items: center;
  z-index: 2;
  padding-bottom: 50px; /* Espacio para no tapar el tÃ­tulo */
}

/* El botÃ³n azul sÃ³lido */
.service-content .btn-primary {
  background-color: #005cbf; /* Azul corporativo */
  border-color: #005cbf;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  font-weight: 600;
  padding: 10px 20px;
}

.service-content .btn-primary:hover {
  background-color: #004494;
}

/* --- COMPORTAMIENTO HOVER (ESCRITORIO) --- */
@media (min-width: 992px) {
  .service-card:hover .service-overlay {
    opacity: 1;
  }
  .service-card:hover .service-content .btn-primary {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- COMPORTAMIENTO MÃ“VIL (SIEMPRE VISIBLE) --- */
@media (max-width: 991px) {
  .service-overlay {
    opacity: 0.6; /* Un poco de azul siempre para que se lea el botÃ³n */
  }
  .service-content .btn-primary {
    opacity: 1;
    transform: translateY(0);
  }
  /* Ajuste de altura de tarjeta en mÃ³vil si se desea */
  .service-card {
    height: 300px;
  }
}

.text-primary {
    --bs-text-opacity: 1;
    color: rgb(0 96 148) !important;
}

.service-content .btn-primary:hover {
    background-color: #026193!important;
}

.bg-primary {
    --bs-bg-opacity: 1;
    background-color: rgb(0 76 119) !important;
}

/* ==========================================================================
   7. Footer y Flotantes
   ========================================================================== */
#footer {
  background: var(--primary-color);
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 14px;
}
#footer a { color: #ddd; }
#footer a:hover { color: #fff; }

.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 996;
  background: var(--primary-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.4s;
}
.back-to-top i { font-size: 24px; color: #fff; line-height: 0; }
.back-to-top.active { visibility: visible; opacity: 1; }

.whatsapp-float {
  position: fixed;
  bottom: 70px;
  right: 15px;
  z-index: 999;
  transition: 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); }

.whatsapp-float {
    display: none;
}

.display-m {
    font-size: 15px;
    margin: 16px 0 0 0;
    width: 100%;
    color: #000!important;
}


/* Header general */
#header {
  background-color: #00466b; /* o el azul que ya uses */
}

/* Logo mÃ³vil */
#header .mobile-logo img {
  max-height: 38px;
}

.fw-bold1 {
    font-weight: 900 !important;
}

/* MÃ¡s aire arriba y abajo del bloque del telÃ©fono/idiomas en mÃ³vil */
@media (max-width: 991.98px) {
  #header {
    padding-top: 6px;
    padding-bottom: 6px;
    
  }

  #header .mobile-info {
    padding-top: 6px;   /* lÃ­nea amarilla superior */
    padding-bottom: 6px;/* lÃ­nea amarilla inferior */
    margin: 0 0 0px 15px;
  }

  
.fw-bold1 {
    font-weight: 700 !important;
}




}

/* Seguridad: en escritorio ocultar elementos mÃ³viles (ya ayudan las clases de Bootstrap,
   pero esto lo refuerza si metes otros estilos despuÃ©s) */
@media (min-width: 992px) {
  #header .mobile-logo,
  #header .mobile-info {
    display: none !important;
  }
}



/* ==========================================================================
   8. Responsivo (Mobile)
   ========================================================================== */
@media (max-width: 991px) {
  #header { 
    height: auto; 
    top: 0; 
padding: 15px 0;
  }

  .logo img {
    max-height: 40px;
  }

  .navbar-collapse {
    position: fixed;
    top: 80px; 
    left: 0;
    width: 100%;
    background: var(--primary-color);
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  body:has(#header.header-scrolled) .navbar-collapse {
    top: 70px;
  }

  .navbar-nav { text-align: center; width: 100%; }
  .navbar-nav .nav-item { border-bottom: 1px solid rgba(255, 255, 255, 0.05); margin: 0 20px; }
  .navbar-nav .nav-link { padding: 15px 0 !important; font-size: 16px; display: block; }
  .navbar-nav .nav-item .nav-link::after { display: none !important; }
  .navbar-nav .nav-item.ms-lg-3 { margin-top: 20px; border-bottom: none; display: flex; justify-content: center; }
  
  #hero { 
    height: auto; 
    padding-top: 130px; 
    padding-bottom: 50px; 
    
    /* AGREGA ESTAS LÃNEAS PARA ARREGLAR IOS: */
    background-attachment: scroll !important;
    background-position: center top !important;
    background-size: cover !important;
  }
  
  .hero-text { margin-top: 0px; text-align: center !important; }
  .hero-cert-img { height: 60px; }

  .page-header {
      margin-top: 80px; 
      height: 200px;
  }

  .display-4 {
        font-size: 1.9rem;
}

.hero-bottom-content{
margin: 350px 0 0px 0;
}

    .page-header {
        margin-top: 10px;
        height: 110px;
    }
.display-3 {
    font-size: calc(1.525rem + 1.3vw);
    font-weight: 300;
    line-height: 1.2;
}

    .whatsapp-float {
        display: block;
        position: fixed;
        bottom: 45%;
        right: 15px;
        z-index: 999;
        transition: 0.3s;
    }

    
.img-logoresponse{
  width: 43px;
  margin: 0 0 0 7px;
}

.display-m {
    font-size: 15px;
    margin: 16px 0 0 0;
    width: 100%;
    color: #000 !important;
    display: none;
}

    .display-4 {
   font-size: 1.8rem;
        margin: 30px 0 0 0;
    }

}




.myblank { opacity: 0; position: absolute; top: 0; left: 0; height: 0; width: 0; z-index: -1; }

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - var(--bs-modal-margin) * 2);
    padding: 18px;
}

.footerlogo{
  width: 500px;
}


:root {
  /* Altura total de topbar + header fijo */
  --offset-header: 140px;   /* ajusta 120 / 130 / 150 segÃºn veas */
}

/* Cualquier secciÃ³n con id (#nosotros, #certificaciones, etc.) */
section[id],
.page-header {
  scroll-margin-top: var(--offset-header);
}

/* =========================================================
   HEADER MÃ“VIL: SIEMPRE FIJO, SIN BRINCOS AL HACER SCROLL
   ========================================================= */
@media (max-width: 991px) {

  /* Topbar fuera de juego en mÃ³vil */
  #topbar {
    display: none !important;
    height: 0 !important;
  }

  /* Header siempre igual, antes y despuÃ©s del scroll */
  #header,
  #header.header-scrolled {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    height: auto !important;
    padding: 12px 0 !important;
    background: var(--primary-color) !important;
    box-shadow: none !important;
    z-index: 1030;
  }

  /* MenÃº desplegado: siempre alineado con el header fijo */
  .navbar-collapse {
    position: fixed;
    top: 70px !important;   /* ajusta a ojo si lo quieres mÃ¡s arriba/abajo */
    left: 0;
    width: 100%;
  }

  body:has(#header.header-scrolled) .navbar-collapse {
    top: 70px !important;   /* que no cambie con el scroll */
  }

  /* Compensar el header fijo para que no tape el hero */
  body {
    padding-top: 70px;      /* si ves que tapa mucho, bÃ¡jalo a 60 o 65 */
  }
  
  #hero {
    height: auto;
    padding-top: 40px;
    padding-bottom: 50px;
    background-attachment: scroll !important;
    background-position: center top !important;
    background-size: cover !important;
}

#hero {
    width: 100%;
    height: 90vh;
    min-height: 700px;
    background: url(../img/slider2.jpg);
    background-size: cover;
    background-attachment: fixed;
    position: relative;
    background-position: 62% -36px !important;
    padding-top: 20px;
}

        .hero-bottom-content{
         margin: 280px 0 0px 0;
    }

    .btn-custom-dark {
        background-color: #003e5f;
        border: 1px solid #005cbf;
        color: #fff;
        font-weight: 700;
        text-transform: math-auto;
        letter-spacing: 1px;
        font-size: 18px;
    }

}

