/* ================================
   Cool Power — Corporate Theme

   ÍNDICE DE ESTILOS
   --------------------------------
   1. Configuración Global
      - Importación de fuentes
      - Variables CSS (:root)
      - Reseteos y estilos base
   2. Layout y Componentes Principales
      - Contenedor y secciones
      - Header y Navegación
      - Footer
   3. Componentes de Página
      - Hero
      - Botones
      - Tarjetas, Grids y Logos
      - Formularios
   4. Componentes Interactivos
      - Menú desplegable
      - Carrusel
   5. Media Queries (Responsivo)
   ================================ */

/* ==========================================================================
   1. Configuración Global
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Poppins:wght@600;700&display=swap");

:root {
  /* Colores base (extraídos del logo) */
  --brand: #fd6f04;
  /* Naranja Cool Power */
  --brand-dark: #c94e00;
  /* Hover/active, 25% más oscuro */
  --brand-ink: #1a1a1a;
  /* Negro cálido para titulares/logos */
  --ink: #1f2937;
  /* Texto principal (gris-900 cálido) */
  --muted: #4b5563;
  /* Texto secundario */
  --bg: #ffffff;
  /* Fondo */
  --bg-alt: #fff7ed;
  /* Secciones alternas (tinte naranja-50) */
  --border: #ede9e3;
  /* Borde suave, cálido */
  --radius: 16px;
  --shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
  --focus: 0 0 0 3px rgba(253, 111, 4, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, sans-serif;
  color: var(--brand-ink);
  line-height: 1.2;
  letter-spacing: 0.2px;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: clamp(22px, 3vw, 32px);
}

h3 {
  font-size: clamp(18px, 2.5vw, 22px);
}

p {
  margin: 0 0 16px;
  color: var(--muted);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-dark);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

/* Selección de texto con identidad de marca */
::selection {
  background: rgba(253, 111, 4, 0.25);
}

.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px;
  background: #fff;
  border: 2px solid var(--brand);
}

/* ==========================================================================
   2. Layout y Componentes Principales
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* Asegura que el mapa y sus controles siempre estén debajo del header */
.leaflet-pane {
  z-index: 500 !important;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
}

.logo {
  flex-shrink: 0;
  /* Prevent crushing on small screens */
  display: flex;
  align-items: center;
}

.logo img {
  max-height: 63px;
  /* Allow shrinking */
  height: auto;
  /* Maintain aspect ratio */
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.nav a {
  color: var(--ink);
  font-weight: 600;
}

.nav a:hover {
  color: var(--brand);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* Botón "Preguntas frecuentes" en el header */
.btn-faq,
.btn-sgp {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all 0.15s ease-in-out;
}

.btn-faq:hover,
.btn-sgp:hover {
  color: var(--brand);
}

.header-row {
  justify-content: space-between;
  gap: 14px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 64px 0;
}

.section.alt {
  background: var(--bg-alt);
}

/* ==========================================================================
   Language Selector
   ========================================================================== */
.language-selector {
  position: relative;
  display: inline-block;
  margin-left: 12px;
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.language-toggle:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(253, 111, 4, 0.1);
}

.language-toggle .current-flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.language-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.language-toggle[aria-expanded="true"] .language-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  flex-direction: column;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 100;
  list-style: none;
  margin: 0;
}

.language-dropdown.open {
  display: flex;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s ease;
}

.language-option:hover {
  background: var(--bg-alt);
  color: var(--brand);
}

.language-option.active {
  background: rgba(253, 111, 4, 0.1);
  color: var(--brand);
  font-weight: 600;
}

.language-option img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.language-option span {
  font-size: 14px;
}


/* ==========================================================================
   3. Componentes de Página
   ========================================================================== */

/* Hero */
.hero {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fff9f3 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 24px;
}

.hero-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.brand {
  color: var(--brand);
}

.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--border);
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-outline {
  background: #fff;
  color: var(--brand);
  border-color: var(--brand);
}

.btn-outline:hover {
  background: #fff1e6;
  border-color: var(--brand-dark);
  color: var(--brand-dark);
}

.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0;
  margin: 16px 0;
  list-style: none;
}

.highlights li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}

gap: 16px;
}

.grid.grid-3-cols {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card {
  position: relative;
  padding-top: 48px;
  /* Espacio para el icono */
}

.service-card {
  text-align: center;
  position: relative;
  padding-top: 48px;
  /* Espacio para el icono */
}

.card-icon {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
}

.card.has-large-icon {
  padding-top: 88px;
}

.card.has-large-icon .card-icon {
  width: 56px;
  height: 56px;
}

.logos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.logo-box {
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
}

.contact-title {
  color: #0f172a;
  font-weight: bold;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  /* 24px vertical, 32px horizontal */
  margin-top: 24px;
}

.form-row {
  display: flex;
  flex-direction: column;
}

.form-row.full-width {
  grid-column: 1 / -1;
  /* Ocupa todo el ancho */
}

.contact-form label,
.contact-form legend {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  border: none;
  border-bottom: 2px solid #ccc;
  padding: 8px 0;
  font-size: 16px;
  background-color: transparent;
  border-radius: 0;
  transition: border-color 0.2s ease-in-out;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form textarea:focus {
  outline: none;
  border-bottom-color: #fa6900;
}

.checkbox-group {
  border: none;
  padding: 0;
  margin: 0;
}

.checkbox-group div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.checkbox-group input[type="checkbox"] {
  accent-color: #fa6900;
}

.submit-container {
  justify-content: center;
  align-items: center;
}

.btn-submit {
  background-color: #fa6900;
  color: #ffffff;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-submit:hover {
  background-color: #c94e00;
}

.error {
  color: #b91c1c;
  height: 18px;
}

.form-status {
  margin-top: 8px;
  font-weight: 600;
}

/* ==========================================================================
   NUEVO: Carrusel Hero (pantalla completa)
   ========================================================================== */
.hero-carousel-section {
  padding: 0;
  /* Anula el padding de .section para que sea full-width */
  position: relative;
  height: 480px;
  /* Altura base del carrusel */
  background-color: var(--bg-alt);
  /* Color de fondo mientras carga la imagen */
}

.hero-carousel-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 0;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-slide img,
.hero-slide video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Asegura que el contenido cubra todo el espacio */
  z-index: -2;
}

/* Overlay oscuro para legibilidad del texto */
.hero-slide:not(:has(video))::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.1));
  z-index: -1;
}

.hero-slide-text {
  color: #fff;
  max-width: 700px;
  padding: 20px;
}

.hero-slide-text h1 {
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-slide-text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(16px, 2.5vw, 20px);
}

.hero-carousel-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

.hero-carousel-pagination {
  display: flex;
  gap: 8px;
}

.hero-carousel-pagination button {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  cursor: pointer;
  opacity: 0.6;
}

.hero-carousel-pagination button.active {
  background: #fff;
  opacity: 1;
}

/* ==========================================================================
   4. Componentes Interactivos
   ========================================================================== */
.carousel {
  position: relative;
  margin-top: 12px;
}

.carousel-viewport {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 1px;
  /* ayuda al snap */
  padding: 8px 8px 16px;
  -webkit-overflow-scrolling: touch;
}

.project-card {
  scroll-snap-align: start;
  flex: 0 0 85%;
  max-width: 85%;
}

@media (min-width: 640px) {
  .project-card {
    flex-basis: 60%;
    max-width: 60%;
  }
}

@media (min-width: 900px) {
  .project-card {
    flex-basis: 32%;
    max-width: 32%;
  }

  /* ~3 por vista */
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 2;
}

.carousel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.carousel-btn.prev {
  left: -6px;
}

.carousel-btn.next {
  right: -6px;
}

.fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  pointer-events: none;
  z-index: 1;
}

.fade-left {
  left: 0;
  background: linear-gradient(to right,
      rgba(255, 255, 255, 1),
      rgba(255, 255, 255, 0));
}

.fade-right {
  right: 0;
  background: linear-gradient(to left,
      rgba(255, 255, 255, 1),
      rgba(255, 255, 255, 0));
}

.carousel-viewport::-webkit-scrollbar {
  height: 10px;
}

.carousel-viewport::-webkit-scrollbar-track {
  background: #fff;
}

.carousel-viewport::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.carousel .project-card {
  position: relative;
  padding: 0;
  /* sin relleno para que no sume altura */
  border: none;
  /* sin borde para que no “agrande” */
  border-radius: 16px;
  overflow: hidden;
  /* recorta el overlay dentro de la imagen */
  flex: 0 0 auto;
  /* ancho = ancho del contenido (imagen) */
  scroll-snap-align: start;
  background: #000;
  /* base oscura por si carga lento la imagen */
  box-shadow: var(--shadow);
}

.carousel .project-card img {
  display: block;
  width: auto;
  /* importante: no ocupar todo el ancho de la tarjeta */
  height: auto;
  /* conserva proporción original */
  max-width: 90vw;
  /* límite en móviles: no más ancho que la ventana */
  max-height: 60vh;
  /* límite de alto para evitar tarjetas gigantes */
}

@media (min-width: 900px) {
  .carousel .project-card img {
    max-width: 520px;
    /* p.ej. 520 px de ancho máximo visible */
    max-height: 340px;
    /* y 340 px de alto máximo */
  }
}

.carousel .project-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
  pointer-events: none;
  /* el overlay no bloquea clics/scroll */
}

.carousel .project-card h3,
.carousel .project-card p {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0 12px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.carousel .project-card h3 {
  bottom: 34px;
  font-size: clamp(16px, 2.2vw, 18px);
  font-weight: 700;
}

.carousel .project-card p {
  bottom: 10px;
  font-size: clamp(13px, 2vw, 15px);
  opacity: 0.95;
}

.nav .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  /* desktop por defecto */
  gap: 20px;
  align-items: center;
}

.nav .menu>li {
  position: relative;
}

.nav .menu a,
.nav .menu .dropdown-toggle {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 2px;
}

.nav .menu a:hover,
.nav .menu .dropdown-toggle:hover {
  color: var(--brand);
}

.dropdown-toggle {
  border: 0;
  background: transparent;
  font-family: inherit;
  /* Hereda la fuente del elemento padre */
  font-size: inherit;
  /* Hereda el tamaño de fuente del padre */
  cursor: pointer;
}

.dropdown-toggle::after {
  content: "▾";
  font-size: 0.9em;
  line-height: 1;
  opacity: 0.8;
}

.nav .menu .dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  display: none;
  /* oculto por defecto */
  flex-direction: column;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 100;
}

.nav .menu .dropdown li {
  list-style: none;
}

.nav .menu .dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
}

.nav .menu .dropdown a:hover {
  background: var(--bg-alt);
  color: var(--brand);
}

.nav .menu .has-dropdown.open>.dropdown {
  display: flex;
}

/* Hover solo en desktop: abre el menú sin click */
@media (min-width: 641px) {
  .nav .menu .has-dropdown:hover>.dropdown {
    display: flex;
  }
}

.nav .menu .only-mobile {
  display: none;
}

/* ==========================================================================
   5. Media Queries (Responsivo)
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .grid.cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .logos {
    grid-template-columns: repeat(2, 1fr);
  }

  .highlights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {

  /* Ocultar botón FAQ principal y mostrar el del menú móvil */
  .btn-faq {
    display: none;
  }

  .nav .menu .only-mobile {
    display: list-item;
  }

  /* Comportamiento del menú de navegación */
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    right: 20px;
    top: 72px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 10px;
  }

  .nav.show {
    display: flex;
  }

  .nav.show .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Desplegables dentro del menú móvil */
  .nav .menu .dropdown {
    position: static;
    border: none;
    box-shadow: none;
    padding: 6px 0 0 14px;
  }

  /* Ocultar botones del carrusel en móvil */
  .carousel-btn {
    display: none;
  }

  .grid.cards {
    grid-template-columns: 1fr;
  }

  /* Ajustes para el carrusel Hero en móvil */
  .hero-carousel-section {
    height: 400px;
  }

  .hero-slide-text h1 .desktop-only {
    display: none;
  }

  /* Ocultar selector de idioma en móvil */
  .language-selector {
    display: none;
  }
}

/* Ocultar títulos de móvil en escritorio */
@media (min-width: 641px) {
  .hero-slide-text h1 .mobile-only {
    display: none;
  }
}

.hero-slide-text h1 .mobile-only {
  display: none;
  /* Oculto por defecto, se activa en media query de móvil */
}

/* ==========================================================================
   6. Componente: Chat emergente de WhatsApp
   ========================================================================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
  text-decoration: none;
  transition: transform 0.2s ease-in-out;
}

.whatsapp-float:hover {
  transform: translateY(-4px);
}

.whatsapp-icon {
  width: 60px;
  height: 60px;
  padding: 12px;
  background-color: #25d366;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.whatsapp-message {
  position: relative;
  background-color: #fff;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-weight: 600;
  white-space: nowrap;
  /* Oculto por defecto, con transición */
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateX(10px);
  transform-origin: right center;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out,
    visibility 0.2s;
}

.whatsapp-float:hover .whatsapp-message {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateX(0);
}

.whatsapp-arrow {
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #fff;
}

/* ==========================================================================
   7. Componente: Barra de Clientes
   ========================================================================== */
.clients-section {
  padding-bottom: 0;
  /* El padding inferior lo dará la barra */
}

.clients-bar {
  max-width: 100%;
  overflow: hidden;
  padding: 40px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 32px;
  -webkit-mask-image: linear-gradient(to right,
      transparent,
      #000 10%,
      #000 90%,
      transparent);
  mask-image: linear-gradient(to right,
      transparent,
      #000 10%,
      #000 90%,
      transparent);
}

.clients-scroller {
  display: flex;
  gap: 60px;
  width: max-content;
  animation: scroll 30s linear infinite;
}

.clients-bar:hover .clients-scroller {
  animation-play-state: paused;
}

.clients-scroller img {
  height: 40px;
  /* Altura uniforme para todos los logos */
  max-width: 150px;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.6);
  transition: all 0.2s ease-in-out;
}

.clients-scroller img:hover {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.1);
}

@keyframes scroll {
  to {
    transform: translate(calc(-50% - 30px));
    /* 30px es la mitad del gap */
  }
}

/* Duplicar contenido para el scroll infinito */
@media (prefers-reduced-motion: no-preference) {

  .clients-scroller::before,
  .clients-scroller::after {
    content: attr(data-content);
  }
}

/* ==========================================================================
   8. Componente: Tarjetas de Noticias
   ========================================================================== */
.news-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.news-card {
  display: flex;
  flex-direction: column;
}

.news-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}

.news-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ==========================================================================
   Componente: Vista Previa "Sobre Nosotros"
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  /* La imagen toma su espacio, el texto el resto */
  align-items: center;
  gap: 80px;
}

.about-image img {
  width: 350px;
  /* Tamaño modificado */
  height: 350px;
  border-radius: 50%;
  /* Ajustado para ser un círculo perfecto */
  object-fit: cover;
  /* Asegura que la imagen cubra el círculo sin deformarse */
  box-shadow: var(--shadow);
}

.about-text a {
  margin-top: 16px;
}

@media (max-width: 768px) {

  .timeline-item::before,
  .timeline-item::after {
    left: 20px;
    transform: none;
    right: auto;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-item:nth-child(odd) {
    left: 0;
    text-align: left;
  }

  .timeline-item:nth-child(even) {
    left: 0;
  }

  .timeline-icon {
    left: 0;
  }
}

@media (max-width: 768px) {
  .about-header-grid {
    grid-template-columns: 1fr;
  }
}

.timeline-container {
  position: relative;
  max-width: 900px;
  margin: 48px auto;
}

/* La línea vertical central */
.timeline-container::after {
  /* Se elimina la línea única para evitar problemas de apilamiento */
  content: none;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  /* Animación */
  margin-top: -60px;
  /* Aumenta la compactación */
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Conector de línea SUPERIOR (desde el hito anterior hasta el icono) */
.timeline-item:not(:first-child)::before {
  content: "";
  position: absolute;
  width: 3px;
  background-color: var(--border);
  top: 0;
  height: 24px;
  /* Llega hasta la parte superior del icono */
}

/* Conector de línea INFERIOR (desde el icono hasta el siguiente hito) */
.timeline-item::after {
  content: "";
  position: absolute;
  width: 3px;
  background-color: var(--border);
  bottom: 0;
  height: calc(100% - 67px);
  /* Empieza desde la parte inferior del icono */
}

/* Posiciona las líneas en el centro dependiendo del lado del hito */
.timeline-item:nth-child(odd)::before,
.timeline-item:nth-child(odd)::after {
  right: -1.5px;
}

.timeline-item:nth-child(even)::before,
.timeline-item:nth-child(even)::after {
  left: -1.5px;
}

/* Oculta la línea inferior del último elemento */
.timeline-item:last-child::after {
  content: none;
}

/* Items a la izquierda */
.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

/* Items a la derecha */
.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
  /* Alinea el texto a la izquierda para los hitos de la derecha */
}

.timeline-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  right: -20px;
  background-color: #fff;
  /* Forza el fondo a blanco sólido para ocultar la línea */
  border: 3px solid var(--brand);
  top: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.timeline-icon img {
  width: 20px;
  height: 20px;
}

/* Iconos a la derecha */
.timeline-item:nth-child(even) .timeline-icon {
  left: -20px;
}

.timeline-content {
  padding: 20px;
  background-color: white;
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.timeline-year {
  font-family: Poppins, sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--brand);
}

/* ==========================================================================
   9. Layout: Nuevo Pie de Página
   ========================================================================== */
.site-footer {
  background-color: #273b7b;
  /* Azul oscuro solicitado */
  background: var(--bg-alt);
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.footer-headline {
  font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(22px, 3vw, 32px);
  color: var(--brand);
  margin-bottom: 48px;
  text-align: left;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  text-align: left;
}

.footer-column h4 {
  color: var(--brand-ink);
  font-size: 16px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.footer-subtitle {
  margin-top: 32px;
  margin-bottom: 16px;
}

.footer-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.footer-logos-partners {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 16px;
  align-items: center;
}

.footer-logos img,
.footer-logos-partners img {
  height: 40px;
  object-fit: contain;
}

img.logo-utal {
  height: 50px;
}

.footer-contact p {
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.6;
  font-size: 14px;
}

.footer-contact strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.footer-socials {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.footer-socials a {
  display: block;
  transition: transform 0.2s;
}

.footer-socials a:hover {
  transform: translateY(-2px);
}

.footer-socials img {
  width: 28px;
  height: 28px;
  filter: brightness(0) saturate(100%) invert(38%) sepia(60%) saturate(2532%) hue-rotate(358deg) brightness(101%) contrast(107%);
  /* Convierte a naranja brand aprox */
}

.btn-contact-footer {
  display: inline-block;
  width: auto;
  padding: 12px 24px;
  font-size: 16px;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .footer-headline {
    text-align: center;
  }

  .footer-grid {
    text-align: center;
  }

  .footer-logos,
  .footer-logos-partners,
  .footer-socials {
    justify-content: center;
  }
}

/* ==========================================================================
   9. Componente: Preview de Proyectos Destacados
   ========================================================================== */
.projects-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 24px;
}

.project-preview-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-preview-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-preview-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-preview-card:hover .project-preview-image img {
  transform: scale(1.05);
}

.project-preview-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-preview-content h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--brand-ink);
}

.project-preview-content .project-meta {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

.btn-link {
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  align-self: flex-start;
  transition: color 0.2s;
}

.btn-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

/* Responsivo para Proyectos Destacados */
@media (max-width: 900px) {
  .projects-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .projects-preview-grid {
    grid-template-columns: 1fr;
  }

  .project-preview-image {
    height: 220px;
  }
}



/* The SGP access stays available before the mobile menu is opened. */
.site-header .btn-sgp {
  flex-shrink: 0;
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .site-header .header-row {
    gap: 10px;
  }

  .site-header .logo {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 180px;
  }

  .site-header .logo img {
    width: 100%;
    max-height: 52px;
  }

  .site-header .btn-faq {
    display: none;
  }

  .site-header .nav .menu .only-mobile {
    display: list-item;
  }

  .site-header .btn-sgp {
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 8px 12px;
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    font-size: 14px;
  }

  .site-header .btn-sgp:hover {
    color: #fff;
    background: var(--brand-dark);
    border-color: var(--brand-dark);
  }

  .site-header .nav-toggle {
    order: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    margin-left: 0;
  }

  .site-header .nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 20px;
    max-width: calc(100vw - 40px);
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    margin-left: 0;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .site-header .nav.show {
    display: flex;
  }

  .site-header .nav .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .site-header .nav .menu .dropdown,
  .site-header .nav .menu .sub-menu {
    position: static;
    min-width: 0;
    padding: 6px 0 0 14px;
    border: none;
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .site-header .header-row {
    padding-left: 14px;
    padding-right: 14px;
  }

  .site-header .language-selector {
    display: none;
  }
}

/* Override Tailwind font size for EPC banner to match theme standard */
.hero-video-section h1 {

  /* Override Tailwind font size for EPC banner to match theme standard */
  .hero-video-section h1 {
    font-size: clamp(40px, 6vw, 72px) !important;
    line-height: 1.1 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    font-weight: 800 !important;
  }

  /* News Template Styles */
  .news-article .article-header {
    text-align: center;
    padding: 4rem 0 2rem;
  }

  .news-article .entry-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
  }

  .news-article .article-meta {
    color: var(--muted);
    font-size: 1rem;
  }

  .article-featured-image {
    margin-bottom: 3rem;
  }

  .article-featured-image img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
  }

  .article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
  }

  .article-body h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--brand-ink);
  }

  .article-body p {
    margin-bottom: 1.5rem;
  }

  /* Body Utility Classes (Context, Benefits, ROI) */
  .context-box {
    background-color: #f3f4f6;
    border-left: 4px solid var(--brand);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
  }

  .benefits-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
  }

  .benefits-list li {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
  }

  .roi-box {
    background: linear-gradient(135deg, var(--brand) 0%, #ff8c00 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    border-radius: 12px;
    margin: 3rem 0;
    box-shadow: 0 10px 15px -3px rgba(255, 105, 0, 0.3);
  }

  .roi-box h3 {
    color: white;
    font-size: 2.5rem;
    margin: 0;
  }

  /* Article Footer Sections */
  .article-footer-section {
    background-color: #f9fafb;
    padding: 4rem 0;
    margin-top: 4rem;
    border-top: 1px solid #e5e7eb;
  }

  .about-us-block,
  .offer-block,
  .cta-block,
  .related-news-block {
    margin-bottom: 3rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }

  .offer-block {
    background-color: #e0f2fe;
    color: #0c4a6e;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #bae6fd;
  }

  .cta-block h2 {
    margin-bottom: 1rem;
  }

  .related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
  }

  .related-item a {
    text-decoration: none;
    color: inherit;
    display: block;
  }

  .related-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
  }

  .related-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
  }

  /* Modern News Grid Styles */
  .news-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
  }

  .news-card-modern {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .news-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }

  .news-card-image-wrapper {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
  }

  .news-card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
  }

  .news-card-modern:hover .news-card-image-wrapper img {
    transform: scale(1.05);
  }

  .news-category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-ink);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .news-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }

  .news-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
  }

  .news-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--brand-ink);
  }

  .news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
  }

  .news-title a:hover {
    color: var(--brand);
  }

  .news-excerpt {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
  }

  .read-more-link {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
  }

  .read-more-link:hover {
    color: var(--brand-dark);
  }