@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; color: #1a1a2e; }

.hero-bg {
  background: linear-gradient(135deg, rgba(15,23,42,0.85), rgba(30,58,95,0.8)),
    url('/images/hero-exterior.webp') center/cover;
  min-height: 100vh;
}

.section-divider {
  height: 4px;
  background: linear-gradient(90deg, #c9a96e, #e8d5a3, #c9a96e);
}

.gold-gradient { background: linear-gradient(135deg, #c9a96e, #b8860b); }
.gold-text { color: #c9a96e; }
.navy-bg { background-color: #0f172a; }
.navy-text { color: #0f172a; }

.btn-gold {
  background: linear-gradient(135deg, #c9a96e, #b8860b);
  color: white;
  padding: 16px 40px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(201,169,110,0.4); }

.btn-outline-gold {
  border: 2px solid #c9a96e;
  color: #c9a96e;
  padding: 14px 36px;
  border-radius: 8px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-outline-gold:hover { background: #c9a96e; color: white; }

.feature-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}
.feature-card:hover { transform: translateY(-4px); }

.stat-card {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  border-radius: 16px;
  padding: 32px;
  color: white;
  text-align: center;
}

.calc-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.calc-input:focus { outline: none; border-color: #c9a96e; }

.form-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: white;
}
.form-input:focus { outline: none; border-color: #c9a96e; box-shadow: 0 0 0 3px rgba(201,169,110,0.15); }

select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' fill='none' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }

.animate-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s, transform 0.6s;
}
.animate-fade-up.visible { opacity: 1; transform: translateY(0); }

.floating { animation: floating 3s ease-in-out infinite; }
@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 4/3;
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-grid a:hover img { transform: scale(1.05); }
.gallery-grid a:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 101;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid a:first-child { grid-column: span 2; grid-row: span 1; }
}

/* Admin styles */
.admin-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.admin-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}
.admin-input:focus { outline: none; border-color: #c9a96e; }

.admin-btn {
  background: #0f172a;
  color: white;
  padding: 10px 24px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.admin-btn:hover { background: #1e3a5f; }

.leads-table { width: 100%; border-collapse: collapse; }
.leads-table th { background: #f8fafc; padding: 12px; text-align: left; font-size: 0.85rem; color: #64748b; text-transform: uppercase; }
.leads-table td { padding: 12px; border-top: 1px solid #e2e8f0; font-size: 0.9rem; }
.leads-table tr:hover td { background: #f8fafc; }

/* Scroll smooth */
html { scroll-behavior: smooth; }

/* Mobile hamburger menu */
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-menu-btn span { display: block; width: 24px; height: 2px; background: #0f172a; margin: 6px 0; transition: all 0.3s; }
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: white;
  padding: 16px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  z-index: 49;
  flex-direction: column;
  gap: 12px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 10px 0; font-size: 1rem; font-weight: 500; color: #374151; border-bottom: 1px solid #f3f4f6; text-decoration: none; }

/* Mobile card comparison tables */
.mobile-compare-card { display: none; }

/* Responsive */
@media (max-width: 768px) {
  .hero-bg { min-height: 90vh; }
  .btn-gold { padding: 14px 28px; font-size: 1rem; }
  .mobile-menu-btn { display: block; }

  /* Reduce section padding on mobile */
  section.py-20 { padding-top: 3rem; padding-bottom: 3rem; }
  section.py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

  /* Nav CTA smaller on mobile */
  nav .btn-gold { padding: 8px 14px !important; font-size: 0.75rem !important; }

  /* Hero stats */
  .hero-bg .flex-wrap.gap-8 { gap: 1rem; }
  .hero-bg .flex-wrap.gap-8 > div { flex: 1 1 40%; }

  /* Stat cards grid 2 cols */
  .stat-card { padding: 20px; }

  /* Tables: horizontal scroll hint */
  .overflow-x-auto { -webkit-overflow-scrolling: touch; }
  .overflow-x-auto table { min-width: 600px; }

  /* Comparativa inversiones: show cards instead of table on mobile */
  .desktop-compare-table { display: none; }
  .mobile-compare-card { display: block; }

  /* Map smaller on mobile */
  .map-container iframe { height: 280px !important; }

  /* Location grid 2 cols on mobile */
  .location-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Feature cards less padding */
  .feature-card { padding: 20px; }

  /* Comparativa MX vs US less padding */
  .compare-country { padding: 20px !important; }
}

/* ============ MURO DE VIDEO ============ */
/* Con el muro activo el fondo no debe poder scrollearse. */
body.gate-locked { overflow: hidden; }
#gated-content.gate-hidden { display: none; }

.video-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 16px 40px;
  background: linear-gradient(160deg, #0b1524 0%, #12263f 100%);
}
.video-gate-inner { width: 100%; max-width: 860px; text-align: center; }

.video-gate-eyebrow {
  color: #c9a55c;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.video-gate-title {
  color: #fff;
  font-size: clamp(1.6rem, 4.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
}
.video-gate-sub {
  color: rgba(255, 255, 255, 0.62);
  font-size: 1rem;
  max-width: 620px;
  margin: 0 auto 26px;
  line-height: 1.5;
}

.video-gate-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.video-gate-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-gate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(6, 14, 25, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.video-gate-overlay.hidden { opacity: 0; pointer-events: none; }

.video-gate-play {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: #c9a55c;
  color: #0b1524;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.video-gate-play:hover { transform: scale(1.07); }
.video-gate-play-label {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

.video-gate-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.video-gate-progress-track {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.video-gate-progress-bar {
  height: 100%;
  width: 0;
  background: #c9a55c;
  transition: width 0.25s linear;
}
.video-gate-progress-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: right;
}
.video-gate-notice {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  margin-top: 12px;
}

@media (max-width: 640px) {
  .video-gate { padding: 76px 12px 28px; min-height: 100svh; }
  .video-gate-play { width: 64px; height: 64px; }
}

/* ============ FORMULARIO CORTO DEL HERO ============ */
/* La conversion principal, arriba del pliegue. */
.hero-form {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 24px;
  max-width: 520px;
}
.hero-form-title {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.hero-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.hero-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  /* 16px es el minimo que evita que Safari en iPhone haga zoom al enfocar. */
  font-size: 16px;
}
.hero-form input::placeholder { color: rgba(255, 255, 255, 0.45); }
.hero-form input:focus {
  outline: none;
  border-color: rgba(201, 165, 92, 0.7);
}
.hero-form-note {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  text-align: center;
  margin-top: 10px;
}
@media (max-width: 640px) {
  .hero-form-row { grid-template-columns: 1fr; }
  .hero-form { padding: 18px; }
}

/* ============ WHATSAPP FLOTANTE Y CTA PEGAJOSO ============ */
.wa-float {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease;
}
.wa-float:hover { transform: scale(1.06); }

/* El CTA pegajoso es solo movil: en escritorio el formulario del hero
   se alcanza sin problema. */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(8px);
  display: none;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta-btn {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 10px;
  background: #c9a55c;
  color: #0f172a;
  font-weight: 700;
  font-size: 1rem;
}
@media (max-width: 768px) {
  .sticky-cta { display: block; }
  .wa-float { bottom: 84px; width: 52px; height: 52px; }
}
