/* ==========================================================================
   HORIZONTE INMOBILIARIA — Caso de éxito | PeakSites
   CSS único: variables base + header + mega menú + menú móvil + footer +
   estilos específicos de la página de caso de éxito.
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

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

/* ===== VARIABLES GLOBALES (marca PeakSites) ===== */
:root {
  --primary: #0a0f2c;
  --accent: #00d4ff;
  --accent2: #0099ff;
  --bg-light: #f8fafd;
  --bg-dark: #0a0f2c;
  --text-light: #1e2937;
  --text-dark: #f1f5f9;
  --text-soft-light: #64748b;
  --text-soft-dark: #94a3b8;
  --card-bg-light: #ffffff;
  --card-bg-dark: rgba(255, 255, 255, 0.06);
  --border-light: #e2e8f0;
  --border-dark: rgba(255, 255, 255, 0.12);

  /* Variables propias del caso de éxito */
  --bg: #f7f6f2;
  --surface: #ffffff;
  --fg: #0b1220;
  --muted: #5b6472;
  --border: #e6e8ec;
  --case-accent: #3b3ce9;
  --text-p: #3f4656;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 20px 45px rgba(15, 23, 42, 0.12);
  --brand-blue: #0b2545;
  --brand-blue-2: #2e7dd7;
}

body.dark {
  --bg: #0a0f1c;
  --surface: #121826;
  --fg: #f8f9fa;
  --muted: #a0a9b8;
  --border: #232b3d;
  --case-accent: #6d6eff;
  --text-p: #cbd5e0;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  line-height: 1.7;
  margin: 0;
  padding: 0;
  transition: background 0.3s, color 0.3s;
}

body.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
}

section { padding: 80px 0; }

a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
}

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 0;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}
body.dark .header {
  background: rgba(10, 15, 44, 0.95);
  border-bottom: 1px solid var(--border-dark);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 15px;
}
nav {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  justify-content: flex-end;
}
.desktop-nav {
  flex: 1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}
.nav a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
}
body.dark .nav a { color: #fff; }

/* LOGO + BRAND */
.logo {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.logo:hover { transform: scale(1.05); }

.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: inherit;
}
.brand-name {
  font-weight: 550;
  font-size: 16px;
  letter-spacing: 0px;
  line-height: 1;
  color: inherit;
}
body.dark .brand-name {
  background: linear-gradient(90deg, #ffffff, #a0b8ff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  padding: 12px 14px !important;
  border-radius: 8px;
  transition: background 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  line-height: 1;
}
.nav-link:hover { background: rgba(0, 212, 255, 0.08); }

.chevron {
  font-size: 0.68em;
  transition: transform 0.3s ease;
  position: relative;
  top: -1px;
}

/* ===== MEGA MENÚ ===== */
.nav-item { position: relative; display: inline-block; }

.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 15px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
  pointer-events: none;
  width: 100vw;
}
.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.mega-menu-content {
  background: white;
  border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.22);
  border: 1px solid #e2e8f0;
  margin: 0 auto;
  max-width: 1180px;
  width: 95%;
  padding: 50px 48px;
}
body.dark .mega-menu-content {
  background: #0f1629;
  border-color: rgba(255, 255, 255, 0.09);
}
.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 52px;
}
.mega-column h4 {
  font-size: 14.8px;
  font-weight: 700;
  color: #00d4ff;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.mega-column a {
  display: block;
  padding: 2px 6px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 15.4px;
  line-height: 1.4;
}
.mega-column a:hover { color: #00d4ff; padding-left: 12px; }

@media (max-width: 991px) {
  .mega-menu { display: none !important; }
}

/* ===== TEMA / IDIOMA ===== */
.theme-toggle {
  height: 32px;
  width: 32px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  transition: 0.3s;
  color: var(--primary);
}
body.dark .theme-toggle { border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; }
.theme-toggle:hover { background: rgba(0, 212, 255, 0.08); }

.lang-switch { position: relative; display: inline-block; margin-left: 12px; z-index: 100; }
.lang-current {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #0f1629;
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.2s ease !important;
}
.lang-current:hover {
  background: #1a2338 !important;
  border: 2px solid #00d4ff !important;
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.25), 0 6px 20px rgba(0, 212, 255, 0.45) !important;
}
.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #1f252f;
  border: 1px solid #444;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: none;
  min-width: 180px;
  padding: 8px 0;
  z-index: 9999;
}
.lang-switch:hover .lang-menu { display: block; }
.flag-wrapper { display: inline-flex; padding: 2px; background: transparent; border: none; }
.lang-current img, .lang-option img { width: 26px; height: 17px; object-fit: cover; border-radius: 3px; }
.arrow { font-size: 19px; line-height: 1; color: #ffffff; }
.lang-option { display: flex; align-items: center; gap: 10px; padding: 10px 18px; color: #eee; text-decoration: none; font-size: 15px; }
.lang-option:hover { background: #2a323f; }

body:not(.dark) .header .lang-current {
  background: #ffffff !important;
  color: #0a0f2c !important;
  box-shadow: 0 8px 25px rgba(10, 15, 44, 0.08) !important;
}
body:not(.dark) .header .lang-current .arrow { color: #0a0f2c !important; }
body:not(.dark) .lang-current:hover,
body:not(.dark) .lang-switch:hover .lang-current {
  border: 2px solid #00d4ff !important;
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.2), 0 10px 30px rgba(0, 212, 255, 0.35) !important;
}
body:not(.dark) .lang-menu {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 15px 40px rgba(10, 15, 44, 0.1) !important;
  padding: 6px 0 !important;
}
body:not(.dark) .lang-menu .lang-option { color: #1e2937 !important; font-weight: 500 !important; }
body:not(.dark) .lang-menu .lang-option:hover { background: #f1f5f9 !important; color: #0099ff !important; }

/* ===== MENÚ MÓVIL CORREGIDO ===== */
.mobile-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: none;
  justify-content: flex-end;
}

.mobile-menu.active { 
  display: flex; 
}

.mobile-menu-links {
  position: relative; /* Cambiado de fixed a relative para respetar el flex del padre */
  width: 82vw;
  max-width: 300px;
  height: 100%;
  padding: 80px 25px 40px 30px;
  background: #0a0f2c;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.close-menu-btn {
  position: absolute; /* Posicionado relativo al panel lateral */
  top: 18px;
  right: 18px;
  font-size: 28px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  z-index: 10;
}

.mobile-link {
  display: block;
  color: #fff !important; /* Forzar visibilidad del texto */
  font-size: 1.1rem;
  padding: 16px 0;
  text-align: left;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.mobile-link:last-child { border-bottom: none; }
.mobile-link:active { background: rgba(0, 212, 255, 0.12); }

.mobile-lang-container {
  margin-top: 35px;
  padding-top: 25px;
  border-top: 1px solid rgba(128, 128, 128, 0.15);
  display: flex;
  justify-content: center;
}
.mobile-lang-switch { position: relative; width: 100%; max-width: 200px; }
.mobile-lang-switch .lang-current {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; background: rgba(128, 128, 128, 0.08); border-radius: 10px;
  font-weight: 600; font-size: 1rem; cursor: pointer; transition: background 0.3s ease;
}
.mobile-lang-switch .arrow { font-size: 0.8rem; transition: transform 0.3s ease; }
.mobile-lang-switch.active .arrow { transform: rotate(180deg); }
.mobile-lang-switch .lang-menu {
  display: none; background: rgba(128, 128, 128, 0.05); border-radius: 10px;
  margin-top: 8px; overflow: hidden; border: 1px solid rgba(128, 128, 128, 0.1);
  position: static; box-shadow: none;
}
.mobile-lang-switch.active .lang-menu { display: block; }
.mobile-lang-switch .lang-option {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  color: #fff; text-decoration: none; font-size: 0.95rem; font-weight: 500;
  transition: background 0.2s ease;
}
.mobile-lang-switch .lang-option:not(:last-child) { border-bottom: 1px solid rgba(128, 128, 128, 0.08); }
.mobile-lang-switch .lang-option:hover { background: rgba(128, 128, 128, 0.12); }
.mobile-lang-switch .flag-wrapper { display: inline-flex; align-items: center; width: 20px; }
.mobile-lang-switch .flag-wrapper img { width: 100%; height: auto; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

@media (max-width: 991px) {
  .desktop-nav, .nav-right, .header .lang-switch { display: none !important; }
  .mobile-menu-btn { display: block; }
}
@media (min-width: 992px) {
  .mobile-menu, .mobile-menu-btn, .mobile-theme-btn { display: none !important; }
}

/* ==========================================================================
   ANIMACIONES SUAVES (scroll reveal)
   ========================================================================== */
.fade-up, .fade-left, .fade-right {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.fade-up.visible, .fade-left.visible, .fade-right.visible { opacity: 1; transform: translateY(0); }
.fade-left { transform: translateX(-60px); }
.fade-right { transform: translateX(60px); }
.fade-up.delay { transition-delay: 0.1s; }
.fade-up.delay2 { transition-delay: 0.2s; }
.fade-up.delay3 { transition-delay: 0.3s; }

/* ==========================================================================
   CASO DE ÉXITO — HERO
   ========================================================================== */
.case-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
}
.case-hero h1 { margin-bottom: 20px; line-height: 1.2; color: var(--fg); }
.case-hero .lead { max-width: 700px; margin: 0 auto; color: var(--muted); }

.services-banner {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 24px;
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  margin-bottom: 40px;
  color: var(--fg) !important;
}
.service-item { font-weight: 600; display: flex; gap: 10px; align-items: center; color: var(--fg) !important; }

@media (max-width: 768px) {
  .services-banner { flex-direction: column; align-items: center; gap: 15px; padding: 20px; }
}

/* ===== LAYOUT DEL CASO ===== */
.case-grid { display: block; max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.case-main { width: 100%; }
.case-main > section { margin: 0 0 64px; }
.case-main h2 { font-size: 1.75rem; letter-spacing: -0.01em; margin: 0 0 20px; font-weight: 600; color: var(--fg); }
.case-main h3 { font-size: 1.05rem; margin: 0 0 8px; font-weight: 600; }
.case-main p { margin: 0 0 16px; color: var(--text-p); }

.link-arrow {
  color: var(--case-accent); font-weight: 600; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  text-decoration: none;
}
.link-arrow:hover { text-decoration: underline; }

/* ===== FIGURAS / CAPTURAS ===== */
.case-figure {
  margin: 28px 0 8px; border-radius: var(--radius-lg); overflow: hidden;
  position: relative; box-shadow: var(--shadow-md);
}
.case-figure img { width: 100%; height: auto; display: block; }
.case-figure.dark { background: linear-gradient(135deg, #0a1226, #12244a); min-height: 280px; }
.case-figure.dark img { opacity: 0.95; }
body.dark .case-figure.dark { background: linear-gradient(135deg, #0b1220, #182440); }

.case-figure.brand {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-2));
  padding: 64px 24px; min-height: 420px;
  display: flex; align-items: center; justify-content: center; position: relative;
}

.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li { padding: 6px 14px; font-size: 0.8rem; color: var(--fg); border: 1px solid var(--border); background: var(--surface); border-radius: 8px; }
.tag-list.floating { position: absolute; left: 24px; bottom: 20px; }
.tag-list.floating li { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #e8ecff; }

/* ===== GRID DE CARACTERÍSTICAS ===== */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 28px 0 8px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.feature .check {
  width: 32px; height: 32px; border-radius: 8px; background: #eee9ff; color: #5b4bff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px;
}
.feature p { color: var(--muted); font-size: 0.95rem; margin: 0; }

@media (max-width: 980px) { .feature-grid { grid-template-columns: 1fr; } }

/* ===== ACORDEÓN "¿POR QUÉ ESTE DISEÑO?" ===== */
.strategy-section { margin: 64px 0; }
.section-intro { margin-bottom: 24px; color: var(--muted); }
.accordion-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 12px; padding: 16px; cursor: pointer;
}
.accordion-item summary { font-weight: 600; outline: none; list-style: none; color: var(--fg); }
.accordion-item summary::after { content: '▾'; float: right; color: var(--brand-blue-2); }
.accordion-item[open] summary::after { content: '▴'; }

.tech-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.card {
  background: var(--surface); padding: 30px; border-radius: 16px;
  border: 1px solid var(--border); transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { border-color: var(--case-accent); transform: translateY(-4px); }
.card h4 { color: var(--fg); margin-bottom: 12px; font-size: 1.1rem; }
.card p { color: var(--muted); font-size: 0.95rem; line-height: 1.6; margin: 0; }

@media (max-width: 768px) { .tech-cards { grid-template-columns: 1fr; } }

/* ===== MOCK FORM (SOLICITAR PRESUPUESTO) ===== */
.mock-form {
  width: min(420px, 100%); background: var(--surface); border-radius: 12px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15); display: flex; flex-direction: column;
}
.mock-form__title { font-size: 0.72rem; letter-spacing: 0.14em; color: var(--muted); margin: 0 0 18px; font-weight: 600; text-transform: uppercase; }
.mock-field { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; }
.mock-field label { font-size: 0.7rem; color: var(--muted); margin-bottom: 2px; }
.mock-field input { background: transparent; border: none; color: var(--fg); font-size: 0.95rem; padding: 0; outline: none; width: 100%; }
.mock-cta {
  background: var(--case-accent); color: #fff; text-align: center; padding: 12px; border-radius: 8px;
  font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer; transition: opacity 0.2s;
}
.mock-cta:hover { opacity: 0.9; }

/* ===== RESULTADO ===== */
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-sm); }
.result-card hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0 16px; }

/* ===== CTA FINAL ===== */
.cta-section { padding: 100px 20px; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.cta-container { max-width: 700px; margin: 0 auto; }
.cta-title { font-size: 2.5rem; line-height: 1.1; margin-bottom: 20px; letter-spacing: -0.03em; color: var(--fg); }
.cta-subtitle { font-size: 1.15rem; color: var(--muted); margin-bottom: 40px; line-height: 1.6; }
.cta-button {
  display: inline-flex; align-items: center; background: var(--case-accent); color: #fff;
  padding: 18px 36px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 1.05rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta-button:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(59, 60, 233, 0.25); }

@media (max-width: 640px) {
  .cta-section { padding: 60px 20px; }
  .cta-title { font-size: 1.85rem; }
  .cta-subtitle { font-size: 1rem; margin-bottom: 30px; }
  .cta-button { width: 100%; justify-content: center; }
}
@media (max-width: 980px) {
  .case-grid { gap: 32px; }
  .case-hero h1 { font-size: 2rem; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer-pro {
  background: #080b14;
  color: #aaa;
  padding: 80px 0px 40px;
  margin: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 40px;
  margin-bottom: 50px;
}
.footer-pro h4 { color: white; margin-bottom: 15px; font-size: 14px; }
.footer-pro a { display: block; text-decoration: none; color: #888; font-size: 14px; margin-bottom: 10px; transition: 0.3s; }
.footer-pro a:hover { color: #00d4ff; }
.footer-bottom { border-top: 1px solid #222; padding-top: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }

body:not(.dark) .footer-pro { background: #f8fafd !important; color: #475569 !important; }
body:not(.dark) .footer-pro h4 { color: #1e2937 !important; }
body:not(.dark) .footer-pro a { color: #64748b !important; }
body:not(.dark) .footer-pro a:hover { color: #0f172a !important; }
body:not(.dark) .footer-bottom { border-top-color: #e2e8f0 !important; color: #64748b !important; }

@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 35px !important; }
  .footer-pro { padding: 60px 20px 40px !important; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}


/* ==========================================================================
   RESULTADO — Corrección Modo Claro (Fondo y Texto Blanco con contraste)
   ========================================================================== */
body:not(.dark) .result-card {
  background: #ffffff !important; /* Fondo en blanco en modo claro */
  border-color: var(--border-light) !important;
}

/* Si necesitas que el texto sea blanco, requiere una capa oscura o sombra legible, 
   pero si te refieres a que el texto se vea perfectamente nítido y legible en el fondo blanco: */
body:not(.dark) .result-card h2,
body:not(.dark) .result-card h3,
body:not(.dark) .result-card h4 {
  color: #0a0f2c !important; /* Títulos oscuros de alta visibilidad sobre fondo blanco */
}

body:not(.dark) .result-card p,
body:not(.dark) .result-card li,
body:not(.dark) .result-card span {
  color: #1e2937 !important; /* Texto principal perfectamente legible en modo claro */
}