/* ==========================================================================
   1. VARIABLES Y ESTILOS GLOBALES
   ========================================================================== */
:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --bg-body: #0f172a;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --border-color: #cbd5e1;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
  width: 100%;
}

/* ==========================================================================
   2. ENCABEZADO Y NAVEGACIÓN SUPERIOR
   ========================================================================== */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

header .logo-img,
.logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

nav a:hover,
nav a.active {
  color: var(--primary);
  background-color: #e0f2fe;
}

/* ==========================================================================
   3. FRANJA AZUL PRINCIPAL Y BRANDING (HERO BACKGROUND CON AZULAGUA.JPG)
   ========================================================================== */
.page-header {
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.90) 0%,
      rgba(30, 41, 59, 0.85) 100%
    ),
    url('azulagua.jpg') center/cover no-repeat;
  color: #ffffff;
  padding: 3.5rem 1.5rem 2.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  display: none;
}

.header-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: aparecerSuave 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.1s;
}

.header-big-logo {
  height: 110px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.header-title-block {
  text-align: center;
}

.company-fullname {
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1.5px;
  line-height: 1.1;
  text-transform: uppercase;
}

.company-subheading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 1px;
  margin-top: 0.4rem;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  margin: 0 auto 1rem auto;
  background-color: rgba(56, 189, 248, 0.2);
  color: #ffffff;
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.4);
  text-align: center;
  position: relative;
  z-index: 2;
  opacity: 0;
  animation: aparecerFade 0.8s ease forwards;
  animation-delay: 0.5s;
}

.badge-legado {
  background-color: #0369a1 !important;
  color: #ffffff !important;
  border: 1px solid #0284c7 !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}

.page-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
  position: relative;
  z-index: 2;
  color: #ffffff;
  opacity: 0;
  transform: translateY(-10px);
  animation: aparecerSuave 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.9s;
}

.page-header p {
  color: #ffffff;
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  animation: aparecerSuave 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 1.4s;
}

.header-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(10px);
  animation: aparecerSuave 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 1.8s;
}

@keyframes aparecerSuave {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes aparecerFade {
  to {
    opacity: 1;
  }
}

/* ==========================================================================
   4. GRILLAS, TARJETAS Y CONTENEDORES DE IMAGEN
   ========================================================================== */
.grid,
.services-grid,
.stats-bar,
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.card,
.service-card,
.stat-item,
.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  color: var(--primary);
  font-weight: 800;
  display: block;
  margin-bottom: 0.3rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.service-card h3,
.card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--primary);
}

.service-card p,
.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* TARJETA DESTACADA (FEATURE CARD) */
.feature-card {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.feature-img-wrapper {
  background: #f8fafc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  width: 100%;
  height: 260px;
  overflow: hidden;
  padding: 0;
}

.feature-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.feature-body h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.feature-body p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* SOBRE NOSOTROS */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 3rem;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.about-img-wrapper {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.about-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
}

.about-text h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.features-list {
  list-style: none;
  margin-top: 1rem;
}

.features-list li {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* BANNER MISIÓN */
.mision-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 2.5rem;
  margin: 3rem 0;
  text-align: center;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: var(--shadow);
}

.mision-banner h2 {
  color: #ffffff;
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

.mision-banner p {
  color: #ffffff;
  font-size: 1.05rem;
  max-width: 750px;
  margin: 0 auto;
}

/* TÍTULOS DE SECCIÓN */
.section-title-wrapper {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title-wrapper h2 {
  font-size: 1.8rem;
  color: #ffffff;
}

.section-title-wrapper p {
  color: #94a3b8;
}

/* ==========================================================================
   5. CARRUSEL DE MARCAS Y LISTADO DE CLIENTES
   ========================================================================== */
.clients-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 3rem;
  box-shadow: var(--shadow);
}

.clients-wrapper .section-title-wrapper h2 {
  color: var(--text-dark);
}

.clients-wrapper .section-title-wrapper p {
  color: var(--text-muted);
}

.carousel-container {
  overflow: hidden;
  width: 100%;
  position: relative;
  padding: 1rem 0;
}

.carousel-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: scrollClientes 35s linear infinite;
}

.carousel-track:hover,
.carousel-track:focus-within {
  animation-play-state: paused;
}

.client-pill {
  flex: 0 0 160px;
  height: 90px;
  background: #ffffff;
  padding: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.client-pill img {
  max-width: 100%;
  max-height: 55px;
  object-fit: contain;
}

@keyframes scrollClientes {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 0.75rem)); }
}

.clients-text-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.client-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.2rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.client-item:hover {
  background: #e0f2fe;
  transform: translateY(-2px);
}

/* ==========================================================================
   6. EXPERIENCIA Y CERTIFICACIONES
   ========================================================================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
  position: relative;
  padding-left: 1.5rem;
  border-left: 3px solid var(--primary);
  list-style: none;
}

.timeline-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.82rem;
  top: 1.8rem;
  width: 14px;
  height: 14px;
  background-color: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--bg-body);
}

.timeline-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  color: var(--primary);
}

.timeline-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.cert-icon {
  font-size: 2rem;
  background: #e0f2fe;
  padding: 0.8rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-info h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--text-dark);
}

.cert-issuer {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
  background: rgba(2, 132, 199, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.cert-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   7. CONTACTO, FORMULARIO Y MAPA
   ========================================================================== */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
}

.contact-info,
.contact-form {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.contact-direct-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.contact-direct-link:hover {
  background: #e0f2fe;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.contact-icon {
  font-size: 1.5rem;
  background: #ffffff;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: #ffffff;
  color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.contact-address {
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.2rem;
  color: var(--text-dark);
}

.contact-address .text-muted {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-address .address-line {
  margin-top: 0.5rem;
}

.map-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-top: 3rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.map-container h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.map-container p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.map-iframe-wrapper {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.map-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   8. BOTONES Y COMPONENTES AUXILIARES
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-secondary {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

.btn-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.img-fallback {
  padding: 3rem;
  text-align: center;
  background: #f8fafc;
}

.badge-margin {
  margin-bottom: 0.5rem;
}

.services-grid {
  list-style: none;
  padding: 0;
}

.clients-title {
  margin-bottom: 1.5rem;
}

.section-title-left {
  margin-bottom: 1.5rem;
  color: #ffffff;
  font-size: 1.6rem;
}

.contact-info-title,
.contact-form-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.contact-info-title {
  margin-bottom: 1rem;
}

.contact-info-text {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.contact-form-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.link-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: normal;
}

.form-status-msg {
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}
.form-status-msg.success {
  color: #16a34a;
}
.form-status-msg.error {
  color: #dc2626;
}

/* PIE DE PÁGINA */
footer {
  background: #0f172a;
  color: #ffffff;
  text-align: center;
  padding: 2.5rem 1.5rem;
  margin-top: auto;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   9. RESPONSIVE MÓVIL BLINDADO (PANTALLAS MENORES A 768PX)
   ========================================================================== */
@media screen and (max-width: 768px) {
  header {
    flex-direction: column !important;
    align-items: center !important;
    padding: 0.8rem 1rem !important;
    gap: 0.8rem !important;
  }

  nav {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.4rem 0.8rem !important;
    width: 100% !important;
  }

  nav a {
    font-size: 0.85rem !important;
    padding: 0.3rem 0.5rem !important;
  }

  .logo-text {
    font-size: 1.15rem !important;
    text-align: center !important;
  }

  .page-header {
    padding: 2.5rem 1rem !important;
  }

  .header-big-logo {
    height: 80px !important;
  }

  .company-fullname {
    font-size: 1.35rem !important;
  }

  .company-subheading {
    font-size: 0.78rem !important;
  }

  .page-header h1 {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }

  .container {
    padding: 0 1rem !important;
    margin: 1.5rem auto !important;
  }

  .grid,
  .services-grid,
  .about-grid,
  .contact-container,
  .stats-bar,
  .certifications-grid,
  .feature-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 1.2rem !important;
    grid-template-columns: 1fr !important;
  }

  .card,
  .service-card,
  .stat-item,
  .cert-card,
  .contact-info,
  .contact-form,
  .clients-wrapper,
  .feature-card,
  .map-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.25rem !important;
    box-sizing: border-box !important;
  }

  .clients-text-grid {
    grid-template-columns: 1fr !important;
  }

  .feature-img-wrapper {
    height: 200px !important;
  }

  .about-img {
    height: 250px !important;
  }

  .timeline {
    padding-left: 1rem !important;
  }

  .timeline-item::before {
    left: -1.32rem !important;
  }

  .cert-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .map-iframe-wrapper {
    height: 280px !important;
  }
}