/* Bexlo design system: componentes. */

/* ---------- Botón píldora doble ---------- */
.btn {
  display: inline-flex; padding: 5px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line);
  text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s var(--ease);
}
.btn__in {
  display: inline-flex; align-items: center; gap: 0.875rem;
  padding: 0.5rem 0.5rem 0.5rem 1.375rem; border-radius: var(--radius-pill);
  background: var(--brand-strong); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 30px -10px var(--brand-glow);
  transition: box-shadow 0.3s var(--ease);
}
.btn__icon {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); transition: transform 0.45s var(--ease);
}
.btn__icon svg { width: 1rem; height: 1rem; }
.btn:hover { border-color: var(--line-strong); }
.btn:hover .btn__in { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 40px -10px var(--brand-glow); }
.btn:hover .btn__icon { transform: rotate(45deg); }
.btn--ghost .btn__in { background: transparent; box-shadow: none; color: var(--text); }
.btn--ghost .btn__icon { background: rgba(255, 255, 255, 0.1); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 14px var(--gutter);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s;
}
.site-header.is-scrolled { background: rgba(11, 11, 12, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.site-header__logo img { height: 40px; width: auto; }
.site-nav { display: flex; gap: 2rem; font-size: 1rem; }
.site-nav a { text-decoration: none; color: var(--text-2); transition: color 0.2s; }
.site-nav a:hover { color: var(--text); }
.nav-mobile { display: none; }
@media (max-width: 860px) {
  .site-nav, .site-header .btn { display: none; }
  .nav-mobile { display: block; }
  .nav-mobile summary {
    list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--line-strong);
  }
  .nav-mobile summary::-webkit-details-marker { display: none; }
  .nav-mobile__panel {
    position: fixed; inset: 72px 0 auto; padding: 1.5rem var(--gutter) 2rem;
    background: var(--bg-2); border-bottom: 1px solid var(--line); display: grid; gap: 1.25rem;
  }
  .nav-mobile__panel a { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; text-decoration: none; }
}

/* ---------- Hero con vídeo ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-content: end;
  padding: 120px var(--gutter) clamp(32px, 5vw, 64px); overflow: hidden; isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media video, .hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(11,11,12,0.55) 0%, rgba(11,11,12,0.1) 35%, rgba(11,11,12,0.85) 85%, var(--bg) 100%);
}
.hero .lead { color: rgba(244, 244, 242, 0.82); }
.hero__actions { margin-top: 2rem; }
.hero__meta { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 64px); margin-top: clamp(40px, 6vw, 72px); padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* ---------- Contadores ---------- */
.stat__num { font-family: var(--font-display); font-weight: 650; font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--text-2); font-size: var(--fs-small); margin-top: 0.4rem; }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line); padding-block: 1.1rem; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker__track { display: flex; width: max-content; animation: ticker 38s linear infinite; }
.ticker__track > * { display: flex; align-items: center; gap: 2.5rem; padding-right: 2.5rem; white-space: nowrap; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.25rem, 2.4vw, 2rem); letter-spacing: -0.02em; }
.ticker__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Servicios en scroll horizontal ---------- */
.hscroll { position: relative; }
.hscroll__sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 2rem; }
.hscroll__track { display: flex; gap: clamp(16px, 2.5vw, 32px); padding-inline: var(--gutter); width: max-content; will-change: transform; }
.hscroll__bar { margin-inline: var(--gutter); height: 2px; background: var(--line); }
.hscroll__bar span { display: block; height: 100%; background: var(--brand); transform-origin: left; transform: scaleX(var(--p, 0)); }
.hscroll--native .hscroll__sticky { position: static; height: auto; padding-block: 2rem; }
.hscroll--native .hscroll__track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; }
.hscroll--native .card { scroll-snap-align: start; }

.card { flex: none; width: clamp(260px, 24vw, 340px); }
.card__media { aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.card:hover .card__media img { transform: scale(1.05); }
.card__num { display: block; margin-top: 1.1rem; color: var(--brand-bright); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.card__title { font-family: var(--font-display); font-weight: 650; font-size: 1.5rem; letter-spacing: -0.02em; margin-top: 0.25rem; }
.card__text { color: var(--text-2); margin-top: 0.4rem; font-size: 1.0625rem; }

/* ---------- Lista corta de servicios (líneas finas, sin cajas) ---------- */
.list-lines { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.list-lines li { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; border-bottom: 1px solid var(--line); font-size: var(--fs-lead); }
.list-lines li span:last-child { color: var(--text-2); font-size: var(--fs-small); align-self: center; }

/* ---------- Texto que se ilumina palabra a palabra ---------- */
.highlight { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 4.2vw, 3.5rem); letter-spacing: -0.03em; line-height: 1.12; max-width: 22ch; }
.highlight .w { opacity: 0.18; transition: opacity 0.3s linear; }
.highlight .w.is-on { opacity: 1; }

/* ---------- Proceso: línea vertical que se rellena ---------- */
.process { position: relative; display: grid; gap: clamp(48px, 8vw, 120px); padding-block: 1rem; }
.process__line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--line); transform: translateX(-50%); }
.process__line span { position: absolute; inset: 0; background: var(--brand); transform-origin: top; transform: scaleY(var(--p, 0)); }
.step { position: relative; width: 50%; padding-right: clamp(40px, 6vw, 96px); text-align: right; }
.step:nth-child(odd of .step) { margin-left: 50%; padding: 0 0 0 clamp(40px, 6vw, 96px); text-align: left; }
.step__marker {
  position: absolute; top: 0; right: 0; transform: translateX(50%);
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--text-2);
  transition: background 0.4s var(--ease), color 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.step:nth-child(odd of .step) .step__marker { left: 0; right: auto; transform: translateX(-50%); }
.step__marker svg { width: 22px; height: 22px; }
.step.is-on .step__marker { background: var(--brand-strong); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 18%, transparent); }
.step__title { font-family: var(--font-display); font-weight: 650; font-size: var(--fs-h3); letter-spacing: -0.03em; line-height: 1.1; padding-top: 0.4rem; }
.step__text { color: var(--text-2); margin-top: 0.6rem; }
@media (max-width: 760px) {
  .process__line { left: 26px; }
  .step, .step:nth-child(odd of .step) { width: auto; margin-left: 0; padding: 0 0 0 76px; text-align: left; }
  .step__marker, .step:nth-child(odd of .step) .step__marker { left: 0; right: auto; transform: none; }
}

/* ---------- Antes / después ---------- */
.ba { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); --pos: 50%; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba__after { clip-path: inset(0 0 0 var(--pos)); }
.ba__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #fff; transform: translateX(-50%); pointer-events: none; }
.ba__handle::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; border-radius: 50%;
  transform: translate(-50%, -50%); background: rgba(11, 11, 12, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m9 6-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E") center / 22px no-repeat;
  border: 2px solid #fff; backdrop-filter: blur(6px);
}
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba__tag { position: absolute; bottom: 14px; padding: 0.35rem 0.8rem; border-radius: var(--radius-pill); background: rgba(11, 11, 12, 0.7); font-size: var(--fs-small); pointer-events: none; }
.ba__tag--before { left: 14px; }
.ba__tag--after { right: 14px; }

/* ---------- Reseñas ---------- */
.rating { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; margin-top: 1.25rem; }
.rating__stars { color: #f5b301; letter-spacing: 0.1em; }
.review { width: min(84vw, 380px); flex: none; padding: 1.75rem; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); white-space: normal; }
.review__text { font-size: 1.0625rem; line-height: 1.55; }
.review__author { margin-top: 1rem; color: var(--text-2); font-size: var(--fs-small); }
.ticker--reviews { border: 0; padding: 0; }
.ticker--reviews .ticker__track > * { font: inherit; letter-spacing: normal; gap: 1.25rem; padding-right: 1.25rem; align-items: stretch; }
.ticker--reviews .ticker__track { animation-duration: 70s; }

/* ---------- Bloque de contacto ---------- */
.info-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.info dt { color: var(--text-2); font-size: var(--fs-small); }
.info dd { margin: 0.3rem 0 1.4rem; font-size: var(--fs-lead); }
.info a { text-decoration-color: var(--brand); text-underline-offset: 4px; }
.map { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) invert(0.92) contrast(0.9); }

/* ---------- Formulario ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: var(--fs-small); color: var(--text-2); }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.95rem 1.1rem; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--line-strong); font-size: 1.0625rem; transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand-bright); }
.check { display: flex; gap: 0.7rem; align-items: flex-start; font-size: var(--fs-small); color: var(--text-2); }
.check input { width: 20px; height: 20px; accent-color: var(--brand-strong); flex: none; margin-top: 2px; }
.hp { position: absolute; left: -9999px; }

/* ---------- WhatsApp fijo ---------- */
.fab-wa {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: #25d366; color: #fff; box-shadow: 0 10px 30px -8px rgba(37, 211, 102, 0.6);
  transition: transform 0.3s var(--ease);
}
.fab-wa:hover { transform: scale(1.06); }
.fab-wa svg { width: 30px; height: 30px; }

/* ---------- Pie con wordmark ---------- */
.footer { padding: var(--section) var(--gutter) 24px; border-top: 1px solid var(--line); overflow: hidden; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1rem 2rem; color: var(--text-2); font-size: var(--fs-small); }
.footer__links a { text-decoration: none; }
.footer__wordmark { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 15.5vw, 16rem); letter-spacing: -0.06em; line-height: 0.85; margin-top: 3rem; color: var(--bg-3); white-space: nowrap; }

/* ---------- Revelado al hacer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .ticker__track { animation: none; }
  .highlight .w { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker--reviews { overflow-x: auto; mask-image: none; }
  .ticker--reviews .ticker__track > [aria-hidden] { display: none; }
}

/* ---------- Zoom lento sobre foto (alternativa ligera al vídeo) ---------- */
.kenburns { overflow: hidden; }
.kenburns img { animation: kenburns 22s var(--ease) infinite alternate; transform-origin: var(--kb-origin, 50% 60%); will-change: transform; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .kenburns img { animation: none; } }

@media (max-width: 600px) {
  .list-lines li { flex-direction: column; gap: 0.2rem; }
  .list-lines li span:last-child { align-self: flex-start; }
}
