body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

:root {
  --bg-hero-a: #183127;
  --bg-hero-b: #0f1f19;
  --bg-resumen: #f6f2e8;
  --bg-territorio: #edf4ef;
  --bg-modelo: #f3efe4;
  --bg-finanzas: #eaf2ec;
  --bg-inversion: #f7f1e3;
  --bg-cronograma: #eef3f7;
  --bg-datos: #f2f0e8;
  --bg-galeria: #f0f4f1;
  --bg-faq: #f4f0e8;
  --bg-contacto: #e9f1ee;
  --bg-footer: #121c18;
  --text-footer: #f1ebdd;
}

body:not(.dark-theme) #resumen {
  background: linear-gradient(180deg, var(--bg-resumen) 0%, #fffaf1 100%) !important;
}

body:not(.dark-theme) #territorio {
  background: linear-gradient(180deg, var(--bg-territorio) 0%, #f7fcf8 100%) !important;
}

body:not(.dark-theme) #modelo {
  background: linear-gradient(180deg, var(--bg-modelo) 0%, #fcf8ef 100%) !important;
}

body:not(.dark-theme) #finanzas {
  background: linear-gradient(180deg, var(--bg-finanzas) 0%, #f7fcf9 100%) !important;
}

body:not(.dark-theme) #inversion {
  background: linear-gradient(180deg, var(--bg-inversion) 0%, #fff9ed 100%) !important;
}

body:not(.dark-theme) #cronograma {
  background: linear-gradient(180deg, var(--bg-cronograma) 0%, #f8fbff 100%) !important;
}

body:not(.dark-theme) #datos-clave {
  background: linear-gradient(180deg, var(--bg-datos) 0%, #fcfaf4 100%) !important;
}

body:not(.dark-theme) #galeria {
  background: linear-gradient(180deg, var(--bg-galeria) 0%, #f9fcfa 100%) !important;
}

body:not(.dark-theme) #faq {
  background: linear-gradient(180deg, var(--bg-faq) 0%, #fdf9f1 100%) !important;
}

body:not(.dark-theme) #contacto {
  background: linear-gradient(180deg, var(--bg-contacto) 0%, #f5fbf7 100%) !important;
}

body:not(.dark-theme) footer {
  background: var(--bg-footer) !important;
  color: var(--text-footer) !important;
}

body:not(.dark-theme) footer strong,
body:not(.dark-theme) footer p,
body:not(.dark-theme) footer .footer-link {
  color: var(--text-footer) !important;
}

.hero-overlay-custom {
  background:
    linear-gradient(100deg, rgba(6, 17, 13, 0.72) 0%, rgba(11, 31, 24, 0.62) 42%, rgba(9, 28, 21, 0.38) 70%, rgba(9, 24, 18, 0.54) 100%),
    radial-gradient(circle at 18% 30%, rgba(216, 180, 109, 0.22) 0%, rgba(216, 180, 109, 0) 42%);
}

.nav-link,
.mobile-link,
.footer-link {
  color: #1c2a23;
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease, opacity 180ms ease;
}

.mobile-link {
  border-radius: 0.75rem;
  border: 1px solid rgba(18, 40, 32, 0.12);
  background: rgba(255, 255, 255, 0.88);
  padding: 0.8rem 0.95rem;
}

.footer-link {
  color: #2c3d35;
  font-weight: 600;
}

.nav-link:hover,
.mobile-link:hover,
.footer-link:hover {
  color: #0f4b39;
}

.nav-link.is-active {
  color: #0f4b39;
}

.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: rgba(18, 40, 32, 0.08);
  overflow: hidden;
}

.read-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d8b46d 0%, #0f4b39 100%);
  transition: width 120ms linear;
}

.read-progress-label-wrap {
  position: absolute;
  right: 1rem;
  bottom: 0.5rem;
  z-index: 2;
  pointer-events: none;
}

.read-progress-label {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(18, 40, 32, 0.14);
  background: rgba(255, 255, 255, 0.7);
  color: #33443c;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.zone-carousel {
  position: relative;
}

.zone-carousel-track-wrap {
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid rgba(18, 40, 32, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(15, 35, 28, 0.08);
}

.zone-carousel-track {
  display: flex;
  transition: transform 380ms ease;
  will-change: transform;
}

.zone-slide {
  min-width: 100%;
  position: relative;
}

.zone-slide img {
  display: block;
  width: 100%;
  height: clamp(280px, 45vw, 460px);
  object-fit: cover;
  cursor: zoom-in;
}

.zone-slide-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(9, 22, 17, 0.58), rgba(9, 22, 17, 0.76));
  color: #f4f8f5;
  backdrop-filter: blur(4px);
}

.zone-slide-caption strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.zone-slide-caption p {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  line-height: 1.3;
}

.zone-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 37, 29, 0.66);
  color: #ffffff;
  font-size: 1.7rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.zone-carousel-btn:hover {
  background: rgba(12, 37, 29, 0.82);
}

.zone-carousel-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(15, 75, 57, 0.22);
}

.zone-carousel-btn.prev {
  left: 0.75rem;
}

.zone-carousel-btn.next {
  right: 0.75rem;
}

.zone-carousel-dots {
  margin-top: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
}

.zone-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(18, 40, 32, 0.26);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.zone-carousel-dot.is-active {
  background: #0f4b39;
  transform: scale(1.15);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  background: rgba(6, 12, 10, 0.92);
  padding: clamp(0.8rem, 2vw, 1.6rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.image-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox img {
  position: relative;
  z-index: 1;
  width: min(96vw, 1500px);
  height: min(92vh, 1100px);
  object-fit: contain;
  border-radius: 0.8rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  transform: translate(var(--lx, 0px), var(--ly, 0px)) scale(var(--ls, 0.96));
  transform-origin: center center;
  transition: transform 220ms ease;
  user-select: none;
  cursor: grab;
}

.image-lightbox.is-open img {
  --ls: 1;
}

.image-lightbox img.is-zoomed {
  cursor: grab;
}

.image-lightbox img.is-dragging {
  cursor: grabbing;
  transition: none;
}

.image-lightbox-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.image-lightbox-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(216, 180, 109, 0.4);
}

#menuButton {
  border-color: rgba(18, 40, 32, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 244, 238, 0.88));
  box-shadow: 0 6px 20px rgba(15, 35, 28, 0.08);
}

#menuButton:hover {
  border-color: rgba(15, 75, 57, 0.36);
  background: rgba(255, 255, 255, 0.98);
}

#menuButton:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(15, 75, 57, 0.18);
}

#menuButton[aria-expanded="true"] {
  border-color: rgba(15, 75, 57, 0.45);
  background: rgba(244, 250, 247, 0.96);
}

#mobileMenuShell {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

#mobileMenuShell.is-open {
  opacity: 1;
  pointer-events: auto;
}

#mobileBackdrop {
  opacity: 0;
  transition: opacity 220ms ease;
}

#mobileMenu {
  transform: translateX(20px);
  opacity: 0;
  transition: transform 240ms ease, opacity 240ms ease;
  border-left-color: rgba(18, 40, 32, 0.16);
  background: linear-gradient(180deg, rgba(253, 251, 246, 0.98), rgba(247, 243, 234, 0.98));
}

#mobileMenuShell.is-open #mobileBackdrop {
  opacity: 1;
}

#mobileMenuShell.is-open #mobileMenu {
  transform: translateX(0);
  opacity: 1;
}

#mobileMenu .mobile-link {
  background: rgba(255, 255, 255, 0.84);
}

#mobileMenu .mobile-link:hover,
#mobileMenu .mobile-link:focus-visible {
  border-color: rgba(15, 75, 57, 0.34);
  background: rgba(255, 255, 255, 0.97);
}

.theme-toggle {
  min-height: 44px;
  border: 1px solid rgba(18, 40, 32, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #1c2a23;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0 0.85rem;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.theme-toggle:hover {
  background: #fff;
  border-color: rgba(18, 40, 32, 0.28);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.faq-toggle {
  cursor: pointer;
}

.faq-icon {
  display: inline-grid;
  height: 1.7rem;
  width: 1.7rem;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 75, 57, 0.28);
  font-weight: 700;
  line-height: 1;
}

.faq-toggle[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.chatbot-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1400;
  min-height: 52px;
  min-width: 96px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f4b39, #0c3025);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(12, 41, 31, 0.3);
  transition: opacity 180ms ease, transform 180ms ease;
}

#chatbotToggle[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.chatbot-panel {
  position: fixed;
  right: 1rem;
  bottom: 4.7rem;
  z-index: 1400;
  width: min(94vw, 380px);
  max-height: min(74vh, 580px);
  border: 1px solid rgba(18, 40, 32, 0.16);
  border-radius: 16px;
  background: #fcfbf7;
  box-shadow: 0 20px 45px rgba(10, 26, 20, 0.22);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.chatbot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(18, 40, 32, 0.12);
  background: rgba(15, 75, 57, 0.08);
}

.chatbot-header p {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  color: #476056;
}

.chatbot-close {
  height: 2rem;
  width: 2rem;
  border: 1px solid rgba(18, 40, 32, 0.14);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.chatbot-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chatbot-reset {
  height: 2rem;
  border: 1px solid rgba(18, 40, 32, 0.16);
  border-radius: 10px;
  background: #fff;
  color: #1f342b;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0 0.55rem;
  cursor: pointer;
}

.chatbot-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.chatbot-message {
  max-width: 88%;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.35;
}

.chatbot-message.bot {
  justify-self: start;
  background: #eef5f2;
  color: #22322c;
}

.chatbot-message.user {
  justify-self: end;
  background: #0f4b39;
  color: #fff;
}

.chatbot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  border-top: 1px solid rgba(18, 40, 32, 0.12);
  padding: 0.8rem;
  background: #fff;
}

@media (max-width: 640px) {
  .chatbot-toggle {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .chatbot-panel {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 4.9rem;
    width: auto;
    max-height: min(68vh, 520px);
    border-radius: 14px;
  }

  .chatbot-form input {
    min-width: 0;
  }
}

.chatbot-form input {
  border: 1px solid rgba(18, 40, 32, 0.18);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  outline: none;
}

.chatbot-form input:focus {
  border-color: rgba(15, 75, 57, 0.5);
  box-shadow: 0 0 0 4px rgba(15, 75, 57, 0.1);
}

.chatbot-form button {
  border: none;
  border-radius: 10px;
  padding: 0 0.95rem;
  background: #0f4b39;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.chatbot-suggestions {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.45rem;
  padding: 0 0.8rem 0.8rem;
  scrollbar-width: thin;
}

.chatbot-chip {
  border: 1px solid rgba(15, 75, 57, 0.25);
  border-radius: 999px;
  background: #f4f8f6;
  color: #1f342b;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.chatbot-chip:hover {
  background: #e8f2ee;
}

.chatbot-cta-wrap {
  justify-self: start;
}

.chatbot-cta {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid rgba(15, 75, 57, 0.3);
  background: #e9f6ef;
  color: #145a3f;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
}

.field-hint {
  display: block;
  margin-top: 0.2rem;
}

body.dark-theme {
  background: linear-gradient(180deg, #121b17 0%, #0f1412 100%) !important;
  color: #f5f1e6;
  --dm-text-main: #f5f1e6;
  --dm-text-soft: #dccfb3;
  --dm-text-muted: #c7b99f;
  --dm-accent: #e7c67a;
  --dm-accent-soft: #d8b46d;
  --dm-surface: rgba(30, 34, 31, 0.94);
  --dm-surface-2: rgba(40, 44, 40, 0.96);
  --dm-border: rgba(216, 196, 145, 0.28);
}

body.dark-theme #siteHeader {
  background: rgba(16, 24, 20, 0.86) !important;
  border-color: rgba(190, 214, 202, 0.16) !important;
}

body.dark-theme .read-progress {
  background: rgba(224, 201, 143, 0.16);
}

body.dark-theme .read-progress-bar {
  background: linear-gradient(90deg, #e7c67a 0%, #9fd4bd 100%);
}

body.dark-theme .read-progress-label {
  border-color: rgba(232, 242, 236, 0.22);
  background: rgba(16, 32, 26, 0.62);
  color: #eff8f1;
}

body.dark-theme .zone-carousel-track-wrap {
  border-color: rgba(232, 242, 236, 0.22);
  background: rgba(22, 33, 28, 0.9);
}

body.dark-theme .zone-carousel-dot {
  border-color: rgba(232, 242, 236, 0.3);
  background: rgba(24, 42, 34, 0.85);
}

body.dark-theme .zone-carousel-dot.is-active {
  background: var(--dm-accent);
}

body.dark-theme .zone-carousel-btn {
  border-color: rgba(232, 242, 236, 0.34);
  background: rgba(9, 21, 17, 0.7);
}

body.dark-theme .zone-slide-caption {
  border-color: rgba(232, 242, 236, 0.22);
}

@media (max-width: 820px) {
  .zone-carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.45rem;
  }

  .zone-carousel-btn.prev {
    left: 0.45rem;
  }

  .zone-carousel-btn.next {
    right: 0.45rem;
  }
}

body.dark-theme .nav-link,
body.dark-theme .mobile-link,
body.dark-theme .footer-link,
body.dark-theme .theme-toggle {
  color: var(--dm-text-main);
}

body.dark-theme .theme-toggle {
  background: rgba(24, 35, 29, 0.88);
  border-color: var(--dm-border);
}

body.dark-theme #menuButton {
  background: linear-gradient(180deg, rgba(26, 39, 32, 0.94), rgba(22, 33, 28, 0.94));
  border-color: var(--dm-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

body.dark-theme #menuButton .menu-line {
  background: var(--dm-text-main);
}

body.dark-theme #menuButton[aria-expanded="true"] {
  border-color: var(--dm-accent-soft);
}

body.dark-theme main section {
  background-color: transparent !important;
}

body.dark-theme article,
body.dark-theme aside,
body.dark-theme form,
body.dark-theme .chatbot-panel {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
}

body.dark-theme main,
body.dark-theme footer {
  color: var(--dm-text-main);
}

body.dark-theme [class*="text-\\[\\#1c2a23\\]"] {
  color: var(--dm-text-main) !important;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3 {
  color: #fbf6ea !important;
}

body.dark-theme [class*="text-\\[\\#617067\\]"] {
  color: var(--dm-text-soft) !important;
}

body.dark-theme [class*="text-\\[\\#0f4b39\\]"] {
  color: var(--dm-accent) !important;
}

body.dark-theme [class*="bg-white"] {
  background-color: var(--dm-surface) !important;
}

body.dark-theme [class*="border-\\[rgba(18,40,32,0.12)\\]"] {
  border-color: var(--dm-border) !important;
}

body.dark-theme .chatbot-message.bot {
  background: rgba(64, 56, 43, 0.78);
  color: var(--dm-text-main);
}

body.dark-theme .chatbot-message.user {
  background: #2d6b53;
}

body.dark-theme .chatbot-form,
body.dark-theme .chatbot-header {
  background: var(--dm-surface-2);
}

body.dark-theme .hero-overlay-custom {
  background:
    linear-gradient(105deg, rgba(4, 11, 9, 0.78) 0%, rgba(8, 21, 17, 0.66) 44%, rgba(8, 22, 17, 0.5) 72%, rgba(5, 14, 11, 0.68) 100%),
    radial-gradient(circle at 18% 30%, rgba(170, 210, 183, 0.16) 0%, rgba(170, 210, 183, 0) 42%);
}

body.dark-theme [class*="text-white/80"] {
  color: rgba(245, 238, 224, 0.92) !important;
}

body.dark-theme [class*="text-white/90"] {
  color: rgba(251, 246, 236, 0.96) !important;
}

body.dark-theme [class*="border-white/15"] {
  border-color: rgba(224, 201, 143, 0.34) !important;
}

body.dark-theme [class*="bg-white/10"] {
  background-color: rgba(18, 31, 25, 0.72) !important;
}

body.dark-theme #mobileMenu {
  background: rgba(17, 26, 22, 0.97) !important;
  border-color: var(--dm-border) !important;
}

body.dark-theme #mobileMenu .mobile-link {
  background: rgba(41, 44, 40, 0.9);
  border-color: var(--dm-border);
}

body.dark-theme #mobileThemeToggle,
body.dark-theme #mobileClose {
  background: rgba(41, 44, 40, 0.96);
  border-color: var(--dm-border);
  color: var(--dm-text-main);
}

body.dark-theme #contactForm input,
body.dark-theme #contactForm textarea,
body.dark-theme #finanzas input,
body.dark-theme #finanzas select,
body.dark-theme .chatbot-form input {
  background: rgba(41, 44, 40, 0.94) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-main) !important;
}

body.dark-theme #contactForm input::placeholder,
body.dark-theme #contactForm textarea::placeholder,
body.dark-theme .chatbot-form input::placeholder {
  color: var(--dm-text-muted);
}

body.dark-theme .field-hint {
  color: var(--dm-text-soft) !important;
}

body.dark-theme .chatbot-chip {
  background: rgba(64, 56, 43, 0.7);
  border-color: var(--dm-border);
  color: var(--dm-text-main);
}

body.dark-theme .chatbot-chip:hover {
  background: rgba(87, 75, 57, 0.72);
}

body.dark-theme .chatbot-cta {
  background: rgba(87, 75, 57, 0.78);
  border-color: rgba(224, 201, 143, 0.4);
  color: #f7efd9;
}

body.dark-theme footer {
  border-top-color: rgba(224, 201, 143, 0.2) !important;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
