/* ===========================================================
   components.css — Componentes reutilizables
   (Navbar, Footer, Botones, Cards, Inputs, etc.)
   =========================================================== */

/* ===========================================================
   1. NAVBAR
   =========================================================== */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background-color: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}

.nav.is-scrolled {
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-right: auto;
}

.nav__logo-mark {
  width: 30px;
  height: 30px;
  display: inline-block;
}

.nav__logo-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav__logo-img {
  display: block;
  height: clamp(50px, 4.2vw, 66px);
  width: auto;
  object-fit: contain;
}

.nav__menu {
  display: none;
  align-items: center;
  gap: var(--space-5);
}

@media (min-width: 920px) {
  .nav__menu {
    display: flex;
  }
}

.nav__link {
  position: relative;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  font-weight: 500;
  padding-block: 0.4rem;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-base) var(--ease-out);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--ink);
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__link--pill {
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.nav__link--pill::after { display: none; }

.nav__link--pill:hover,
.nav__link--pill[aria-current="page"] {
  background: var(--citrus);
  color: var(--ink);
  border-color: var(--citrus);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Botón hamburguesa */
.nav__toggle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

@media (min-width: 920px) {
  .nav__toggle {
    display: none;
  }
}

.nav__toggle-bars {
  position: relative;
  width: 18px;
  height: 12px;
}

.nav__toggle-bars::before,
.nav__toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur-base) var(--ease-out),
    top var(--dur-base) var(--ease-out);
}

.nav__toggle-bars::before {
  top: 2px;
}

.nav__toggle-bars::after {
  top: 8px;
}

.nav.is-open .nav__toggle-bars::before {
  top: 5px;
  transform: rotate(45deg);
}

.nav.is-open .nav__toggle-bars::after {
  top: 5px;
  transform: rotate(-45deg);
}

/* Drawer móvil — se mueve a <body> via JS para escapar del stacking context del nav */
.nav__drawer {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background-color: #FAFAF7;
  background: #FAFAF7;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid var(--line);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.25);
  padding: var(--space-6) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  isolation: isolate;
  transition: opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    visibility 0s linear var(--dur-base);
  z-index: 9999;
}

[data-theme="dark"] .nav__drawer {
  background-color: #131312;
  background: #131312;
}

.nav.is-open .nav__drawer,
.nav__drawer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

@media (min-width: 920px) {
  .nav__drawer {
    display: none;
  }
}

.nav__drawer .nav__link {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--ink);
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--line);
}

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.theme-toggle:hover {
  background: var(--bg-alt);
  border-color: var(--line-strong);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle__sun {
  display: block;
}
.theme-toggle__moon {
  display: none;
}
[data-theme="dark"] .theme-toggle__sun {
  display: none;
}
[data-theme="dark"] .theme-toggle__moon {
  display: block;
}

/* ===========================================================
   2. BOTONES
   =========================================================== */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg);
  --btn-bg-hover: #ffc714;
  --btn-fg-hover: var(--ink);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.005em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--radius-pill);
  overflow: hidden;
  isolation: isolate;
  transition: color var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--btn-bg-hover);
  border-radius: 50%;
  width: var(--btn-r, 0px);
  height: var(--btn-r, 0px);
  top: var(--btn-y, 50%);
  left: var(--btn-x, 50%);
  transform: translate(-50%, -50%);
  z-index: -1;
  transition: width var(--dur-slow) var(--ease-out),
    height var(--dur-slow) var(--ease-out);
}

.btn:hover {
  color: var(--btn-fg-hover);
  --btn-r: 360px;
}

.btn:active {
  transform: scale(0.97);
}

.btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bg-hover: var(--ink);
  --btn-fg-hover: var(--bg);
  border: 1px solid var(--line-strong);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bg-hover: var(--bg-alt);
  --btn-fg-hover: var(--ink);
  padding: 0.65rem 1.1rem;
}

.btn--lg {
  padding: 1.15rem 2rem;
  font-size: var(--fs-base);
}

.btn--icon-end .btn__icon {
  transition: transform var(--dur-base) var(--ease-out);
}

.btn:hover .btn__icon {
  transform: translateX(4px);
}

.btn__icon {
  width: 14px;
  height: 14px;
  display: inline-block;
}

/* ===========================================================
   3. FOOTER
   =========================================================== */

.footer {
  background: var(--ink);
  color: #b0b0b0;
  padding-block: var(--space-8) var(--space-5);
  margin-top: var(--space-8);
  position: relative;
  overflow: hidden;
}


[data-theme="dark"] .footer {
  background: #0c0c0b;
}

.footer__top {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: 1fr;
  padding-bottom: var(--space-7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 720px) {
  .footer__top {
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
  }
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 32ch;
  align-self: flex-start;          /* el logo se ancla arriba */
  margin-top: -.25rem;             /* alinea visualmente con la línea de los títulos de columna */
}

.footer__brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  margin-top: 0;
}

.footer__brand-mark svg {
  width: 32px;
  height: 32px;
}

.footer__brand-img {
  display: block;
  height: clamp(70px, 6.5vw, 95px);    /* ↓ de 150-166 px a 70-95 px */
  width: auto;
  object-fit: contain;
}

.footer__tagline {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--fs-sm);
}

.footer__col-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--space-3);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer__list a {
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--fs-sm);
  transition: color var(--dur-fast) var(--ease-out);
}

.footer__list a:hover {
  color: var(--citrus);
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.78);
}

.footer__contact-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--citrus);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-5);
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.footer__bottom a {
  color: inherit;
}

.footer__bottom a:hover {
  color: var(--citrus);
}

.footer__signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 0.9;
  color: rgba(255, 255, 255, 0.05);
  letter-spacing: -0.04em;
  position: absolute;
  right: var(--gutter);
  bottom: -0.15em;
  pointer-events: none;
  user-select: none;
}

/* ===========================================================
   4. CARD GENÉRICA
   =========================================================== */

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

/* ===========================================================
   5. WHATSAPP FLOTANTE
   =========================================================== */

.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  z-index: var(--z-overlay);
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-bounce);
}

.wa-float.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wa-float:hover {
  transform: translateY(-3px) scale(1.05);
}

.wa-float svg {
  width: 26px;
  height: 26px;
}

.wa-float__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25d366;
  z-index: -1;
  animation: wa-pulse 2.4s var(--ease-out) infinite;
}

@keyframes wa-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ===========================================================
   6. ANIMACIONES DE REVEAL (base, JS las activa)
   =========================================================== */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

.animate-on-scroll[data-delay="1"] {
  transition-delay: 80ms;
}
.animate-on-scroll[data-delay="2"] {
  transition-delay: 160ms;
}
.animate-on-scroll[data-delay="3"] {
  transition-delay: 240ms;
}
.animate-on-scroll[data-delay="4"] {
  transition-delay: 320ms;
}

/* ===========================================================
   CURSOR PERSONALIZADO (asterisco del logo)
   =========================================================== */

/* Cursor personalizado DESACTIVADO — se usa el cursor nativo del sistema. */
.cursor {
  display: none !important;
}

.cursor__mark {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  transition: width var(--dur-base) var(--ease-out),
              height var(--dur-base) var(--ease-out);
  filter: drop-shadow(0 2px 6px rgba(26, 26, 26, 0.16));
  pointer-events: none;
}

.cursor__mark svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: cursor-spin 6s linear infinite;
  transform-origin: 50% 50%;
}

@keyframes cursor-spin {
  to { transform: rotate(360deg); }
}

.cursor.is-hover .cursor__mark {
  width: 38px;
  height: 38px;
}

.cursor.is-click .cursor__mark {
  width: 18px;
  height: 18px;
}

.cursor__label {
  position: absolute;
  top: 18px;
  left: 0;
  transform: translateX(-50%) translateY(6px);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.cursor.is-hover .cursor__label[data-text]:not([data-text=""]) {
  opacity: 1;
  transform: translateX(-50%) translateY(16px);
}
