/* ============================================= */
/* ========= ESTILOS GLOBALES Y BASE =========== */
/* ============================================= */
:root {
  --brand: #3b517e;
  --gold: #c5a47e;
  --muted: #6b768a;
  --bg: #f7f8fa;
}

body {
  font-family: 'Lexend', sans-serif;
  margin: 0;
  background: var(--bg);
  color: #333;
}

/* Evita el scroll del fondo cuando el menú está abierto */
body.nav-open {
  overflow: hidden;
}


/* ============================================= */
/* ============ HEADER Y NAVEGACIÓN ============ */
/* ============================================= */

.fixed-logo {
  position: fixed;
  top: 30px;
  left: 40px;
  z-index: 1003;
}

.fixed-logo img {
  height: 40px;
}

.main-header {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 1002; /* CORRECCIÓN: Aumentado a 1002 para estar sobre el logo */
  display: flex;
  justify-content: flex-end;
  transition: transform 0.3s ease-out; /* Animación para ocultar/mostrar */
}

.main-header.nav-hidden {
    transform: translateY(-120%);
}

.nav-wrapper {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.main-nav a {
  color: #333;
  text-decoration: none;
  margin: 0 12px;
  position: relative;
  padding: 6px 0;
  font-weight: 600;
}

.main-nav a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: var(--gold);
}

.cta-button {
  background: var(--gold); /* CAMBIO: Color dorado por defecto */
  color: #fff;
  border: none;
  border-radius: 50px; /* CAMBIO: Bordes totalmente redondeados para forma de píldora */
  padding: 10px 22px; /* Ajuste de padding para que se vea mejor */
  font-weight: 600; /* CAMBIO: Peso de fuente como en tu ejemplo */
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease; /* AÑADIDO: Transición suave */
}

.cta-button:hover {
  background: var(--brand); /* CAMBIO: Azul oscuro al pasar el ratón */
  transform: scale(1.05); /* AÑADIDO: Pequeño efecto de escala como en tu ejemplo */
}

/* --- Botón de Hamburguesa (Oculto por defecto en escritorio) --- */
.mobile-nav-toggle {
  display: none; /* CORRECCIÓN: Oculto en escritorio */
  position: relative;
  z-index: 1001;
  background: transparent;
  border: 0;
  padding: 0.5em;
  cursor: pointer;
  width: 28px;
  height: 20px;
}

.mobile-nav-toggle .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.mobile-nav-toggle::before,
.mobile-nav-toggle::after {
  content: '';
  position: absolute;
  left: 0;
  width: 28px;
  height: 3px;
  background: var(--brand); /* Color de las líneas */
  border-radius: 2px;
  transition: transform 0.3s ease-out, top 0.3s ease-out;
}

.mobile-nav-toggle::before { top: 6px; }
.mobile-nav-toggle::after { top: -6px; }

/* Transforma la hamburguesa en 'X' cuando el menú está abierto */
body.nav-open .mobile-nav-toggle::before { transform: rotate(45deg); top: 0; }
body.nav-open .mobile-nav-toggle::after { transform: rotate(-45deg); top: 0; }


/* ============================================= */
/* ================== HERO ===================== */
/* ============================================= */
.page-hero {
  position: relative;
  height: 44vh;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  animation: kenburns 20s ease-out infinite;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(26, 42, 74, .55));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 0 16px;
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  text-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  margin: 0 0 8px;
}

.hero-subtitle { opacity: .95; }

@keyframes kenburns {
  0% { transform: scale(1.06) }
  100% { transform: scale(1) }
}


/* ============================================= */
/* ============== CONTENIDO PÁGINA ============= */
/* ============================================= */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 90px 20px;
}

.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
}

/* --- Tarjeta de Ubicación (Versión con foto de fondo) --- */
.location-card {
  position: relative;
  border-radius: 18px;
  padding: 22px;
  background: #eef4fb;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .08);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  color: #fff; /* Texto blanco por defecto para contraste con la foto */
}

.location-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .12);
}

.location-card.has-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: center/cover no-repeat var(--card-img);
  filter: brightness(.55);
  transform: scale(1.02);
  transition: filter .25s ease, transform .25s ease;
  z-index: 1;
}

.location-card.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .10) 0%, rgba(0, 0, 0, .45) 55%);
  z-index: 1;
}

.location-card.has-photo:hover::before {
  filter: brightness(.62);
  transform: scale(1.04);
}

.location-card > * {
  position: relative;
  z-index: 2; /* Contenido por encima de la foto */
}

.icon-wrap {
  min-width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-grid; /* Para que esté en línea con el texto */
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #2a3d6b);
  box-shadow: 0 8px 22px rgba(26, 42, 74, .35);
  margin-bottom: 12px;
}

.card-body h3 {
  margin: 0 0 6px;
  font-weight: 700;
  line-height: 1.25;
}

.card-body .address {
  margin: 0 0 14px;
}

.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 16px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .12);
  transition: transform .2s ease, background .2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #b39169;
}


/* ============================================= */
/* ============= PRE-FOOTER Y FOOTER =========== */
/* ============================================= */
.pre-footer {
  background: #f5f6f7;
  padding: 70px 20px;
  display: flex;
  justify-content: center;
}

.pre-footer-content {
  max-width: 900px;
  text-align: center;
}

.cta-button-footer {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  padding: 12px 22px;
  border-radius: 10px;
}

.cta-button-footer:hover {
  background: #b39169;
}

.main-footer-container {
  background: #1a2a4a;
  color: #e7edf7;
  padding: 26px 20px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  opacity: .9;
}


/* ============================================= */
/* =============== ANIMACIONES ================= */
/* ============================================= */
.hidden-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}

.hidden-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden-hero-text {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s ease .4s, transform 1s ease .4s;
}

.hidden-hero-text.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================= */
/* ================= RESPONSIVE ================ */
/* ============================================= */

/* --- Tablets (hasta 992px) --- */
@media (max-width: 992px) {
  .locations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-container {
    padding: 70px 20px;
  }
}

/* --- Móviles Grandes y Tablets Verticales (hasta 768px) --- */
@media (max-width: 768px) {
  /* --- Header para móvil --- */
  .fixed-logo { top: 20px; left: 20px; }
  .fixed-logo img { height: 35px; }
  .main-header { padding: 15px 20px; top: 0; left: 0; right: 0; }
  
  .nav-wrapper {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%; /* Ocupa todo el ancho para empujar el botón a la derecha */
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Empuja el botón a la derecha */
  }

  /* --- Botón de Hamburguesa --- */
  .mobile-nav-toggle {
    display: block;
    width: 28px;
    height: 20px;
  }
  .mobile-nav-toggle::before,
  .mobile-nav-toggle::after {
      background: #fff;
  }
  body.nav-open .mobile-nav-toggle::before,
  body.nav-open .mobile-nav-toggle::after {
      background: #fff;
  }

  /* --- Panel de Navegación Abierto (Estilo Correcto) --- */
  .main-nav {
    position: fixed;
    z-index: 1000;
    inset: 0 0 0 30%; /* Ocupa del 30% a la derecha */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem; /* Espacio vertical correcto */
    padding: min(20vh, 10rem) 2em;
    background: rgba(26, 42, 74, 0.98); /* Azul --brand con opacidad */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateX(100%);
    transition: transform 0.4s ease-out;
  }
  
  body.nav-open .main-nav {
    transform: translateX(0%);
  }
  
  /* --- Enlaces dentro del Panel (Estilo Correcto) --- */
  /* CORRECCIÓN CLAVE: Reseteamos los estilos de escritorio */
  .main-nav a {
      font-size: 1.1rem; 
      color: #fff;
      font-weight: 500;
      text-shadow: none; /* Quitamos la sombra de texto si la hubiera */
      margin: 0; /* ¡¡¡LA REGLA MÁS IMPORTANTE!!! Elimina el margen horizontal */
      padding: 0;  /* Reseteamos el padding */
      position: static; /* Reseteamos la posición */
  }
  .main-nav a:hover::after {
      content: none; /* Quitamos la línea dorada al pasar el ratón */
  }
  
  /* --- Botón CTA dentro del Panel (Estilo Correcto) --- */
  .main-nav .cta-button {
      border: 2px solid var(--gold);
      background-color: transparent;
      color: #fff;
      padding: 10px 24px;
      border-radius: 50px; /* Borde redondeado tipo "píldora" */
      font-size: 1rem; /* Alineamos tamaño de fuente */
      font-weight: 600;
  }
  .main-nav .cta-button:hover {
      background-color: var(--gold);
      color: var(--brand);
  }

  /* --- Ajustes generales para móvil --- */
  .page-hero { min-height: 280px; height: 35vh; }
  .locations-grid { grid-template-columns: 1fr; }
  .page-container { padding: 60px 20px; }
  .pre-footer { padding: 60px 20px; }
  .pre-footer-content h2 { font-size: 1.8rem; }
}

/* --- Móviles Pequeños (hasta 480px) --- */
@media (max-width: 480px) {
  .fixed-logo { top: 15px; left: 15px; }
  .fixed-logo img { height: 30px; }
  .main-header { top: 10px; left: 10px; right: 10px; }

  /* CORRECCIÓN: Eliminados los estilos conflictivos del nav antiguo */
}