/* ======= ESTILOS G LEVEL ======= */

:root {
  --gold: #d4af37;
  --gold-light: #ffd700;
  --black: #000000;
  --white: #ffffff;
  --bg-color: #000000;
  --text-color: #d4af37;
  --border-color: #d4af37;
  --card-bg: rgba(212, 175, 55, 0.1);
  --section-bg: rgba(212, 175, 55, 0.1);
  --input-bg: rgba(255, 255, 255, 0.1);

  /* Variables para fondos intercalados */
  --section-bg-dark: #000000;
  --section-bg-alt: #000000;
  --section-bg-gradient: #000000;
}

iframe {
  border: none;
}

/* Modo claro */
[data-theme="light"] {
  --bg-color: #ffffff;
  --text-color: #000000;
  --border-color: #d4af37;
  --card-bg: rgba(212, 175, 55, 0.1);
  --section-bg: rgba(212, 175, 55, 0.05);
  --input-bg: rgba(0, 0, 0, 0.05);

  /* Variables para fondos intercalados en modo claro */
  --section-bg-dark: #ffffff;
  --section-bg-alt: #ffffff;
  --section-bg-gradient: #ffffff;
}

/* Modo oscuro (por defecto) */
[data-theme="dark"] {
  --bg-color: #000000;
  --text-color: #d4af37;
  --border-color: #d4af37;
  --card-bg: rgba(212, 175, 55, 0.1);
  --section-bg: rgba(212, 175, 55, 0.1);
  --input-bg: rgba(255, 255, 255, 0.1);

  /* Variables para fondos intercalados en modo oscuro */
  --section-bg-dark: #000000;
  --section-bg-alt: #000000;
  --section-bg-gradient: #000000;
}

/* ======= SISTEMA DE FONDOS INTERCALADOS ======= */
/* Fondos alternativos para secciones */
.section-bg-dark {
  background: var(--section-bg-dark) !important;
  color: var(--text-color);
}

.section-bg-alt {
  background: var(--section-bg-alt) !important;
  color: var(--text-color);
}

.section-bg-gradient {
  background: var(--section-bg-gradient) !important;
  color: var(--text-color);
}

/* Transiciones suaves entre secciones */
section {
  transition: background-color 0.3s ease;
}

/* Patrón intercalado automático para secciones pares/impares (fallback) */
/* Solo aplicar a secciones que NO tengan clases específicas de fondo */
section:not(.hero):not(.section-bg-dark):not(.section-bg-alt):not(
    .section-bg-gradient
  ):nth-child(odd) {
  background: var(--section-bg-dark);
}

section:not(.hero):not(.section-bg-dark):not(.section-bg-alt):not(
    .section-bg-gradient
  ):nth-child(even) {
  background: var(--section-bg-alt);
}

/* Excepciones específicas para mejores transiciones visuales */
.video-section {
  background: var(--section-bg-gradient) !important;
}

/* Asegurar que los video-section mantengan el gradiente */
.video-section.section-bg-alt {
  background: var(--section-bg-gradient) !important;
}

/* Reset general */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Merriweather", Arial, serif;
}

/* Configuración fundamental para dispositivos móviles */
html {
  /* Evitar zoom automático en inputs en iOS */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Scroll suave */
  scroll-behavior: smooth;
}

/* Asegurar que las imágenes y videos sean responsive por defecto */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevenir overflow horizontal */
html,
body {
  overflow-x: hidden;
  width: 100%;
}

/* Fondo y texto según modo */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition:
    background-color 0.3s,
    color 0.3s;
}

/* Estilos del main para asegurar consistencia */
main {
  width: 100%;
  min-width: 0; /* Prevenir overflow */
  transition: all 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  min-width: 0; /* Prevenir overflow */
  transition: padding 0.3s ease; /* Transición suave para todos los containers */
}

/* Mejora específica para móviles pequeños */
@media (max-width: 480px) {
  .container {
    padding: 0 15px; /* Menos padding en móviles muy pequeños */
  }
}

section {
  padding: 80px 0;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  padding-bottom: 15px;
}

h2:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: var(--gold);
}

/* =======================================================
   HEADER - REFACTORIZACIÓN COMPLETA
   ======================================================= */

/* --- Base del Header --- */
.site-header {
  background: var(--bg-color);
  color: var(--text-color);
  padding: 15px 0;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}

.site-header .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  z-index: 1100; /* Asegurar que la marca esté por encima del menú */
}

.brand img {
  height: 50px;
  margin-right: 15px;
}

/* --- Contenedor de Navegación --- */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Alinear todo a la derecha */
  flex-grow: 1; /* Ocupar el espacio restante */
}

/* --- Herramientas (Botones y Menú Hamburguesa) --- */
.nav-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Botones de Acción (Tema e Idioma) --- */
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px; /* Bordes más redondeados */
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap; /* Evitar que el texto se rompa */
}

.icon-btn:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.icon-btn .icon-emoji {
  font-size: 1rem;
}

/* --- Menú Hamburguesa --- */
.menu-toggle {
  display: none; /* Oculto por defecto */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  z-index: 1200; /* Siempre visible */
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 5px;
  transition:
    transform 0.35s ease,
    opacity 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- Lista de Navegación (Menú Principal) --- */
.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.nav-list a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  white-space: nowrap;
}

.nav-list a:hover {
  background-color: var(--gold);
  color: var(--black);
}

/* Header responsive base moved to consolidated blocks near the end of the file */

/* HERO - Desktop por defecto */
.hero {
  padding: 100px 0;
  text-align: center;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
    url("../img/Hero.svg"); /* Fallback - imagen actual */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

[data-theme="light"] .hero {
  background: linear-gradient(
      rgba(255, 255, 255, 0.1),
      rgba(245, 245, 245, 0.2)
    ),
    url("../img/Hero.svg"); /* Fallback - imagen actual */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  /* Filtros para mejorar la imagen en modo claro */
  filter: contrast(1.1) saturate(1.2) brightness(0.9);
}

/* Mejorar contraste del texto en hero modo claro */
[data-theme="light"] .hero h1 {
  color: #b8860b; /* Amarillo dorado más oscuro para modo claro */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); /* Sombra oscura para contraste */
  font-weight: 700; /* Texto más bold */
}

[data-theme="light"] .hero .lead {
  color: #b8860b; /* Amarillo dorado más oscuro para modo claro */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4); /* Sombra oscura sutil */
  font-weight: 600; /* Peso intermedio */
}

/* Estilos generales del texto del hero para ambos temas */
.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  color: #d4af37; /* Amarillo dorado */
  text-align: center;
}

.hero .lead {
  font-size: 1.3rem;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  color: #d4af37; /* Amarillo dorado */
  text-align: center;
}

/* Mejoras específicas para Hero con imagen SVG */
.hero {
  /* Optimizado para SVG - mejor calidad en todas las resoluciones */
  background-attachment: scroll; /* Mejor performance con SVG */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  width: 100%;
  /* Asegurar que la imagen mantenga proporción en móviles */
  background-origin: border-box;
}

/* Mejorar contenedor del hero */
.hero .container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
}

/* ===== IMÁGENES ESPECÍFICAS POR DISPOSITIVO ===== */

/* Desktop (1024px+) - Imagen horizontal optimizada */
@media (min-width: 1024px) {
  .hero {
    min-height: 100vh;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Usar Hero-desktop.svg si existe, sino Hero.svg */
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
      url("../img/Hero-desktop.svg"), url("../img/Hero.svg"); /* Fallback */
  }

  [data-theme="light"] .hero {
    background-image: linear-gradient(
        rgba(255, 255, 255, 0.1),
        rgba(245, 245, 245, 0.2)
      ),
      url("../img/Hero-desktop.svg"), url("../img/Hero.svg"); /* Fallback */
  }
}

/* Tablets (768px - 1023px) - Imagen cuadrada/horizontal */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero {
    min-height: 100vh;
    /* Usar Hero-tablet.svg si existe, sino Hero.svg */
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
      url("../img/Hero-tablet.svg"), url("../img/Hero.svg"); /* Fallback */
  }

  [data-theme="light"] .hero {
    background-image: linear-gradient(
        rgba(255, 255, 255, 0.1),
        rgba(245, 245, 245, 0.2)
      ),
      url("../img/Hero-tablet.svg"), url("../img/Hero.svg"); /* Fallback */
  }
}

/* ===== IMPLEMENTACIÓN HERO-MOBILE.SVG ACTIVA ===== */
/* Móviles (768px y menos) - Imagen vertical optimizada con Hero-mobile.svg */
@media (max-width: 768px) {
  /* REMOVIDO - Reglas movidas a sección definitiva de corrección */

  .hero {
    padding: 40px 15px;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    /* 🎯 Hero-mobile.svg - Imagen vertical optimizada para móviles */
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
      url("../img/Hero-mobile.svg");
    /* Configuración optimizada para imagen vertical (768x1024px) */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
  }

  [data-theme="light"] .hero {
    background-image: linear-gradient(
        rgba(255, 255, 255, 0.1),
        rgba(245, 255, 255, 0.2)
      ),
      url("../img/Hero-mobile.svg");
  }

  .hero .container {
    padding-bottom: 25vh; /* Posición alta pero centrada */
    padding-right: 90px; /* Espacio para botones */
    padding-left: 20px;
  }

  .hero h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-align: center;
  }

  .hero .lead {
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
  }
}

/* Responsive para móviles pequeños - Hero-mobile.svg optimizado */
@media (max-width: 480px) {
  .hero {
    padding: 30px 10px;
    min-height: 100vh;
    height: 100vh;
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
  }

  .hero .container {
    padding-bottom: 20vh;
    padding-right: 85px;
    padding-left: 15px;
  }

  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }

  .hero .lead {
    font-size: 1rem;
    line-height: 1.4;
    max-width: 95%;
  }
}

/* Responsive específico para móviles extra pequeños (425px) - Hero-mobile.svg */
@media (max-width: 425px) {
  /* REMOVIDO - Reglas de header movidas a sección definitiva */

  .hero {
    padding: 25px 15px;
    min-height: 100vh;
    height: 100vh;
    background-size: cover;
    background-position: center 30%;
    background-attachment: scroll;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero .container {
    padding: 0 15px;
    text-align: center;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hero h1 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 0.8rem;
    text-align: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero .lead {
    font-size: 0.95rem;
    line-height: 1.3;
    max-width: 95%;
    text-align: center;
    margin: 0 auto;
  }
}

/* Responsive específico para móviles iPhone SE (375px) - Hero-mobile.svg */
@media (max-width: 375px) {
  /* REMOVIDO - Reglas de header movidas a sección definitiva */

  .hero {
    padding: 20px 10px;
    min-height: 100vh;
    height: 100vh;
    background-size: cover;
    background-position: center 25%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero .container {
    padding: 0 10px;
    text-align: center;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hero h1 {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 0.7rem;
    text-align: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
  }

  .hero .lead {
    font-size: 0.9rem;
    line-height: 1.25;
    max-width: 95%;
    text-align: center;
    margin: 0 auto;
  }
}

/* Responsive específico para móviles muy pequeños (320px) - Hero-mobile.svg */
@media (max-width: 320px) {
  .hero {
    padding: 15px 3px;
    min-height: 100vh;
    height: 100vh;
    background-size: cover;
    background-position: center 20%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero .container {
    padding-bottom: 12vh;
    padding-right: 70px;
    padding-left: 8px;
  }

  .hero h1 {
    font-size: 1.2rem;
    line-height: 1.1;
    margin-bottom: 0.7rem;
  }

  .hero .lead {
    font-size: 0.9rem;
    line-height: 1.3;
    max-width: 95%;
  }

  .hero .container {
    padding: 0 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
  }

  .hero h1 {
    font-size: 1.3rem;
    line-height: 1.1;
    margin-bottom: 0.6rem;
    word-wrap: break-word;
    hyphens: auto;
    text-align: center;
  }

  .hero .lead {
    font-size: 0.85rem;
    line-height: 1.2;
    max-width: 100%;
    word-wrap: break-word;
    text-align: center;
  }
}

/* PROYECTOS */
.proyectos {
  background-color: var(--section-bg);
}

.proyecto-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.proyecto-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.3s;
}

.proyecto-card:hover {
  transform: translateY(-10px);
}

.proyecto-img {
  height: 320px; /* Aumentado para mejor proporción */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow: hidden;
  position: relative;
  background: transparent; /* Fondo transparente */
  border-radius: 12px 12px 0 0; /* Bordes redondeados solo arriba */
}

.proyecto-img::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 3px solid var(--gold);
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.proyecto-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: relative;
  z-index: 2;
  background: none;
  padding: 0;
  border: none;
  transition: transform 0.3s ease;
  /* Asegurar que la imagen sea responsive en móviles */
  max-width: 100%;
  display: block;
}

/* Mejora específica para móviles - imágenes ancho completo */
@media (max-width: 767px) {
  .proyecto-img {
    /* Asegurar que el contenedor no cause overflow */
    width: 100%;
    overflow: hidden;
    padding: 0; /* Sin padding para que la imagen use todo el ancho */
    background: var(--card-bg); /* Fondo del contenedor */
  }

  .proyecto-img img {
    /* Imagen con ancho completo de la card */
    width: 100%; /* Todo el ancho de la card */
    height: 100%; /* Altura completa del contenedor */
    object-fit: cover;
    object-position: center;
    border-radius: 0; /* Sin bordes para mejor integración */
    display: block;
  }
}

/* Efecto hover suave para las imágenes */
.proyecto-card:hover .proyecto-img img {
  transform: scale(1.03); /* Reducido el zoom para que sea más sutil */
  transition: transform 0.3s ease;
}

.proyecto-content {
  padding: 25px;
}

.proyecto-content h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--gold);
}

.proyecto-content p {
  margin-bottom: 15px;
}

.proyecto-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.location-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 8px 15px;
  background: var(--gold);
  color: var(--black);
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: all 0.3s;
}

.location-btn:hover {
  background: var(--gold-light);
}

/* EMPRESAS ALIADAS */
.empresas-aliadas {
  background-color: var(--section-bg);
  text-align: center;
}

.empresas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.empresa-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
}

.empresa-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.empresa-logo {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

/* FORMULARIO DE CONTACTO */
.contacto {
  background-color: var(--section-bg);
}

.form-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: stretch;
}

.contact-form,
.contact-info {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.contact-info {
  text-align: center;
}

.whatsapp-qr {
  margin: 25px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.whatsapp-qr img {
  max-width: 200px;
  border: 2px solid var(--gold);
  border-radius: 10px;
  margin-bottom: 15px;
}

.whatsapp-qr p {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* FORMULARIO BASE */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--text-color);
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Estilo específico para selects - adaptado al tema */
select.form-control,
#proyecto,
#brokerExperiencia {
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

/* Opciones del select - usar colores del tema */
select.form-control option,
#proyecto option,
#brokerExperiencia option {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Estilo especial para tema claro - fondo dorado suave */
[data-theme="light"] select.form-control,
[data-theme="light"] #proyecto,
[data-theme="light"] #brokerExperiencia {
  background-color: rgba(212, 175, 55, 0.1); /* Gold muy suave */
}

[data-theme="light"] select.form-control option,
[data-theme="light"] #proyecto option,
[data-theme="light"] #brokerExperiencia option {
  background-color: rgba(212, 175, 55, 0.05); /* Aún más suave para opciones */
}

/* Estilo para tema oscuro - mantener input-bg */
[data-theme="dark"] select.form-control,
[data-theme="dark"] #proyecto,
[data-theme="dark"] #brokerExperiencia {
  background-color: var(--input-bg);
}

[data-theme="dark"] select.form-control option,
[data-theme="dark"] #proyecto option,
[data-theme="dark"] #brokerExperiencia option {
  background-color: var(--bg-color);
}

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--black);
  padding: 12px 30px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: var(--gold-light);
  transform: translateY(-3px);
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  font-size: 0.9rem;
}

.checkbox-group input {
  margin-top: 5px;
}

/* INFO ADICIONAL */
.info-adicional {
  padding: 60px 0;
}

.info-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.info-content p {
  margin-bottom: 25px;
  font-size: 1.1rem;
}

.contacto-info {
  margin-top: 40px;
  padding: 30px 20px; /* Reducido para móviles */
  background: var(--card-bg);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.contacto-info h3 {
  margin-bottom: 30px;
  color: var(--gold);
}

.contacto-details {
  display: grid;
  grid-template-columns: 1fr; /* 1 columna por defecto para móviles */
  gap: 20px;
  text-align: left;
}

.contact-detail-item {
  display: flex;
  align-items: flex-start; /* Alinear al inicio para mejor consistencia */
  gap: 15px; /* Reducido para móviles */
}

.contact-detail-item i {
  font-size: 1.5rem; /* Reducido para móviles */
  color: var(--gold);
  width: 40px; /* Aumentado para dar más espacio */
  flex-shrink: 0; /* Evitar que el icono se encoja */
  display: inline-flex; /* Centrado perfecto */
  align-items: center; /* Centrado perfecto */
  justify-content: center; /* Centrado perfecto */
}

.contact-detail-item div {
  display: flex;
  flex-direction: column;
}

.contacto-details strong {
  display: block;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 0.8rem; /* Reducido para móviles */
  text-transform: uppercase;
}

.contacto-details span {
  font-size: 0.95rem;
  word-break: break-word; /* Evitar desbordamiento en móviles */
}

/* Responsive para tablets y escritorio */
@media (min-width: 768px) {
  .contacto-info {
    padding: 40px;
  }

  .contact-detail-item {
    gap: 20px;
  }

  .contact-detail-item i {
    font-size: 1.8rem;
    width: 40px;
  }

  .contacto-details strong {
    font-size: 0.9rem;
  }

  .contacto-details span {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  .contacto-details {
    grid-template-columns: repeat(2, 1fr); /* 2 columnas para desktop */
    column-gap: 40px;
    row-gap: 30px;
  }
}

/* TRABAJA CON NOSOTROS */
.empleo {
  background-color: var(--section-bg);
  text-align: center;
}

.empleo-content {
  max-width: 800px;
  margin: 0 auto;
}

.empleo-content p {
  margin-bottom: 30px;
  font-size: 1.1rem;
}

/* FOOTER */
footer {
  background: var(--bg-color);
  color: var(--text-color);
  text-align: center;
  padding: 40px;
  border-top: 2px solid var(--border-color);
}

#year {
  display: inline-block;
}

/* BOTONES FLOTANTES DE REDES SOCIALES */
.social-flotante {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.social-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.social-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.social-btn.whatsapp {
  background: #25d366;
}

.social-btn.instagram {
  background: #e1306c;
}

.social-btn.facebook {
  background: #3b5998;
}

.social-btn.email {
  background: #d44638;
}

.social-btn.web {
  background: #d4af37;
}

.social-tooltip {
  position: absolute;
  right: 70px;
  background: var(--card-bg);
  color: var(--text-color);
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}

.social-btn:hover .social-tooltip {
  opacity: 1;
  visibility: visible;
}

/* VIDEO SECTION */
.video-section {
  padding: 80px 0;
  text-align: center;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border: 3px solid var(--gold);
  border-radius: 10px;
  overflow: hidden;
}

/* --- Mejora responsive video --- */
.video-container.ratio-16x9 {
  /* mejora progresiva */
  aspect-ratio: 16 / 9; /* navegadores modernos */
}
.video-container video {
  object-fit: cover;
}

/* Acciones del video */
.video-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.video-actions .btn {
  min-width: 140px;
}

/* Loading state opcional */
.video-container.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(212, 175, 55, 0.35),
    rgba(0, 0, 0, 0.85)
  );
  display: block;
  animation: fadePulse 1.2s ease-in-out infinite;
}
@keyframes fadePulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.7;
  }
}

/* Móvil muy pequeño */
@media (max-width: 480px) {
  .video-container {
    border-width: 2px;
  }
  .video-actions {
    flex-direction: column;
    gap: 10px;
  }
  .video-actions .btn {
    width: 100%;
  }
}

/* Pantallas grandes: permitir ancho mayor si se desea full-width */
.video-section.full-bleed .video-container {
  max-width: min(1200px, 90vw);
}

.video-container::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Estilos específicos para videos HTML5 */
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  /* Protección adicional contra descarga */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Permitir controles básicos pero ocultar opciones de descarga */
.video-container video::-webkit-media-controls-download-button {
  display: none !important;
}

.video-container video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* Mantener controles de play/pause y volumen */
.video-container video::-webkit-media-controls-play-button,
.video-container video::-webkit-media-controls-volume-slider,
.video-container video::-webkit-media-controls-mute-button,
.video-container video::-webkit-media-controls-timeline {
  display: block !important;
}

/* Protección adicional para el contenedor del video */
#video-corporativo {
  pointer-events: auto;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Estilos personalizados para los controles del video */
#video-corporativo::-webkit-media-controls-panel {
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 0 0 10px 10px;
}

#video-corporativo::-webkit-media-controls-play-button {
  background-color: var(--gold);
  border-radius: 50%;
}

/* Ocultar específicamente botones no deseados */
#video-corporativo::-webkit-media-controls-overflow-button,
#video-corporativo::-webkit-media-controls-cast-button,
#video-corporativo::-webkit-media-controls-picture-in-picture-button {
  display: none !important;
}

/* Estilos para la sección de recorridos 3D */
.recorridos-btn {
  display: inline-block;
  margin-bottom: 30px;
  padding: 12px 24px;
  background-color: var(--gold);
  color: var(--black);
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.recorridos-btn:hover {
  background-color: var(--gold-light);
}

.recorridos-btn i {
  margin-right: 10px;
}

.videos3d {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* Modal estilos */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: flex-start; /* Cambiado de 'center' a 'flex-start' */
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  overflow-y: auto; /* Permitir scroll si el contenido es muy alto */
}

.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background: var(--bg-color);
  color: var(--text-color);
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modalIn 0.35s ease;
  margin-top: 5vh; /* Añadido margen superior */
  margin-bottom: 5vh; /* Añadido margen inferior */
  overflow-x: hidden; /* evitar scroll horizontal accidental en móviles */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  background: var(--card-bg);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--gold);
  flex: 1;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-modal {
  background: transparent;
  border: 0;
  color: var(--text-color);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.25s;
}

.close-modal:hover {
  background: var(--card-bg);
}

.modal-body {
  padding: 24px 24px 30px;
}

.modal-body p {
  margin-bottom: 20px;
}

/* Estilos para mensajes del formulario */
.form-message {
  display: none;
  padding: 12px 16px;
  margin: 15px 22px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.3s ease-out;
}

.form-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.form-message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Animación para los mensajes */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos para tema oscuro */
[data-theme="dark"] .form-message.success {
  background-color: #1e4a29;
  color: #a3d4b3;
  border-color: #2d5a34;
}

[data-theme="dark"] .form-message.error {
  background-color: #4a1e1e;
  color: #d4a3a3;
  border-color: #5a2d2d;
}

[data-theme="dark"] .form-message.info {
  background-color: #1e3a4a;
  color: #a3c4d4;
  border-color: #2d4a5a;
}

/* ======= ESTILOS MODAL BROKER ======= */
/* Enlace 'No soy broker...' con color amarillo corporativo */
.modal-body .close-link {
  color: var(--gold);
  text-decoration: underline;
  font-weight: bold;
  transition: color 0.2s;
}
.modal-body .close-link:hover {
  color: var(--gold-light);
}

/* Opciones del select de años de experiencia con fondo negro y texto dorado */
#brokerExperiencia {
  background: var(--bg-color);
  color: var(--gold);
}
#brokerExperiencia option {
  background: var(--bg-color);
  color: var(--gold);
}

#brokerForm .form-group {
  margin-bottom: 15px;
}

#brokerForm label {
  font-size: 0.9rem;
  margin-bottom: 6px;
  display: block;
}

#brokerForm .form-control {
  font-size: 0.95rem;
  padding: 10px 12px;
}

#brokerForm button {
  margin-top: 10px;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Estilos para el nuevo modal de recorridos --- */
.modal-recorridos {
  max-width: 880px; /* antes 760px */
}

.recorridos-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr; /* siempre una columna */
  margin: 25px 0;
}

/* Miniatura dentro de cada card */
.recorrido-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #111;
}

.recorrido-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  transition: all 0.25s ease;
}

.recorrido-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(212, 175, 55, 0.15);
}

.recorrido-link {
  display: block;
  text-decoration: none;
  color: var(--text-color);
}

.recorrido-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.recorrido-item:hover .recorrido-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
}

.recorrido-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.recorrido-item i {
  display: none; /* Ocultar los íconos */
}

.recorrido-item span {
  font-weight: 600;
  flex-grow: 1;
  word-break: break-word; /* permitir saltos de línea en títulos largos */
  overflow-wrap: anywhere; /* permitir saltos de línea en títulos largos */
}

.mini-btn {
  display: inline-block;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.mini-btn:hover {
  background-color: var(--gold);
  color: var(--black);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.modal-footer-alt {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: right;
}

/* --- Ajustes verticales para cards del modal en móviles --- */
/* Por defecto, miniatura 16:9 y sin altura fija */
.modal-recorridos .recorrido-thumb {
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
}

/* En móviles y tablets, hacer la miniatura más alta (4:3) para evitar apariencia horizontal */
@media (max-width: 768px) {
  .modal-recorridos .recorrido-thumb {
    aspect-ratio: 4 / 3;
    height: auto !important;
  }
}

/* Ajustes para el modal de recorridos en pantallas de hasta 2560px */
@media (max-width: 2560px) {
  /* Forzar una sola columna en el modal de recorridos */
  .modal-recorridos .recorridos-grid {
    grid-template-columns: 1fr;
  }

  /* Aplicar diseño de superposición vertical */
  .recorrido-overlay {
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    padding: 10px;
  }

  .recorrido-title {
    font-size: 0.95rem;
    text-align: center;
  }

  .modal-recorridos .mini-btn {
    width: 100%;
    text-align: center;
  }
}

/* Afinar aún más en anchos muy pequeños */
@media (max-width: 425px) {
  .modal-backdrop {
    padding: 12px;
  }
  .modal-content {
    margin-top: 3vh;
    margin-bottom: 3vh;
  }
  .modal-recorridos .recorrido-item {
    padding: 12px;
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .modal-backdrop {
    padding: 8px;
  }
}

/* RESPONSIVE - Recorridos grid only */
@media (max-width: 768px) {
  /* 1 columna en móviles únicamente */
  .recorridos-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .recorrido-thumb {
    height: 120px;
  }
}

/* REGLAS MÓVILES MOVIDAS A SECCIÓN CONSOLIDADA - Ver línea ~2089 */

/* Estilos mejorados cuando el menú está activo */
.menu-toggle.active ~ .actions {
  background: rgba(
    0,
    0,
    0,
    0.9
  ) !important; /* Fondo más sólido cuando menú está abierto */
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Estilos específicos cuando el header tiene menú abierto */
.site-header.menu-open .actions {
  background: var(--bg-color) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 2px solid var(--border-color) !important;
}

/* Modo claro - ajustar fondo cuando menú está abierto */
[data-theme="light"] .site-header.menu-open .actions {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.site-header.menu-open .nav-list {
  animation: slideDown 0.3s ease-out;
}

/* Animación suave para el menú desplegable */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-list li {
  margin: 10px 0;
}

/* Reglas duplicadas removidas - usar solo las definiciones principales */

.form-container {
  flex-direction: column;
}

.social-flotante {
  right: 8px;
  bottom: 80px; /* Mover hacia arriba para evitar conflicto con texto del hero */
  gap: 10px; /* Reducir espacio entre botones */
}

.social-btn {
  width: 45px; /* Más pequeños en móviles */
  height: 45px;
  font-size: 18px;
}

/* Ajuste adicional para móviles muy pequeños */
@media (max-width: 375px) {
  .social-flotante {
    right: 5px;
    bottom: 100px; /* Más arriba en pantallas pequeñas */
    gap: 8px;
  }

  .social-btn {
    width: 40px; /* Aún más pequeños */
    height: 40px;
    font-size: 16px;
  }

  .video-container {
    max-width: 100%;
  }

  /* Header responsive mejorado */
  .site-header .inner {
    position: relative;
  }

  .menu-toggle {
    order: 1;
  }

  .nav-list {
    /* Espacio superior aumentado para evitar sobreposición con botones absolutos */
    padding-top: 80px !important;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
  }

  .nav-list a {
    font-size: 0.95rem;
  }

  /* Estructura base del header para móviles pequeños */
  .main-nav {
    display: flex;
    align-items: center;
  }
  .nav-tools {
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
  }
  /* menu-toggle ya está configurado en la regla principal @media (max-width: 768px) */
  .nav-list {
    top: 100% !important;
    padding-top: 80px !important; /* Consistente en todos los breakpoints móviles */
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-bottom: 20px !important;
    display: none !important; /* Asegurar que esté oculto por defecto */
  }

  .nav-list.active {
    display: flex !important;
    flex-direction: column !important;
  }

  /* --- Ajuste para recorridos en 2 columnas en móvil (movido a 1024px) --- */
}

/* Eliminadas reglas duplicadas para 769-800, 801+ y 992-1200px (consolidado en min-width: 769px) */

/* Alinear verticalmente enlaces al alto del header */
.site-header .inner {
  align-items: center;
}
.nav-list a {
  display: flex;
  align-items: center;
}

/* Asegurar que ningún iframe previo tape el botón accidentalmente */
.video-section .video-container iframe {
  pointer-events: auto;
}

/* Estilos específicos para el botón de recorridos */
.recorridos-container {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
}
.recorridos-btn {
  position: relative;
  z-index: 6;
  cursor: pointer;
}

/* Fix para tabletas y pantallas medianas (426px a 767px) */
@media (min-width: 426px) and (max-width: 767px) {
  .proyecto-cards {
    grid-template-columns: 1fr; /* Una sola columna */
    max-width: 600px; /* Limitar ancho máximo para mejor proporción */
    margin: 0 auto; /* Centrar el grid */
    gap: 30px;
  }
  .proyecto-img {
    height: 450px; /* Altura aumentada para evitar corte de imagen en tablets */
  }
}

/* Fix GENERAL para tablets grandes y pantallas medianas (768px a 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  /* TODAS las secciones tendrán padding consistente */
  .container {
    padding: 0 25px; /* Padding uniforme para TODAS las secciones */
    max-width: 100%; /* Usar más ancho disponible */
    transition: padding 0.3s ease; /* Transición suave */
  }

  /* Reglas específicas para proyectos */
  .proyecto-cards {
    grid-template-columns: repeat(
      3,
      1fr
    ) !important; /* FORZAR 3 columnas sobre el minmax base */
    gap: 20px; /* Gap balanceado */
    max-width: 100%;
  }
  .proyecto-img {
    height: 250px; /* Altura balanceada para 3 columnas */
  }
}

/* Transición suave para TODAS las secciones 900px-1024px */
@media (min-width: 900px) and (max-width: 1024px) {
  /* TODAS las secciones */
  .container {
    padding: 0 30px; /* Padding progresivo para todas las secciones */
    transition: padding 0.3s ease;
  }

  /* Proyectos específicos */
  .proyecto-cards {
    grid-template-columns: repeat(3, 1fr) !important; /* MANTENER 3 columnas */
    gap: 25px; /* Gap ligeramente mayor */
  }
  .proyecto-img {
    height: 270px; /* Altura equilibrada */
  }
}

/* Fix para pantallas grandes (1025px a 1199px) - TODAS las secciones */
@media (min-width: 1025px) and (max-width: 1199px) {
  /* TODAS las secciones vuelven al padding estándar */
  .container {
    padding: 0 20px; /* Padding estándar para continuidad */
    max-width: 1200px; /* Volver al max-width estándar */
    transition: padding 0.3s ease;
  }

  /* Proyectos específicos */
  .proyecto-cards {
    grid-template-columns: repeat(
      3,
      1fr
    ); /* 3 columnas fijas para evitar salto a 2 */
    gap: 30px;
  }
  .proyecto-img {
    height: 320px; /* Altura estándar */
  }
}

/* Fix para pantallas muy grandes (1200px+) - grid adaptativo completo */
@media (min-width: 1200px) {
  .proyecto-cards {
    grid-template-columns: repeat(
      auto-fit,
      minmax(350px, 1fr)
    ); /* Grid responsive original */
    gap: 30px;
  }
  .proyecto-img {
    height: 320px; /* Altura estándar para desktop */
  }
}

/* Fix para móviles medianos (376px-425px) - Hero centrado */
@media (min-width: 376px) and (max-width: 425px) {
  .hero .container {
    padding: 0 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hero h1 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .hero .lead {
    text-align: center;
    margin: 0 auto;
    max-width: 95%;
  }

  .proyecto-img {
    height: 350px; /* Altura optimizada para móviles medianos */
  }
}

/* Fix específico para pantallas muy pequeñas (320px) */
@media (max-width: 320px) {
  .proyecto-img {
    height: 280px; /* Altura optimizada para 320px */
  }
}

/* Fixes para móviles (375px) */
@media (min-width: 321px) and (max-width: 375px) {
  .proyecto-img {
    height: 320px; /* Altura optimizada para 375px */
  }
}

/* Estilos comunes para imágenes de proyecto en móviles */
@media (max-width: 425px) {
  .proyecto-img img {
    object-fit: cover; /* Rellenar el contenedor */
    object-position: center; /* Centrar la imagen para mejor encuadre */
  }
}

/* Fixes fundamentales para móviles */
body {
  overflow-x: hidden;
  min-width: 0; /* Prevenir overflow */
}

/* Asegurar que todos los elementos de grid sean responsive */
.proyecto-cards,
.empresas-grid,
.recorridos-grid {
  min-width: 0; /* Prevenir overflow */
}

/* Fixes específicos para móviles extra pequeños (<=480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 15px; /* Consistente con la regla anterior */
  }
  .proyecto-cards {
    grid-template-columns: 1fr;
    gap: 20px; /* Gap más pequeño para móviles */
  }

  /* Asegurar que las imágenes no se desborden */
  .empresa-logo {
    width: 100%;
    object-fit: contain;
  }

  /* Imágenes de proyectos en pantallas muy pequeñas - ancho completo */
  .proyecto-img {
    padding: 0; /* Sin padding para ancho completo */
  }

  .proyecto-img img {
    width: 100%; /* Ancho completo de la card */
    height: 100%;
    border-radius: 0; /* Sin bordes para integración completa */
  }

  /* Header más compacto en móviles */
  .site-header {
    padding: 10px 0;
  }

  /* Video más compacto */
  .video-actions .btn {
    min-width: auto;
    width: 100%;
    margin-bottom: 10px;
  }
}
/* Fix para tamaño de fuente y alineación en sección de contacto en móviles */
@media (max-width: 425px) {
  .contact-detail-item {
    align-items: center; /* Centrar verticalmente para mejor alineación */
  }
  .contacto-details strong {
    font-size: 0.75rem; /* Reducir tamaño de fuente */
  }
}

/* Ajuste adicional para pantallas muy estrechas */
@media (max-width: 320px) {
  .contacto-details strong {
    font-size: 0.7rem; /* Tamaño más pequeño para 320px */
  }
  .contacto-details span {
    font-size: 0.85rem; /* Reducir también el subtítulo */
  }
}

/* ===== REGLAS DEFINITIVAS PARA MÓVILES Y TABLETS ===== */
/* Consolidación de todas las reglas móviles para evitar conflictos */

@media (max-width: 768px) {
  /* MENÚ HAMBURGUESA - Siempre visible en móviles */
  .menu-toggle {
    display: flex !important;
    order: 1; /* Asegurar que esté a la derecha de la marca */
    z-index: 1200; /* Por encima de todo */
    position: relative;
  }

  /* Contenedor de herramientas de navegación */
  .nav-tools {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* MENÚ DESPLEGABLE - Oculto por defecto */
  .nav-list {
    display: none !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background-color: var(--bg-color) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 20px !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
    z-index: 1050 !important;
  }

  /* MENÚ ACTIVO - Visible cuando se activa */
  .nav-list.active {
    display: flex !important;
  }

  .nav-list li {
    margin: 10px 0 !important;
    width: 100%;
  }

  .nav-list a {
    padding: 10px;
    width: 100%;
    text-align: center;
  }

  /* BOTONES DE ACCIÓN - Posicionados a la izquierda del menú hamburguesa */
  .actions {
    display: flex !important;
    align-items: center;
    gap: 10px;
    order: 0; /* A la izquierda del menú hamburguesa */
  }

  /* Botones individuales */
  .actions .icon-btn {
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Botón de idioma - con texto */
  .actions .lang-btn {
    width: auto !important;
    min-width: 45px !important;
    padding: 0 8px !important;
    border-radius: 20px !important;
  }

  /* Texto del botón de idioma visible */
  .lang-btn .btn-text {
    display: inline !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
  }

  /* Ocultar texto del botón de tema */
  #themeBtn .btn-text {
    display: none !important;
  }
}

/* Transiciones suaves para header - aplicar ANTES de los media queries */
.site-header .inner,
.main-nav,
.nav-list,
.actions,
.icon-btn {
  transition: all 0.3s ease-in-out;
}

.nav-list li {
  transition: margin 0.3s ease-in-out;
}

.icon-btn .btn-text {
  transition: opacity 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* Reglas para DESKTOP (pantallas más grandes que 768px) */
@media (min-width: 769px) {
  /* Ocultar menú hamburguesa en desktop */
  .menu-toggle {
    display: none !important;
  }

  /* Mostrar lista de navegación normal en desktop */
  .nav-list {
    display: flex !important;
    flex-direction: row !important;
    position: static !important;
    width: auto !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  .nav-list.active {
    display: flex !important;
  }

  .nav-list li {
    margin: 0 5px !important;
  }

  /* Alinear elementos: menú a la izquierda, acciones (botones) a la derecha */
  .main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
    position: relative;
  }

  .nav-list {
    order: 1;
    flex-wrap: nowrap;
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
    margin-left: 15px;
  }

  .nav-tools {
    order: 2;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .actions {
    position: static !important;
    order: 2;
    display: flex !important;
    align-items: center;
    gap: 10px;
  }

  /* Asegurar que los botones tengan el estilo correcto en desktop */
  .actions .icon-btn {
    width: auto !important;
    height: auto !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
  }

  /* Mostrar texto de TODOS los botones en desktop */
  .icon-btn .btn-text {
    display: inline !important;
  }

  #themeBtn .btn-text,
  #langBtn .btn-text {
    display: inline !important;
  }
}

/* Breakpoint específico para 1024px - Pantallas laptop estándar */
@media (min-width: 769px) and (max-width: 1024px) {
  .site-header .inner {
    padding: 0 20px;
    max-width: 100%;
  }

  .main-nav {
    gap: 8px;
    margin-left: 8px;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .nav-list {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
  }

  .nav-list li {
    margin: 0 3px !important;
  }

  .nav-list li a {
    font-size: 14px;
    padding: 4px 6px;
  }

  .nav-tools {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .actions .icon-btn {
    padding: 3px 6px !important;
    font-size: 12px;
    gap: 3px;
  }
}

/* Breakpoint específico para 1025px-1366px - Pantallas desktop medianas */
@media (min-width: 1025px) and (max-width: 1366px) {
  .site-header .inner {
    padding: 0 30px;
    max-width: 1200px;
  }

  .main-nav {
    gap: 12px;
    margin-left: 10px;
  }

  .nav-list li {
    margin: 0 5px !important;
  }

  .nav-list li a {
    font-size: 15px;
  }

  .nav-tools {
    gap: 8px;
  }

  .actions .icon-btn {
    padding: 5px 10px !important;
    font-size: 14px;
  }
}

/* Breakpoint para pantallas muy grandes 1367px+ - Monitores grandes y 4K */
@media (min-width: 1367px) {
  .site-header .inner {
    padding: 0 40px;
    max-width: 1400px;
  }

  .main-nav {
    gap: 16px;
    margin-left: 15px;
  }

  .nav-list li {
    margin: 0 8px !important;
  }

  .nav-list li a {
    font-size: 16px;
  }

  .nav-tools {
    gap: 12px;
  }

  .actions .icon-btn {
    padding: 6px 12px !important;
    font-size: 15px;
  }

  .actions .icon-btn {
    padding: 8px 15px !important; /* Botones más grandes */
    font-size: 16px; /* Texto más grande */
  }
}

/* === FIXES ESPECÍFICOS PARA RESOLUCIONES PROBLEMÁTICAS === */

/* Fix específico para 1024px exacto */
@media (width: 1024px), (min-width: 1024px) and (max-width: 1024px) {
  .site-header .inner {
    padding: 0 18px !important;
  }
  
  .main-nav {
    gap: 6px !important;
    margin-left: 5px !important;
  }
  
  .nav-list {
    margin-left: 8px !important;
  }
  
  .nav-list li {
    margin: 0 2px !important;
  }
  
  .nav-list li a {
    font-size: 13px !important;
    padding: 3px 4px !important;
  }
  
  .nav-tools {
    gap: 4px !important;
  }
  
  .actions .icon-btn {
    padding: 3px 6px !important;
    font-size: 12px !important;
  }
}

/* Fix específico para 1440px exacto */
@media (width: 1440px), (min-width: 1440px) and (max-width: 1440px) {
  .site-header .inner {
    padding: 0 35px !important;
    max-width: 1300px !important;
  }
  
  .main-nav {
    gap: 14px !important;
    margin-left: 12px !important;
  }
  
  .nav-list {
    margin-left: 15px !important;
  }
  
  .nav-list li {
    margin: 0 6px !important;
  }
  
  .nav-list li a {
    font-size: 15px !important;
  }
  
  .nav-tools {
    gap: 10px !important;
  }
  
  .actions .icon-btn {
    padding: 5px 10px !important;
    font-size: 14px !important;
  }
}

/* === REGLAS DE SEGURIDAD PARA HEADER RESPONSIVE === */
@media (min-width: 769px) {
  /* Prevenir overflow y asegurar visibilidad */
  .site-header {
    overflow: visible !important;
  }
  
  .site-header .inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }
  
  .main-nav {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .nav-list {
    overflow: visible !important;
    white-space: nowrap !important;
    flex: 1 !important;
  }
  
  .nav-list li {
    flex-shrink: 0 !important;
    display: inline-block !important;
  }
  
  .nav-list li a {
    display: block !important;
    white-space: nowrap !important;
  }
  
  .nav-tools {
    flex-shrink: 0 !important;
    min-width: fit-content !important;
  }
  
  .actions {
    flex-shrink: 0 !important;
    min-width: fit-content !important;
    display: flex !important;
  }
  
  .brand {
    flex-shrink: 0 !important;
  }
}

/* === ESTILOS PARA MENSAJES DEL FORMULARIO === */
.form-message {
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

.form-message i {
  font-size: 1.2em;
  flex-shrink: 0;
}

.form-message p {
  margin: 0;
  line-height: 1.4;
}

.form-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.success i {
  color: #28a745;
}

.form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.form-message.error i {
  color: #dc3545;
}

/* Tema oscuro para mensajes */
[data-theme="dark"] .form-message.success {
  background-color: #1e3d2f;
  color: #a7d4b7;
  border-color: #2d5a3d;
}

[data-theme="dark"] .form-message.error {
  background-color: #3d1e22;
  color: #d4a7aa;
  border-color: #5a2d31;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estados del botón de envío */
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}
