/* =========================================================================
   COMPONENTS.CSS — Piezas reutilizables
   (botones, etiquetas, header, formularios, flotantes, lightbox)
   ========================================================================= */

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.4rem;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  font-family: var(--f-body); font-weight: 700; font-size: var(--fs-md);
  line-height: 1.1; text-decoration: none; text-align: center;
  transition: transform .15s var(--ease), background-color .2s, box-shadow .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--sm { padding: .6rem 1rem; font-size: var(--fs-sm); }
.btn--lg { padding: 1rem 1.6rem; font-size: var(--fs-lg); }
.btn--block { width: 100%; }

.btn--primary { background: var(--c-accent); color: var(--c-accent-ink); }
.btn--primary:hover { box-shadow: 0 8px 20px -6px rgba(232,22,27,.5); }

.btn--wa { background: var(--c-wa); color: #fff; }
.btn--wa:hover { background: var(--c-wa-dark); box-shadow: 0 8px 20px -6px rgba(37,211,102,.55); }

.btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }

.btn--outline-dark { border-color: var(--c-ink); color: var(--c-ink); background: transparent; }
.btn--outline-dark:hover { background: var(--c-ink); color: #fff; }

/* ---------- Etiqueta superior de sección ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--f-display); font-weight: 700; font-size: var(--fs-sm);
  text-transform: uppercase; letter-spacing: .14em; color: var(--c-muted);
  margin-bottom: .9rem;
}
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--c-accent); }
.eyebrow--light { color: var(--c-on-dark-muted); }
.eyebrow--dark  { color: #d6dcea; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { background: rgba(20,23,28,.96); box-shadow: 0 4px 20px rgba(0,0,0,.25); backdrop-filter: blur(8px); }
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff; }
/* Logo original de la empresa (img/logos/logo.png, fondo transparente) */
.brand__logo { height: 56px; width: auto; }
@media (max-width: 420px) { .brand__logo { height: 42px; } }

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav__list { display: flex; gap: 1.5rem; }
.nav__link {
  position: relative; color: var(--c-on-dark); text-decoration: none;
  font-weight: 600; font-size: var(--fs-sm); padding: .4rem 0;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--c-accent); transition: right .25s var(--ease);
}
.nav__link:hover::after, .nav__link.is-active::after { right: 0; }

.nav-toggle { display: none; background: none; border: 0; padding: .5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; position: relative; z-index: 2; }
  /* En celulares el header no usa desenfoque: el desenfoque (backdrop-filter)
     "encerraba" el menú dentro de la franja del header al bajar la página. */
  .site-header.is-scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav {
    position: fixed; inset: 0; z-index: 1;
    height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: calc(var(--header-h) + 1rem) 1.5rem 2rem;
    flex-direction: column; justify-content: center; gap: 2rem;
    background: var(--c-ink);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }
  .nav__list { flex-direction: column; align-items: center; gap: 1.25rem; }
  .nav__link { font-family: var(--f-display); font-size: 1.75rem; }
}

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: var(--fs-sm); }
.field small { font-weight: 400; color: var(--c-muted); }
.field input, .field select {
  width: 100%; padding: .8rem .9rem;
  font: inherit; font-size: 1rem; color: var(--c-text);
  background: #fff; border: 1.5px solid var(--c-line); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--c-ink); box-shadow: 0 0 0 3px rgba(60,76,108,.3); }
.field .is-invalid, .field input.is-invalid, .field select.is-invalid { border-color: var(--c-error); }
.form__error { grid-column: 1 / -1; color: var(--c-error); font-weight: 600; font-size: var(--fs-sm); }

/* ---------- Lista con tildes ---------- */
.checklist li { position: relative; padding-left: 1.8rem; margin-top: .5rem; font-weight: 600; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--c-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/65% no-repeat;
}

/* ---------- Link con flecha ---------- */
.link-arrow { font-weight: 700; color: var(--c-ink); text-decoration: none; border-bottom: 2px solid var(--c-accent); }
.link-arrow:hover { color: #000; }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: flex; align-items: center; gap: .6rem;
  padding: .9rem; border-radius: 999px;
  background: var(--c-wa); color: #fff; text-decoration: none; font-weight: 700;
  box-shadow: var(--shadow-lg);
  transition: transform .2s var(--ease);
}
.wa-float .icon { width: 32px; height: 32px; }
.wa-float:hover { transform: scale(1.05); }
.wa-float__label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .35s var(--ease), padding .35s; }
.wa-float:hover .wa-float__label { max-width: 240px; padding-right: .4rem; }
.wa-float::after { /* pulso para llamar la atención */
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--c-wa);
  animation: wa-pulse 2.4s infinite; pointer-events: none;
}
@keyframes wa-pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wa-float::after { animation: none; } }

/* ---------- Barra fija inferior (solo móvil) ---------- */
.mobile-bar { display: none; }
@media (max-width: 700px) {
  .wa-float { display: none; }
  .mobile-bar {
    position: fixed; inset: auto 0 0; z-index: 90;
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(20,23,28,.97); box-shadow: 0 -6px 20px rgba(0,0,0,.25);
  }
  .mobile-bar__btn {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .85rem; border-radius: var(--radius-sm);
    background: var(--c-ink-3); color: #fff; font-weight: 700; text-decoration: none;
  }
  .mobile-bar__btn--wa { background: var(--c-wa); }
  body { padding-bottom: 72px; }
}

/* ---------- Lightbox / galería ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto 1fr auto auto;
  background: rgba(10,12,15,.96); color: #fff;
}
.lightbox[hidden] { display: none; }
.lightbox__top { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; padding: 1rem var(--gutter); }
.lightbox__title { font-size: var(--fs-lg); flex: 1; }
.lightbox__counter { color: var(--c-on-dark-muted); font-size: var(--fs-sm); }
.lightbox__close { background: none; border: 0; color: #fff; font-size: 2.4rem; line-height: 1; padding: 0 .4rem; }
.lightbox__stage { grid-column: 2; margin: 0; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 .5rem; }
.lightbox__stage img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox__nav {
  align-self: center; background: rgba(255,255,255,.08); border: 0; color: #fff;
  width: 52px; height: 52px; border-radius: 50%; font-size: 2rem; line-height: 1; margin: 0 .75rem;
}
.lightbox__nav:hover { background: var(--c-accent); color: var(--c-accent-ink); }
.lightbox__nav--prev { grid-column: 1; grid-row: 2; }
.lightbox__nav--next { grid-column: 3; grid-row: 2; }
.lightbox__thumbs { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; padding: .75rem var(--gutter); scrollbar-width: thin; }
.lightbox__thumbs button { flex: 0 0 72px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: none; opacity: .55; }
.lightbox__thumbs button.is-active { border-color: var(--c-accent); opacity: 1; }
.lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__cta { grid-column: 1 / -1; justify-self: center; margin: 0 0 1.25rem; }
@media (max-width: 700px) {
  .lightbox__nav { position: absolute; top: 50%; width: 42px; height: 42px; margin: 0 .25rem; }
  .lightbox__nav--prev { left: 0; } .lightbox__nav--next { right: 0; }
  .lightbox__stage { grid-column: 1 / -1; }
}
