:root {
  --bg-main: #ffffff;
  --accent: #06b6d4;
  --accent-soft: rgba(6, 182, 212, 0.12);
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-soft: rgba(17, 24, 39, 0.08);
  --transition-fast: 200ms ease-out;
  --transition-med: 350ms ease-out;
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
}

body {
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 0 0, rgba(6, 182, 212, 0.05), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.04), transparent 40%),
    var(--bg-main);
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Multi idioma */
.lang-es,
.lang-en {
  display: none;
}

body.lang-es .lang-es {
  display: initial;
}

body.lang-en .lang-en {
  display: initial;
}

/* Layout principal DESKTOP */
.layout {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
}

/* COLUMNA IZQUIERDA */
.left-column {
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 4vw;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: conic-gradient(from 160deg, #06b6d4, #0ea5e9, #6366f1, #06b6d4);
}

.logo-text-main {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.logo-text-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.tagline-pill {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: #f9fafb;
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* (Opcional) Nav + idiomas si lo usas en otras páginas */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  padding-bottom: 2px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  width: 100%;
}

.lang-switch {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.lang-btn {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--border-soft);
  background: #f9fafb;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.lang-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.35);
  transform: translateY(-1px);
}

/* Secciones de texto */
.scroll-container {
  margin-top: 0;
}

.section {
  min-height: 100vh;
  padding: 96px 4vw 96px;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.85;
  transform: translateY(8px);
  transition: opacity var(--transition-med), transform var(--transition-med);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.section.active {
  opacity: 1;
  transform: translateY(0);
}

.section::before {
  content: attr(data-label);
  position: absolute;
  top: 64px;
  left: 4vw;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(0, 0, 0, 0.35);
}

.section::after {
  content: "";
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  position: absolute;
  bottom: 80px;
  left: 4vw;
}

.section-kicker {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-main);
}

.section-title strong {
  color: var(--accent);
}

/* Textos justificados */
.section-highlight,
.section-body {
  text-align: justify;
  text-justify: inter-word;
}

.section-highlight {
  max-width: 820px;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.section-body {
  max-width: 820px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Chips y botones */
.section-footer {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-muted);
}

.chip-accent {
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent);
  border-color: rgba(6, 182, 212, 0.5);
}

/* Botón animado */
.btn-xio {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  padding: 8px 20px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.btn-xio::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.5), transparent 55%),
    linear-gradient(90deg, #06b6d4, #0ea5e9);
  transform: translateX(-100%);
  transition: transform 300ms ease-out;
  z-index: -1;
}

.btn-xio:hover::before {
  transform: translateX(0);
}

.btn-xio:hover {
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(6, 182, 212, 0.35);
}

.btn-xio:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.25);
}

/* COLUMNA DERECHA: PANEL VISUAL DESKTOP */
.right-column {
  position: relative;
}

.visual-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  padding-right: 4vw;
  display: flex;
  flex-direction: column;
}

.panel-inner {
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

/* IMÁGENES AJUSTADAS */
.panel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transform: none;
  transition: opacity 450ms ease;
  will-change: opacity;
}

.panel-image.visible {
  opacity: 1;
}

/* overlay */
.panel-gradient-edge {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent 40%),
    radial-gradient(circle at 10% 0, rgba(0, 0, 0, 0.4), transparent 55%);
}

.panel-overlay {
  position: absolute;
  inset: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.panel-tag {
  padding: 4px 12px;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.panel-caption-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
}

.panel-caption-text {
  font-size: 0.9rem;
  color: #e5e7eb;
}

/* Dots / panel footer */
.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.panel-dot-row {
  display: flex;
  gap: 6px;
}

.panel-dot {
  width: 7px;
  height: 7px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.panel-dot.active {
  background: var(--accent);
  transform: scale(1.35);
}

.panel-mini {
  font-size: 0.75rem;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-muted);
}

.panel-mini .strong {
  font-weight: 600;
  color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: #f9fafb;
  padding: 32px 4vw 20px;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) repeat(2, minmax(0, 1.3fr)) minmax(0, 2fr);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.footer-col h3,
.footer-col h4 {
  margin-bottom: 10px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-main);
}

.footer-col p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 6px;
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-meta {
  font-size: 0.8rem;
}

/* =========================
   BLOQUES DE IMAGEN PARA MÓVIL
   ========================= */
.section-image-block {
  display: none;
}

@keyframes mobileSlideInRight {
  from {
    transform: translateX(10%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* =========================
   RESPONSIVE
   ========================= */

/* Tablets / portátiles pequeños */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1.1fr 1fr;
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* MÓVIL / TABLET VERTICAL */
@media (max-width: 860px) {
  html,
  body {
    scroll-snap-type: y proximity;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  /* Ocultamos la columna derecha clásica en móvil */
  .right-column {
    display: none;
  }

  /* Header compacto */
  .site-header {
    flex-wrap: wrap;
    justify-content: space-between;
    padding-inline: 5vw;
  }

  .tagline-pill {
    font-size: 0.64rem;
    padding-inline: 10px;
  }

  .logo-text-main {
    font-size: 0.85rem;
  }

  .logo-text-sub {
    font-size: 0.68rem;
  }

  /* Asegurar que el menú hamburguesa esté a la derecha */
  .header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  /* Ocultar los botones de idioma del header en móvil */
  .lang-switch {
    display: none !important;
  }
  
  /* Ajustar logo para móvil */
  .logo {
    min-width: auto;
  }

  /* =====================================
     BLOQUES DE IMAGEN EN MÓVIL - SOLUCIÓN SIMPLIFICADA
     ===================================== */
  .section-image-block {
    display: block;
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 480px;
    scroll-snap-align: start;
    overflow: hidden;
    background: #000;
    /* Configuración base para ambos LTR y RTL */
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
  }

  .section-image-block img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    animation: mobileSlideIn 0.5s ease-out;
  }

  /* =========================
     CONFIGURACIÓN ESPECÍFICA PARA LTR (ESPAÑOL/INGLÉS)
     ========================= */
  body:not([dir="rtl"]) .section-image-block {
    /* Para LTR, mantenemos el comportamiento original */
    transform: none;
  }

  /* =========================
     CONFIGURACIÓN ESPECÍFICA PARA RTL (ÁRABE) 
     ========================= */
  body[dir="rtl"] .section-image-block {
    /* Reset completo para RTL */
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    transform: none !important;
  }

  body[dir="rtl"] .section-image-block img {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
  }

  /* =========================
     SOLUCIÓN DEFINITIVA PARA EL MARGEN EN RTL
     ========================= */
  body[dir="rtl"] {
    direction: rtl;
    overflow-x: hidden !important;
  }

  body[dir="rtl"] .layout,
  body[dir="rtl"] .left-column,
  body[dir="rtl"] .scroll-container {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
  }

  /* TEXTO: bloques con margen lateral suave */
  .section {
    min-height: auto;
    padding: 60px 6vw 70px;
    scroll-snap-align: start;
  }

  .section::before {
    left: 6vw;
    top: 40px;
  }

  .section::after {
    left: 6vw;
    bottom: 50px;
    width: 64px;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .section-highlight,
  .section-body {
    font-size: 0.92rem;
  }

  .section-footer {
    gap: 8px;
  }

  .chip {
    font-size: 0.72rem;
  }
}

/* Móviles medianos */
@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding-inline: 6vw;
  }

  .panel-mini {
    font-size: 0.72rem;
  }
}

/* Móviles pequeños */
@media (max-width: 560px) {
  .section {
    padding: 56px 6vw 64px;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .section-highlight,
  .section-body {
    font-size: 0.88rem;
  }

  .panel-caption-title {
    font-size: 1rem;
  }

  .panel-caption-text {
    font-size: 0.78rem;
  }

  .panel-mini {
    font-size: 0.7rem;
  }
}

/* ===========================
   MENU MODERNO
   =========================== */

.logo-link {
  text-decoration: none;
  color: inherit;
}

.site-header {
  gap: 14px;
}

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

/* Botón hamburguesa */
.menu-toggle {
  width: 44px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.menu-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.menu-icon {
  width: 18px;
  height: 2px;
  background: var(--text-main);
  display: block;
  position: relative;
  border-radius: 999px;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text-main);
  border-radius: 999px;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

/* Desktop nav */
.main-nav {
  gap: 12px;
  align-items: center;
}

.main-nav .nav-link {
  padding: 6px 0;
}

/* ===========================
   MOBILE DRAWER
   =========================== */

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.44);
  backdrop-filter: blur(6px);
  z-index: 60;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(92vw, 420px);
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  border-left: 1px solid var(--border-soft);
  box-shadow: -40px 0 80px rgba(2, 6, 23, 0.18);
  z-index: 70;
  transform: translateX(104%);
  transition: transform 320ms ease;
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-close {
  width: 44px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #fff;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.drawer-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.10);
}

.mobile-nav {
  padding: 14px 16px 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-main);
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
  font-weight: 600;
}

.mobile-link:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.22);
  transform: translateY(-1px);
}

.mobile-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 10px 2px;
}

.mobile-cta {
  margin-top: 10px;
  display: block;
  text-decoration: none;
  text-align: center;
  padding: 12px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #0ea5e9);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 34px rgba(6, 182, 212, 0.22);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.mobile-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 46px rgba(6, 182, 212, 0.28);
}

.mobile-lang {
  margin-top: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 12px;
  background: rgba(249, 250, 251, 0.85);
}

.mobile-lang-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.mobile-lang-buttons {
  display: flex;
  gap: 8px;
}

/* Active state para menú */
.nav-link.active,
.mobile-link.active {
  color: var(--accent);
}

.mobile-link.active {
  background: rgba(6, 182, 212, 0.10);
  border-color: rgba(6, 182, 212, 0.25);
}

/* ===========================
   RESPONSIVE: show drawer toggle
   =========================== */

@media (max-width: 1024px) {
  .tagline-pill {
    display: none;
  }
}

@media (max-width: 860px) {
  /* ocultamos nav desktop y mostramos hamburguesa */
  .main-nav {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }

  /* header más compacto */
  .site-header {
    padding-inline: 5vw;
  }

  .lang-switch {
    gap: 6px;
  }
}

/* ===========================
   SEARCH PALETTE
   =========================== */

.search-toggle {
  width: 44px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.search-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.search-icon-btn {
  font-size: 18px;
  line-height: 1;
  color: var(--text-main);
  transform: translateY(-1px);
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.46);
  backdrop-filter: blur(8px);
  z-index: 80;
}

.search-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: 14vh 16px 18px;
  z-index: 90;
  pointer-events: none;
}

.search-modal.open {
  pointer-events: auto;
}

.search-box {
  width: min(880px, 92vw);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-soft);
  box-shadow: 0 28px 100px rgba(2, 6, 23, 0.22);
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(circle at 0 0, rgba(6, 182, 212, 0.10), transparent 55%),
    #ffffff;
}

.search-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(6, 182, 212, 0.10);
  border: 1px solid rgba(6, 182, 212, 0.18);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 18px;
  flex: 0 0 auto;
}

#siteSearchInput {
  flex: 1 1 auto;
  border: none;
  outline: none;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  background: transparent;
  padding: 6px 4px;
}

#siteSearchInput::placeholder {
  color: rgba(107, 114, 128, 0.9);
  font-weight: 500;
}

.search-close {
  flex: 0 0 auto;
  border: 1px solid var(--border-soft);
  background: rgba(249, 250, 251, 0.9);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.search-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.10);
}

.search-results {
  max-height: min(46vh, 420px);
  overflow: auto;
  padding: 10px;
}

.search-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
}

.search-item:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.22);
  transform: translateY(-1px);
}

.search-item.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.30);
}

.search-item-badge {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.95);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.06em;
  flex: 0 0 auto;
}

.search-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-item-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.92rem;
}

.search-item-url {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.search-hint {
  padding: 10px 14px 14px;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border-soft);
  background: rgba(249, 250, 251, 0.75);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hint-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.04em;
}

@media (max-width: 860px) {
  .search-modal {
    padding-top: 12vh;
  }
  .search-input-wrap {
    padding: 12px 12px;
  }
  #siteSearchInput {
    font-size: 0.95rem;
  }
}

/* =====================================================
   OVERRIDES FINALES
   ===================================================== */

/* 1) Menú SOLO burger */
.main-nav {
  display: none !important;
}
.menu-toggle {
  display: inline-flex !important;
}

/* 2) Menú SOLO español */
.main-nav .lang-en,
.mobile-nav .lang-en,
.mobile-cta .lang-en {
  display: none !important;
}
.main-nav .lang-es,
.mobile-nav .lang-es,
.mobile-cta .lang-es {
  display: inline !important;
}

/* 3) Imágenes: evitar "parpadeos" / salto de layout */
.panel-inner,
.section-image-block {
  contain: paint;
}

/* ===========================
   FLOATING CONTACT BUTTONS
   =========================== */
@media (max-width: 860px) {
    .floating-contact-buttons {
        position: fixed;
        bottom: 24px;
        right: 20px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: flex-end;
    }

    .floating-email-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.25),
            0 1px 0 rgba(255, 255, 255, 0.1) inset,
            0 -1px 0 rgba(0, 0, 0, 0.5) inset;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-decoration: none;
        z-index: 1001;
        overflow: hidden;
        position: relative;
    }

    .floating-email-btn::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 70%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .floating-email-btn:hover {
        transform: translateY(-3px) scale(1.08);
        box-shadow: 
            0 8px 24px rgba(0, 0, 0, 0.4),
            0 2px 0 rgba(255, 255, 255, 0.15) inset,
            0 -2px 0 rgba(0, 0, 0, 0.6) inset;
        background: linear-gradient(145deg, #222222, #333333);
        border-color: rgba(255, 255, 255, 0.18);
    }

    .floating-email-btn:hover::before {
        opacity: 1;
    }

    .floating-email-btn:active {
        transform: translateY(-1px) scale(1.05);
        box-shadow: 
            0 4px 16px rgba(0, 0, 0, 0.3),
            0 1px 0 rgba(255, 255, 255, 0.1) inset;
    }

    .floating-email-btn i {
        color: rgba(255, 255, 255, 0.9);
        font-size: 22px;
        filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
    }

    .floating-whatsapp-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.25),
            0 1px 0 rgba(255, 255, 255, 0.1) inset,
            0 -1px 0 rgba(0, 0, 0, 0.5) inset;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-decoration: none;
        z-index: 1000;
        overflow: hidden;
        position: relative;
    }

    .floating-whatsapp-btn::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 70%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .floating-whatsapp-btn:hover {
        transform: translateY(-3px) scale(1.08);
        box-shadow: 
            0 8px 24px rgba(0, 0, 0, 0.4),
            0 2px 0 rgba(255, 255, 255, 0.15) inset,
            0 -2px 0 rgba(0, 0, 0, 0.6) inset;
        background: linear-gradient(145deg, #222222, #333333);
        border-color: rgba(255, 255, 255, 0.18);
    }

    .floating-whatsapp-btn:hover::before {
        opacity: 1;
    }

    .floating-whatsapp-btn:active {
        transform: translateY(-1px) scale(1.05);
        box-shadow: 
            0 4px 16px rgba(0, 0, 0, 0.3),
            0 1px 0 rgba(255, 255, 255, 0.1) inset;
    }

    .floating-whatsapp-btn i {
        color: rgba(255, 255, 255, 0.9);
        font-size: 26px;
        filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
    }

    .floating-btn-tooltip {
        position: absolute;
        right: 68px;
        background: rgba(17, 24, 39, 0.95);
        color: rgba(255, 255, 255, 0.95);
        padding: 8px 16px;
        border-radius: 10px;
        font-size: 0.8rem;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        transform: translateX(10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        pointer-events: none;
        backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    .floating-email-btn:hover .floating-btn-tooltip,
    .floating-whatsapp-btn:hover .floating-btn-tooltip {
        opacity: 1;
        transform: translateX(0);
    }

    .floating-btn-tooltip::after {
        content: '';
        position: absolute;
        top: 50%;
        right: -6px;
        transform: translateY(-50%);
        border-left: 6px solid rgba(17, 24, 39, 0.95);
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
    }

    @media (max-width: 480px) {
        .floating-contact-buttons {
            bottom: 20px;
            right: 16px;
            gap: 14px;
        }
        
        .floating-email-btn,
        .floating-whatsapp-btn {
            width: 52px;
            height: 52px;
        }
        
        .floating-email-btn i {
            font-size: 20px;
        }
        
        .floating-whatsapp-btn i {
            font-size: 24px;
        }
        
        .floating-btn-tooltip {
            font-size: 0.75rem;
            padding: 7px 14px;
            right: 62px;
        }
    }

    @media (max-width: 380px) {
        .floating-contact-buttons {
            bottom: 18px;
            right: 14px;
            gap: 12px;
        }
        
        .floating-email-btn,
        .floating-whatsapp-btn {
            width: 48px;
            height: 48px;
        }
        
        .floating-email-btn i {
            font-size: 18px;
        }
        
        .floating-whatsapp-btn i {
            font-size: 22px;
        }
        
        .floating-btn-tooltip {
            right: 58px;
            padding: 6px 12px;
        }
    }

    @keyframes floatInBlack {
        from {
            opacity: 0;
            transform: translateY(15px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .floating-email-btn {
        animation: floatInBlack 0.5s ease-out 0.2s both;
    }

    .floating-whatsapp-btn {
        animation: floatInBlack 0.5s ease-out 0.4s both;
    }
}

/* Ocultar en desktop */
@media (min-width: 861px) {
    .floating-contact-buttons {
        display: none !important;
    }
}

/* =========================
   ANIMACIÓN PARA IMÁGENES MÓVILES
   ========================= */
@keyframes mobileSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   FIX ESPECÍFICO: LTR necesita left: 50% y margin-left: -50vw
   ========================= */
@media (max-width: 860px) {
  body:not([dir="rtl"]) .section-image-block {
    left: 50%;
    margin-left: -50vw;
    width: 100vw;
  }

  /* RTL mantiene el reset completo */
  body[dir="rtl"] .section-image-block {
    left: 0 !important;
    margin-left: 0 !important;
  }
}

/* =========================
   FIX PARA iOS SAFARI RTL
   ========================= */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 860px) {
    body[dir="rtl"] .section-image-block {
      -webkit-overflow-scrolling: touch;
    }
    
    body[dir="rtl"] .section-image-block img {
      -webkit-transform: translateZ(0);
    }
  }
}
/* =========================
   FOOTER FIJO PARA ESCRITORIO
   ========================= */

/* Footer fijo solo en desktop */
@media (min-width: 861px) {
  .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 12px 4vw;
    background: rgba(249, 250, 251, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-soft);
    border-bottom: none;
  }
  
  .footer-fixed-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  .footer-separator {
    color: var(--border-soft);
    margin: 0 4px;
  }
  
  .footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
    white-space: nowrap;
  }
  
  .footer-link:hover {
    color: var(--accent);
  }
  
  .footer-email, .footer-tel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    transition: color var(--transition-fast);
  }
  
  .footer-email:hover, .footer-tel:hover {
    color: var(--accent);
  }
  
  /* Asegurar que el contenido no se solape con el footer */
  .layout {
    padding-bottom: 60px;
  }
}

/* En móvil, mantener el footer normal */
@media (max-width: 860px) {
  .footer-fixed-content {
    display: none;
  }
  
  .site-footer {
    position: static;
    margin-top: auto;
  }
}

/* FIX: que el menú burger en móvil no corte los botones de idioma */
@media (max-width: 860px) {
  .mobile-drawer {
    /* Mejor que 100vh en móviles modernos (iOS/Chrome con barras dinámicas) */
    height: 100dvh;
    max-height: 100dvh;
  }

  .mobile-nav {
    /* Hace que esta zona sea la que scrollea dentro del drawer */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    /* Evita que el contenido toque/corte la zona inferior (safe area) */
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

.footer-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-size: 0.75rem;
  opacity: 0.85;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}


/* =========================
   MOBILE FOOTER (END OF SCROLL)
   ========================= */

/* By default, hide the mobile footer */
.site-footer-mobile {
  display: none;
}

/* Show it only on mobile/tablet vertical */
@media (max-width: 860px) {
  .site-footer-mobile {
    display: block;
    position: static;
    border-top: 1px solid var(--border-soft);
    background: #f9fafb;
    padding: 18px 6vw 22px;
    margin-top: 10px;
  }

  .footer-mobile-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
  }

  .footer-mobile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .footer-mobile-row .footer-link {
    white-space: nowrap;
  }

  /* IMPORTANT:
     Keep desktop fixed footer hidden on mobile (you already do this),
     but do NOT hide the mobile footer. */
  .site-footer:not(.site-footer-mobile) .footer-fixed-content {
    display: none !important;
  }
}


/* =========================
   FOOTERS: Desktop fixed vs Mobile end-of-scroll
   ========================= */

/* Default: hide the mobile end-of-scroll footer on desktop */
.site-footer-mobile {
  display: none !important;
}

/* Mobile: show the mobile footer and hide the fixed desktop footer content */
@media (max-width: 860px) {
  .site-footer-mobile {
    display: block !important;
  }

  /* Hide the fixed desktop footer (but keep the mobile one visible) */
  .site-footer:not(.site-footer-mobile) .footer-fixed-content {
    display: none !important;
  }
}
