/* ============================================================
   MARCO DEV — ESTILOS GLOBALES
   Estrategia: usar SOLO variables CSS y clases custom.
   Tailwind sólo para layout/spacing. Sin mezclar propiedades
   conflictivas entre ambos sistemas.
   ============================================================ */

/* ── RESET / BASE ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: auto;
}

/* ── VARIABLES ────────────────────────────────────────────── */
:root {
  --c-emerald: #10b981;
  --c-blue: #3b82f6;
  --c-bg-900: #0f172a;
  --c-bg-950: #020617;
  --c-border: rgba(59, 130, 246, 0.18);
  --nav-h: 100px;
  --nav-h-sm: 100px;
}

/* ── BODY ─────────────────────────────────────────────────── */
body {
  background-color: var(--c-bg-900);
  color: #f1f5f9;
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}

/* ── SELECTION ────────────────────────────────────────────── */
::selection {
  background: var(--c-emerald);
  color: #fff;
}

/* ── ANCHOR OFFSET — clear fixed navbar ───────────────────── */
section[id],
header[id] {
  scroll-margin-top: var(--nav-h);
}

/* ══════════════════════════════════════════════════════════
   NAVBAR — sin parpadeo, sin línea blanca
   Transparente al inicio en TODAS las páginas.
   Al hacer scroll → fondo sólido ancho (sin reducir altura).
   ══════════════════════════════════════════════════════════ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  /* transparente al inicio — aplica a todas las páginas */
  background: transparent;
  border-bottom: 1px solid transparent;
  /* transición solo para fondo/borde, SIN height — la altura nunca cambia */
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  will-change: background, border-color;
}

/* Estado scrolled — JS añade esta clase — altura NO cambia */
.site-nav.scrolled {
  background: rgba(2, 6, 23, 0.97);
  border-bottom-color: rgba(59, 130, 246, 0.18);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  /* height permanece igual: var(--nav-h) — sin contracción */
}

/* .solid mantiene fondo azul oscuro original */
.site-nav.solid {
  background: rgba(2, 6, 23, 0.97);
  border-bottom-color: rgba(59, 130, 246, 0.18);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.nav-inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
  gap: 0.18rem;
}
.nav-logo-name {
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}
.nav-logo-accent {
  color: var(--c-emerald);
}
.nav-logo-tagline {
  font-family: "Poppins", sans-serif;
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1;
}
.nav-logo-sep {
  color: var(--c-emerald);
}

/* Links desktop */
.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a,
.nav-links button {
  font-family: "Poppins", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f1f5f9;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links button:hover {
  color: var(--c-emerald);
}
.nav-links a.active-page {
  color: var(--c-emerald);
}

/* ── DROPDOWN ────────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

/* Flecha chevron SVG inline — tamaño consistente */
.dropdown-trigger::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 5px;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23f1f5f9' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform 0.2s;
}
.nav-dropdown:hover .dropdown-trigger::after {
  transform: rotate(180deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2310b981' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.dropdown-menu {
  /* Oculto por defecto — se muestra con :hover en .nav-dropdown */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  /* El puente: top cubre el gap entre el trigger y el menú para evitar que el hover se "escape" */
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: rgba(2, 6, 23, 0.99);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 12px;
  padding: 8px 0;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  z-index: 200;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease;
  /* Pseudo-puente para cubrir el gap y evitar que el hover se pierda */
}

/* Triángulo decorativo */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(2, 6, 23, 0.99);
  border-left: 1px solid var(--c-border);
  border-top: 1px solid var(--c-border);
}

/* Puente invisible para que el cursor no "salga" del área hover */
.dropdown-menu::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

/* Mostrar al hover del contenedor */
.nav-dropdown:hover .dropdown-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-family: "Poppins", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e2e8f0;
  text-decoration: none;
  transition:
    color 0.15s,
    background 0.15s;
  white-space: nowrap;
}
.dropdown-menu a:hover {
  color: var(--c-emerald);
  background: rgba(16, 185, 129, 0.08);
}
.dropdown-menu a + a {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── HAMBURGER ────────────────────────────────────────────── */
.nav-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  font-size: 1.15rem;
  transition:
    background 0.2s,
    border-color 0.2s;
  flex-shrink: 0;
}
.nav-hamburger:hover {
  border-color: var(--c-emerald);
  background: rgba(16, 185, 129, 0.08);
}
/* Ocultar hamburger en desktop (≥1024px) */
@media (min-width: 1024px) {
  .nav-hamburger {
    display: none;
  }
}
/* Mostrar hamburger en mobile/tablet (<1024px) */
@media (max-width: 1023px) {
  .nav-hamburger {
    display: flex;
  }
}

/* ── NAV LINKS — solo en desktop ─────────────────────────── */
@media (max-width: 1023px) {
  .nav-links {
    display: none !important;
  }
}
@media (min-width: 1024px) {
  .nav-links {
    display: flex !important;
  }
}

/* ── MOBILE MENU — panel desplegable vertical tipo dropdown ─ */
/*
   Aparece debajo del botón hamburguesa, alineado a la derecha,
   con ancho fijo (no full-width). Animación suave de entrada.
*/
.mobile-menu {
  /* Oculto por defecto con visibilidad + opacidad para animar */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);

  position: fixed;
  top: calc(var(--nav-h) + 8px);
  right: 20px; /* alineado a la derecha */
  left: auto; /* NO full-width */
  width: min(280px, calc(100vw - 40px)); /* max 280px, con margen */

  background: rgba(2, 6, 23, 0.99);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 16px;
  padding: 10px 0;
  z-index: 99;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04);

  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s;
}
.mobile-menu.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ── Links principales del menú móvil ──────────────────── */
.mobile-menu a,
.mobile-menu-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f1f5f9; /* blanco — igual que desktop */
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition:
    color 0.18s,
    background 0.18s;
  box-sizing: border-box;
}
.mobile-menu a:last-of-type {
  border-bottom: none;
}
.mobile-menu a:hover,
.mobile-menu-btn:hover {
  color: var(--c-emerald);
  background: rgba(16, 185, 129, 0.06);
}

/* ── Fila toggle "Inicio" con chevron ─────────────────── */
.mobile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 20px;
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f1f5f9;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition:
    color 0.18s,
    background 0.18s;
  box-sizing: border-box;
}
.mobile-toggle-row:hover {
  color: var(--c-emerald);
  background: rgba(16, 185, 129, 0.06);
}
.mobile-toggle-row.open {
  color: var(--c-emerald);
}

/* Chevron SVG en mobile */
.chevron-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23f1f5f9' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform 0.2s;
}
.mobile-toggle-row.open .chevron-icon {
  transform: rotate(180deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2310b981' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ── Submenú móvil (Inicio → Historia, Skills…) ──────── */
.mobile-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mobile-sub.open {
  max-height: 240px; /* suficiente para 4 items */
}
.mobile-sub a {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 10px 32px !important; /* indentado */
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: #cbd5e1 !important; /* gris claro — visible */
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  letter-spacing: 0.08em !important;
  background: none !important;
}
.mobile-sub a:last-child {
  border-bottom: none !important;
}
.mobile-sub a::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-emerald);
  opacity: 0.5;
  flex-shrink: 0;
}
.mobile-sub a:hover {
  color: var(--c-emerald) !important;
  background: rgba(16, 185, 129, 0.06) !important;
}
.mobile-sub a:hover::before {
  opacity: 1;
}

/* ── Overlay oscuro al abrir el menú móvil ───────────── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mobile-overlay.open {
  display: block;
}

/* ══════════════════════════════════════════════════════════
   CARRUSEL
   ══════════════════════════════════════════════════════════ */
.carousel-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.carousel-item.active {
  opacity: 1;
  z-index: 1;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition:
    width 0.3s,
    background 0.3s;
  border: none;
}
.carousel-dot.active {
  background: var(--c-emerald);
  width: 32px;
}



/* ══════════════════════════════════════════════════════════
   TIPOGRAFÍA
   ══════════════════════════════════════════════════════════ */
.title-font {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.mono {
  font-family: "Courier New", monospace;
}

/* ══════════════════════════════════════════════════════════
   SKILL BARS
   ══════════════════════════════════════════════════════════ */
#form-status {
  transition: all 0.3s ease;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#submit-btn:disabled {
  filter: grayscale(0.5);
}

/* ══════════════════════════════════════════════════════════
   PORTAFOLIO CARDS
   ══════════════════════════════════════════════════════════ */
.portfolio-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.4);
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    transform 0.3s;
}
.portfolio-card:hover {
  transform: translateY(-3px);
}
.portfolio-card--blue:hover {
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 16px 36px rgba(59, 130, 246, 0.12);
}
.portfolio-card--emerald:hover {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 16px 36px rgba(16, 185, 129, 0.12);
}
.portfolio-card--purple:hover {
  border-color: rgba(196, 181, 253, 0.35);
  box-shadow: 0 16px 36px rgba(168, 85, 247, 0.12);
}
.portfolio-card--yellow:hover {
  border-color: rgba(253, 224, 71, 0.35);
  box-shadow: 0 16px 36px rgba(234, 179, 8, 0.12);
}
.portfolio-card--cyan:hover {
  border-color: rgba(103, 232, 249, 0.35);
  box-shadow: 0 16px 36px rgba(6, 182, 212, 0.12);
}

/* ══════════════════════════════════════════════════════════
   TECH ICON CARDS (stack section)
   ══════════════════════════════════════════════════════════ */
.tech-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: #1e293b;
  border-radius: 14px;
  border: 1px solid #334155;
  width: 76px;
  cursor: default;
  transition:
    border-color 0.25s,
    transform 0.25s;
}
.tech-card:hover {
  transform: translateY(-3px) scale(1.05);
}
.tech-card svg {
  width: 32px;
  height: 32px;
}
.tech-card span {
  font-size: 0.65rem;
  color: #64748b;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════════════════
   COOKIES BANNER — BOTTOM SLIDE
   ══════════════════════════════════════════════════════════ */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: rgba(2, 6, 23, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
#cookie-banner.show {
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════
   PAGE HERO (páginas sin carrusel)
   ══════════════════════════════════════════════════════════ */
.page-hero {
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 64px;
  background: linear-gradient(135deg, #020617 0%, #0f172a 60%, #1e293b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 60% 50% at 80% 50%,
      rgba(59, 130, 246, 0.08) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 60% at 10% 80%,
      rgba(16, 185, 129, 0.06) 0%,
      transparent 60%
    );
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   HERO (index) — padding-top para evitar que el nav tape el contenido
   NO en index ya que el hero es full-height
   ══════════════════════════════════════════════════════════ */
.hero-full {
  height: 100dvh; /* usa dvh para evitar barra móvil */
  min-height: 600px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   FLOATING BUTTONS
   ══════════════════════════════════════════════════════════ */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 9990;
}
.fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition:
    transform 0.2s,
    opacity 0.3s;
  text-decoration: none;
}
.fab-btn:hover {
  transform: scale(1.12);
}
.fab-wa {
  background: #22c55e;
}
.fab-top {
  background: var(--c-blue);
  opacity: 0;
  pointer-events: none;
}
.fab-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Tooltip WhatsApp */
.fab-tooltip {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.fab-wa-wrap:hover .fab-tooltip {
  opacity: 1;
}
.fab-wa-wrap {
  position: relative;
}

/* ══════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════ */
.cert-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.cert-modal.open {
  display: flex;
}
.cert-modal img {
  max-width: 900px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  object-fit: contain;
}

/* Responsive para tablets y dispositivos móviles */
@media (max-width: 1024px) {
  .cert-modal {
    padding: 16px;
  }
  .cert-modal img {
    max-width: 95vw;
    max-height: 85vh;
  }
}

/* Responsive para móviles pequeños */
@media (max-width: 640px) {
  .cert-modal {
    padding: 12px;
  }
  .cert-modal img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
  }
}

/* Responsive para móviles muy pequeños */
@media (max-width: 480px) {
  .cert-modal {
    padding: 8px;
    align-items: flex-start;
    justify-content: center;
    padding-top: 16px;
  }
  .cert-modal img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
  }
}

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--c-bg-950);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-family: "Poppins", sans-serif;
}



/* ══════════════════════════════════════════════════════════
   SERVICIOS — cards
   ══════════════════════════════════════════════════════════ */
.service-card {
  border: 1px solid #334155;
  border-radius: 24px;
  background: #0f172a;
  padding: 2rem;
  transition:
    border-color 0.3s,
    transform 0.3s,
    box-shadow 0.3s;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ══════════════════════════════════════════════════════════
   CATÁLOGO
   ══════════════════════════════════════════════════════════ */
.catalog-card {
  border: 1px solid #334155;
  border-radius: 20px;
  background: #0f172a;
  overflow: hidden;
  transition:
    border-color 0.3s,
    transform 0.3s,
    box-shadow 0.3s;
}
.catalog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* ── Vista previa (botón outline en cards de catálogo) ── */
.preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border-radius: 10px;
  padding: 10px;
  font-family: "Poppins", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

/* ── Modal de Vista Previa (mockup ilustrativo) ── */
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.preview-modal.open {
  display: flex;
}
.preview-box {
  position: relative;
  max-width: 820px;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.preview-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.preview-browser {
  background: #0b1220;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}
.preview-browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.preview-url {
  flex: 1;
  background: #0f172a;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: "SFMono-Regular", Menlo, monospace;
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-body {
  padding: 0;
  min-height: 420px;
  height: 65vh;
  max-height: 70vh;
  overflow: hidden;
  position: relative;
}
.preview-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #0b1220;
}
.preview-body::-webkit-scrollbar {
  width: 5px;
}
.preview-body::-webkit-scrollbar-track {
  background: transparent;
}
.preview-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
}
.preview-caption {
  text-align: center;
  margin-top: 18px;
  flex-shrink: 0;
}
.preview-caption h4 {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 4px;
}
.preview-caption .preview-tag-label {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 10px;
}
.preview-note {
  font-size: 0.75rem;
  color: #64748b;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .preview-body {
    padding: 18px;
  }
  .preview-modal {
    padding: 12px;
  }
}

/* ══════════════════════════════════════════════════════════
   CONTACT FORM
   ══════════════════════════════════════════════════════════ */
.form-input {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 18px;
  color: #f1f5f9;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--c-emerald);
}

/* Estilos específicos para selects */
select.form-input {
  appearance: none;
  cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2310b981' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  background-color: #1e293b;
  padding-right: 42px;
}
select.form-input:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2316a34a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border-color: #475569;
}
select.form-input:focus {
  border-color: var(--c-emerald);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2310b981' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select.form-input option {
  background: #1e293b;
  color: #f1f5f9;
  padding: 8px;
}
select.form-input optgroup {
  background: #0f172a;
  color: #94a3b8;
  font-weight: 600;
  padding: 4px 0;
}

/* ── CUSTOM SELECT DROPDOWN ─────────────────────────────── */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 18px;
  color: #f1f5f9;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2310b981' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  box-sizing: border-box;
}

.custom-select-trigger:hover {
  border-color: #475569;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2316a34a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.custom-select-trigger:focus {
  border-color: var(--c-emerald);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2310b981' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.custom-select-trigger.open {
  border-color: var(--c-emerald);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 5l5-5 5 5' stroke='%2310b981' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.custom-select-options.open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.custom-select-option {
  padding: 12px 18px;
  color: #f1f5f9;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background-color: rgba(16, 185, 129, 0.15);
}

.custom-select-option.selected {
  background-color: rgba(16, 185, 129, 0.25);
  color: var(--c-emerald);
  font-weight: 500;
}

.custom-select-optgroup {
  padding: 8px 18px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #0f172a;
  cursor: default;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-select-optgroup:hover {
  background: #0f172a;
}

.custom-select-options::-webkit-scrollbar {
  width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.form-label {
  font-family: "Poppins", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #475569;
  display: block;
  margin-bottom: 6px;
}

/* ══════════════════════════════════════════════════════════
   IA — ESTILO TECHNOVA (glass + ai-glow + gradient)
   ══════════════════════════════════════════════════════════ */

/* Clases base TechNova */
.tn-glass {
  background: rgba(15, 23, 42, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.tn-gradient-text {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tn-gradient-bg {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}
.tn-ai-glow {
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.25);
  border: 1px solid rgba(14, 165, 233, 0.35) !important;
}
.tn-loader {
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top: 2px solid #0ea5e9;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: tn-spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes tn-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.tn-custom-scroll::-webkit-scrollbar {
  width: 5px;
}
.tn-custom-scroll::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 10px;
}

/* ── Botón IA en navbar ────────────────────────────────── */
.ai-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  font-family: "Poppins", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0ea5e9;
  background: transparent;
  border: 1px solid rgba(14, 165, 233, 0.5);
  border-radius: 14px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  white-space: nowrap;
  position: relative;
}
.ai-nav-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  color: #38bdf8;
}
/* Punto pulsante */
.ai-btn-dot {
  width: 7px;
  height: 7px;
  background: #0ea5e9;
  border-radius: 50%;
  animation: tn-pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes tn-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.6);
    opacity: 0.4;
  }
}

/* ── Widget chat flotante — exacto TechNova ────────────── */
#ai-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  overflow: hidden;
}
#ai-chat-widget.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  pointer-events: none;
}

.ai-chat-inner {
  height: 490px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  width: 100%;
}

/* Header gradiente azul */
.ai-chat-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.ai-chat-avatar {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}
.ai-chat-name {
  font-family: "Poppins", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.ai-chat-status {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 3px;
}
.ai-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.9rem;
  transition:
    background 0.2s,
    color 0.2s;
}
.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Área de mensajes */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
}
/* Burbuja bot */
.ai-msg-bot-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.82rem;
  color: #cbd5e1;
  max-width: 85%;
  line-height: 1.5;
  font-family: "Inter", sans-serif;
}
/* Burbuja usuario */
.ai-msg-user-bubble {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.2);
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.82rem;
  color: #e2e8f0;
  max-width: 85%;
  margin-left: auto;
  line-height: 1.5;
  font-family: "Inter", sans-serif;
}
/* Loader burbuja */
.ai-msg-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 85%;
  font-size: 0.8rem;
  color: #64748b;
  font-family: "Inter", sans-serif;
}

/* Input row */
.ai-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.ai-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  color: #f1f5f9;
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}
.ai-chat-input:focus {
  border-color: #0ea5e9;
}
.ai-chat-input::placeholder {
  color: #475569;
}
.ai-chat-send {
  background: #0ea5e9;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-chat-send:hover {
  background: #38bdf8;
}
.ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Quick chips */
.ai-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 2px;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
.ai-chip {
  padding: 4px 11px;
  font-size: 0.68rem;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  white-space: nowrap;
}
.ai-chip:hover {
  background: #0ea5e9;
  color: #fff;
}

/* FAB se oculta cuando el chat está abierto */
.fab-container.hidden-by-chat {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

@media (max-width: 640px) {
  #ai-chat-widget {
    width: 80vw;
    max-width: 360px;
    left: auto;
    right: 20px;
    bottom: 90px;
    max-height: calc(100vh - 140px);
  }

  .ai-chat-inner {
    height: 450px;
    max-height: calc(100vh - 140px);
    border-radius: 20px;
  }

  .ai-chat-messages {
    padding: 12px;
  }

  .ai-msg-bot-bubble,
  .ai-msg-user-bubble,
  .ai-msg-loading {
    max-width: 90%;
    font-size: 0.78rem;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  #ai-chat-widget {
    width: 78vw;
    max-width: 320px;
    left: auto;
    right: 20px;
    bottom: 80px;
    max-height: calc(100vh - 130px);
  }

  .ai-chat-inner {
    height: auto;
    max-height: calc(100vh - 130px);
    border-radius: 16px;
  }

  .ai-chat-header {
    padding: 12px;
    flex-shrink: 0;
  }

  .ai-chat-name {
    font-size: 0.75rem;
  }

  .ai-chat-messages {
    padding: 10px;
    gap: 8px;
    max-height: calc(100vh - 210px);
    overflow-y: auto;
  }

  .ai-msg-bot-bubble,
  .ai-msg-user-bubble,
  .ai-msg-loading {
    max-width: 92%;
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .ai-chat-input-row {
    padding: 10px;
    gap: 6px;
    flex-shrink: 0;
  }

  .ai-chat-input {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .ai-chat-send {
    padding: 8px 10px;
    min-width: 38px;
    flex-shrink: 0;
  }

  .ai-chat-chips {
    padding: 6px 10px 2px;
    gap: 4px;
    flex-shrink: 0;
  }

  .ai-chip {
    padding: 3px 8px;
    font-size: 0.65rem;
  }
}

@media (max-height: 600px) {
  #ai-chat-widget {
    bottom: 70px;
    max-height: calc(100vh - 100px);
  }

  .ai-chat-inner {
    max-height: calc(100vh - 100px);
  }

  .ai-chat-messages {
    max-height: calc(100vh - 180px);
  }
}

/* Garantizar que el widget no interfiera con menú móvil */
@media (max-width: 1023px) {
  #ai-chat-widget {
    z-index: 350;
  }
  .mobile-menu.open {
    z-index: 401;
  }
  .mobile-overlay.open {
    z-index: 400;
  }
}

/* ══════════════════════════════════════════════════════════
   FOOTER — Iconos de Redes Sociales (tamaño aumentado)
   ══════════════════════════════════════════════════════════ */
.footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 1.6rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-social-icon:hover {
  color: #fff;
  transform: translateY(-3px);
}

@media (max-width: 480px) {
  .footer-social-icon {
    font-size: 1.7rem;
  }
}

/* ══════════════════════════════════════════════════════════
   CATÁLOGO — Filtros y tarjetas
   ══════════════════════════════════════════════════════════ */
.filter-btn {
  font-family: "Poppins", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid #334155;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: all 0.22s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--c-emerald);
  color: #0f172a;
  border-color: var(--c-emerald);
}
.catalog-item {
  transition:
    opacity 0.35s,
    transform 0.35s;
}
.catalog-item.hidden-item {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}



/* ── Anti-flicker safety net ─────────────────────────────
   Si JS falla antes de restaurar opacity, el navegador
   revela la página en 0.5s como máximo.
   ──────────────────────────────────────────────────────── */
html {
  animation: md-reveal 0s 0.5s forwards;
}
@keyframes md-reveal {
  to { opacity: 1 !important; }
}

/* ── PAGE TRANSITION OVERLAY ────────────────────────────── */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--c-bg-950);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.page-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── LENIS OVERRIDES ────────────────────────────────────── */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* ── BLUR-UP LAZY LOADING ───────────────────────────────── */
.blur-up {
  filter: blur(10px);
  transition: filter 0.6s ease;
}
.blur-up.loaded {
  filter: blur(0);
}

/* Legibilidad del asistente y contenido flexible en pantallas pequeñas. */
.ai-chat-messages { min-height: 0; }
.ai-chat-input { font-size: 16px; }
.ai-msg-user-bubble, .ai-msg-bot-bubble { font-size: 14px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .page-transition-overlay { transition-duration: 0.01ms; } }
