/* Previene scroll horizontal indeseado en todo el sitio */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ==========================================
   RESET & VARIABLES GLOBALES (FONDO CLARO GENERAL)
   ========================================== */
:root {
  --primary-gold: #f4be18;
  --bg-dark: #ffffff;          /* Fondo blanco para las secciones del sitio */
  --bg-card: #f8f9fa;          /* Fondo claro para tarjetas */
  --text-light: #12151c;        /* Texto principal oscuro */
  --text-muted: #4a5568;        /* Texto secundario gris */
  --font-main: 'Poppins', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: #ffffff;    /* Asegura fondo claro en todo el sitio */
  color: #12151c;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================
   HEADER & NAVEGACIÓN (DESKTOPS)
   ========================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #0d1117;   /* Fondo oscuro exclusivo para la barra superior */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px 5%;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1250px;
  margin: 0 auto;
  gap: 20px;
  position: relative;
}

/* Logo más grande como la referencia */
.site-logo img {
  height: 62px;               /* Incrementado para mayor visibilidad */
  width: auto;
  display: block;
}

/* Menú empujado hacia la derecha antes del botón */
.header-container nav {
  margin-left: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

/* Espaciado del contenedor del botón de contacto en escritorio */
.nav-menu .nav-btn-item {
  margin-left: 10px;
}

/* Todos los enlaces en color amarillo/dorado corporativo */
.nav-menu a {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-gold); /* Todos amarillos según referencia */
  transition: opacity 0.2s;
}

.nav-menu a:hover {
  opacity: 0.8;
}

/* Botón Contáctanos */
.btn-header-contact {
  background-color: var(--primary-gold);
  color: #000000 !important;
  padding: 10px 28px;
  border-radius: 25px;
  font-weight: 800;
  font-size: 0.9rem;
  transition: transform 0.2s, background 0.3s;
  white-space: nowrap;
}

.btn-header-contact:hover {
  background-color: #dca30e;
  transform: translateY(-2px);
  color: #fff  !important;
}

/* Botón Menú Hamburguesa (Oculto por defecto en escritorio) */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  z-index: 1100;
}

.mobile-menu-btn span {
  display: block;
  width: 26px;
  height: 3px;
  background-color: var(--primary-gold);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ==========================================
   HERO SECTION (DISEÑO DERECHA / AMARILLO)
   ========================================== */
.hero-section {
  position: relative;
  min-height: 80vh;
  background: url('../images/portada2.jpg') center/cover no-repeat;
  display: flex;
  align-items: flex-end;      /* Alinea el contenido en la parte inferior */
  justify-content: flex-end;  /* Alinea el contenido a la derecha */
  text-align: right;          /* Alinea el texto a la derecha */
  padding: 60px 5%;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25); /* Overlay liviano */
  border-bottom: solid 15px #f4be18;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px; /* Ancho que obliga al texto a romper en 2 líneas exactamente */
  padding-bottom: 20px;
}

.hero-title {
  font-size: clamp(0.5rem, 1.2vw, 1.8rem);
  font-weight: 900;
  font-style: normal;
  color: #ffffff;
  opacity: 0.5;
  /* text-transform: uppercase; */
  margin: 0;
  letter-spacing: 0.5px;
  line-height: 1.15;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* ==========================================
   SECCIONES GENERALES
   ========================================== */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 20px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-subtitle {
  color: var(--primary-gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

/* ==========================================
   ABOUT US / NOSOTROS (DISEÑO REORGANIZADO)
   ========================================== */
.about-wrapper {
  display: grid;
  grid-template-columns: 70% 30%; /* Columna de texto 70%, widgets 30% */
  gap: 40px;
  align-items: start;
}

.about-main-title {
  font-size: 2.2rem;
  font-weight: 900;
  font-style: italic;
  color: #000000;
  text-transform: uppercase;
  margin-bottom: 25px;
  letter-spacing: -0.5px;
}

.about-intro {
  font-size: 1rem;
  color: #12151c;
  line-height: 1.6;
  margin-bottom: 30px;
}

.about-block {
  margin-bottom: 25px;
}

.about-block h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #000000;
  margin-bottom: 10px;
}

.about-block p {
  font-size: 0.98rem;
  color: #12151c;
  line-height: 1.6;
}

.widgets-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #000000;
  margin-bottom: 25px;
  text-align: center;
}

.widgets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.widget-item {
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

/* ==========================================
   LÍNEAS DE SERVICIO
   ========================================== */
.services-section {
  padding-top: 50px;
  padding-bottom: 70px;
}

.services-title-block {
  text-align: center;
  margin-bottom: 40px;
}

.services-title-block .section-title {
  font-size: 2.8rem;
  font-weight: 900;
  color: #000000;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.services-title-block .section-subtitle {
  color: var(--primary-gold, #f4be18);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: block;
}

.services-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
}

.service-card-yellow {
  position: relative;
  background: linear-gradient(180deg, #f4be18 0%, #d89e08 100%);
  padding: 35px 30px;
  border-radius: 0;
  color: #000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.service-num-overlay {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 3.2rem;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.15);
  line-height: 1;
  pointer-events: none;
}

.service-card-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #000000;
  text-transform: uppercase;
  line-height: 1.25;
  margin-bottom: 15px;
  padding-right: 50px;
}

.service-card-yellow-title{
  max-width: 400px;
}

.service-card-lead {
  font-weight: 700;
  font-size: 0.92rem;
  color: #000000;
  margin-bottom: 12px;
  line-height: 1.3;
}

.service-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.service-list li {
  font-size: 0.88rem;
  font-weight: 500;
  color: #0d1117;
  line-height: 1.4;
  margin-bottom: 10px;
  position: relative;
  padding-left: 14px;
}

.service-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #000000;
  font-weight: bold;
}

/* ==========================================
   GALERÍA DE CAMPO
   ========================================== */
.gallery-section {
  padding: 60px 0 0 0;
  text-align: center;
  background-color: #ffffff;
}

.gallery-header {
  max-width: 1200px;
  margin: 0 auto 30px auto;
  padding: 0 20px;
}

.gallery-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.gallery-header p {
  color: var(--primary-gold);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.gallery-grid-pdf {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
}

.gallery-grid-pdf img {
  width: 25%;
  height: 380px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* ==========================================
   SECCIÓN PROYECTOS Y TABLA
   ========================================== */
.crp-projects {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.crp-section-header {
  text-align: center;
  margin-bottom: 35px;
}

.crp-section-header h2 {
  font-size: 2.8rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #000000;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.crp-subtitle {
  color: var(--primary-gold, #f4be18);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 0;
  display: block;
}

.crp-table-controls {
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
}

.crp-table-controls input {
  width: 100%;
  max-width: 420px;
  padding: 10px 18px;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #000000;
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.crp-table-controls input:focus {
  border-color: var(--primary-gold, #f4be18);
  box-shadow: 0 0 0 3px rgba(244, 190, 24, 0.2);
}

.crp-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.crp-custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-family: var(--font-main);
}

.crp-custom-table thead tr {
  background-color: #e5e7eb;
}

.crp-custom-table th {
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 14px 18px;
  text-align: left;
  letter-spacing: 0.8px;
  border: none;
}

.crp-custom-table th:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.crp-custom-table th:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.crp-custom-table tbody tr {
  background-color: #f4be18;
  color: #000000;
  transition: transform 0.2s, box-shadow 0.2s;
}

.crp-custom-table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 190, 24, 0.3);
}

.crp-custom-table td {
  padding: 16px 18px;
  font-size: 0.9rem;
  vertical-align: middle;
  border: none;
  color: #000000;
}

.crp-custom-table td strong {
  font-weight: 800;
  color: #000000;
}

.crp-custom-table td code {
  font-family: var(--font-main);
  font-weight: 800;
  background: transparent;
  color: #000000;
}

.crp-custom-table td:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.crp-custom-table td:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.crp-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 35px;
}

.crp-pagination button {
  background-color: #ffffff;
  color: #4b5563;
  border: 1.5px solid #9ca3af;
  padding: 10px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.crp-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #d1d5db;
  color: #9ca3af;
}

.crp-pagination button:not(:disabled):hover {
  border-color: #000000;
  color: #000000;
  background-color: #f9fafb;
}

#crpPageIndicator {
  color: #4b5563;
  font-size: 0.95rem;
  font-weight: 700;
}

/* ==========================================
   ALIADOS Y CLIENTES
   ========================================== */
.clients-section {
  text-align: center;
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.clients-header {
  margin-bottom: 40px;
}

.clients-header .section-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: #000000;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  max-width: 700px;
  margin: 0 auto 8px auto;
}

.clients-header .section-subtitle {
  color: var(--primary-gold, #f4be18);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: block;
}

.logos-slider {
  overflow: hidden;
  width: 100%;
  padding: 20px 0;
  position: relative;
}

.logos-slider::before,
.logos-slider::after {
  content: "";
  position: absolute;
  top: 0;
  width: 80px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.logos-slider::before {
  left: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 1), transparent);
}

.logos-slider::after {
  right: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 1), transparent);
}

.logos-track {
  display: flex;
  align-items: center;
  gap: 60px;
  width: max-content;
  animation: scrollLogos 20s linear infinite;
}

.logos-slider:hover .logos-track {
  animation-play-state: paused;
}

.logos-track img {
  max-height: 150px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  filter: brightness(0) opacity(0.55);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.logos-track img:hover {
  filter: brightness(0) opacity(0.9);
  transform: scale(1.08);
}

/* Incrementa solo el logo de Chevron */
.logos-track img.logo-chevron {
  max-height: 180px; /* Incrementa el max-height relativo al general de 150px */
  transform: scale(1.25); /* Opcional: para agrandarlo proporcionalmente sin alterar el layout */
  margin-left: -50px;
  margin-right: -50px;
}

@keyframes scrollLogos {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
  background-color: #07080b;
  padding: 60px 20px 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-bottom {
  text-align: center;
  color: #bec3cc;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 25px;
}

/* ==========================================
   REGLAS RESPONSIVAS EXCLUSIVAS PARA MÓVILES Y TABLETS
   (Sin modificar la versión de escritorio)
   ========================================== */

@media (max-width: 992px) {
  .about-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  /* --- NAVBAR / HAMBURGUESA --- */
  .site-header {
    padding: 12px 5%;
  }

  .mobile-menu-btn {
    display: flex; /* Muestra el botón de 3 líneas en móvil */
  }

  .header-container nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #0d1117;
    border-bottom: 2px solid var(--primary-gold);
    padding: 25px 20px;
    display: none; /* Se oculta por defecto */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6);
  }

  /* Clase activa que despliega el menú en móvil */
  .header-container nav.nav-active {
    display: block;
  }

  .nav-menu {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
    text-align: center;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    font-size: 1.1rem;
    display: block;
    padding: 6px 0;
  }

  /* Ajuste para el botón Contáctanos dentro del menú desplegable */
  .nav-menu .nav-btn-item {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }

  .btn-header-contact {
    display: inline-block;
    width: auto;
    min-width: 200px;
    text-align: center;
    padding: 12px 30px;
  }

  /* Animación del ícono hamburguesa cuando está abierto */
  .mobile-menu-btn.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .mobile-menu-btn.is-active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-btn.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* --- HERO SECTION --- */
  .hero-section {
    min-height: 60vh;
    justify-content: center;
    align-items: flex-end;
    text-align: center;
    padding: 40px 15px; /* Reducimos padding lateral para dar más espacio al texto */
    overflow: hidden;
  }

  .hero-content {
    max-width: 100%;
    width: 100%;
    padding: 0 10px;
  }

  .hero-title {
    font-size: 1.65rem !important; /* Disminuimos el tamaño para que encaje la palabra completa */
    line-height: 1.25;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto; /* Permite dividir con guión si la pantalla es excesivamente estrecha */
  }

  /* --- SERVICIOS Y GALERÍA --- */
  .services-grid-2x2 {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Corrección para que las tarjetas amarillas no se salgan por la derecha */
  .service-card,
  .services-grid-2x2 > div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden !important; /* Mantiene la marca de agua y el contenido dentro de la tarjeta */
  }

  .gallery-grid-pdf {
    flex-wrap: wrap;
  }

  .gallery-grid-pdf img {
    width: 50%;
    height: 250px;
  }

  /* --- TABLA PROYECTOS Y CONTROLES --- */
  .crp-section-header h2,
  .services-title-block .section-title,
  .clients-header .section-title {
    font-size: 2.1rem;
  }

  .crp-pagination {
    gap: 10px;
  }

  .crp-pagination button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) { /* Ajuste para pantallas muy estrechas */
  .hero-title {
    font-size: 1.45rem !important; 
  }
  
  .gallery-grid-pdf img {
    width: 100%;
    height: 220px;
  }

  .site-logo img {
    height: 48px;
  }
}
