/* =========================
   THEME SETTINGS — MODO CLARO (por defecto)
========================= */

:root {
  /* TIPOGRAFÍA */
  --font-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Sora", sans-serif;
  --font-number:  Arial, Helvetica, sans-serif;

  /* COLORES — modo claro */
  --black:  #050505;
  --white:  #ffffff;
  --soft:   #f3f3f3;
  --muted:  #6f6f6f;
  --accent: #edff00;

  
  --bg:       var(--white);
  --surface:  var(--soft);
  --text:     var(--black);
  --text-inv: var(--white);

  /* LAYOUT */
  --container:    1240px;
  --page-padding: clamp(20px, 4vw, 56px);
  --header-height: 66px;

  /* ESPACIADO */
  --space-tag:   28px;
  --space-title: 32px;
  --space-copy:  48px;
  --section-padding-y:    clamp(96px,  9vw, 150px);
  --section-padding-y-lg: clamp(110px, 10vw, 170px);
}

/* Transición global suave al cambiar tema */
*, *::before, *::after {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* Excepciones: elementos que NO deben transicionar
   (animaciones JS, transforms, etc.) */
.why-banner-track,
.why-pills-track,
.work-track,
.services-pin-track,
.rotating-svg {
  transition: transform 0.05s linear !important;
}

/* =========================
   RESET
========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

/* =========================
   TIPOGRAFÍA GLOBAL
========================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/* =========================
   CONTENEDOR GLOBAL
========================= */

.section-container {
  width: min(100% - (var(--page-padding) * 2), var(--container));
  margin-inline: auto;
}

/* =========================
   TAG GLOBAL
========================= */

.section-tag {
  display: inline-block;
  width: fit-content;
  margin-bottom: var(--space-tag);
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* =========================
   BOTÓN GLOBAL
========================= */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 28px;
  background: var(--accent);
  color: var(--black);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 35px rgba(182, 255, 0, 0.35);
}

.btn-primary:hover img {
  transform: translate(3px, -3px);
}

/* =========================
   BOTÓN WHATSAPP FLOTANTE
========================= */

.whatsapp-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9998;

  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  /* Color amarillo de la web */
  background: #edff00;
  color: #050505;

  display: grid;
  place-items: center;

  box-shadow: 0 6px 24px rgba(237, 255, 0, 0.35);
  transition: transform 0.3s cubic-bezier(.19,1,.22,1), box-shadow 0.3s ease;

  text-decoration: none;
}

.whatsapp-fab svg {
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1;
}

.whatsapp-fab:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 14px 36px rgba(237, 255, 0, 0.5);
}

/* Tooltip al hacer hover */
.whatsapp-fab::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);

  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 6px;

  background: var(--black);
  color: var(--white);

  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.whatsapp-fab:hover::before {
  opacity: 1;
}

/* ── ONDAS RIPPLE ─────────────────────────────
   Dos pseudo-elementos concéntricos que se
   expanden y desvanecen en loop continuo.
   ::before ya lo usamos para el tooltip,
   así que usamos un elemento hermano .wa-ripple
   generado en el HTML directamente.
─────────────────────────────────────────────── */
.wa-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.wa-ripple::before,
.wa-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(237, 255, 0, 0.6);
  animation: waRipple 2.4s ease-out infinite;
}

.wa-ripple::after {
  animation-delay: 1.2s; /* segunda onda desfasada */
}

@keyframes waRipple {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* En hover las ondas se aceleran un poco */
.whatsapp-fab:hover .wa-ripple::before,
.whatsapp-fab:hover .wa-ripple::after {
  animation-duration: 1.6s;
}

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

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  .btn-primary {
    min-height: 50px;
    padding: 0 24px;
  }

  .whatsapp-fab {
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
  }

  .whatsapp-fab svg {
    width: 26px;
    height: 26px;
  }

  .wa-ripple::before,
  .wa-ripple::after {
    border-width: 1.5px;
  }
}

/* Botones primarios: texto negro para contrastar
   con el fondo verde accent */

/* Botón submit del formulario */

/* =========================
   CHAT FAB — BOTÓN Y PANEL FLOTANTE
========================= */

/* ── Botón flotante ──────────────────────────── */
.chat-fab {
  position: fixed;
  bottom: 96px;   /* encima del WhatsApp FAB */
  right: 28px;
  z-index: 9998;

  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  background: var(--black);
  color: var(--white);

  display: grid;
  place-items: center;

  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.3s cubic-bezier(.19,1,.22,1), box-shadow 0.3s ease, background 0.3s ease;
}

.chat-fab svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.chat-fab:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}

.chat-fab.is-active {
  background: var(--accent);
  color: var(--black);
}

/* Tooltip */
.chat-fab::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 6px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.chat-fab:hover::before {
  opacity: 1;
}

/* ── Panel ───────────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: 168px;
  right: 28px;
  z-index: 9997;

  width: clamp(300px, 90vw, 360px);

  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;

  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(.19,1,.22,1);
}

.chat-panel.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* Header del panel */
.chat-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--black);
  color: var(--white);
}

.chat-panel-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--black);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chat-panel-avatar svg {
  width: 18px;
  height: 18px;
}

.chat-panel-header strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.chat-panel-header span {
  font-size: 11px;
  opacity: 0.65;
}

.chat-panel-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  opacity: 0.65;
  transition: opacity 0.2s ease;
  display: grid;
  place-items: center;
}

.chat-panel-close:hover { opacity: 1; }
.chat-panel-close svg { width: 16px; height: 16px; }

/* Burbuja de bienvenida */
.chat-bubble {
  margin: 18px 18px 0;
  padding: 13px 16px;
  background: var(--soft);
  border-radius: 4px 14px 14px 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--black);
}

/* Formulario */
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 20px;
}

.chat-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 6px;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-form input::placeholder {
  color: rgba(0, 0, 0, 0.38);
}

.chat-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(182, 255, 0, 0.2);
}

.chat-submit {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin-top: 4px;
}

.chat-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(182, 255, 0, 0.35);
}

/* Estado éxito */
.chat-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
}

.chat-success svg {
  width: 48px;
  height: 48px;
}

.chat-success p {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.5;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 760px) {
  .chat-fab {
    bottom: 86px;
    right: 20px;
    width: 52px;
    height: 52px;
  }

  .chat-fab svg {
    width: 22px;
    height: 22px;
  }

  .chat-panel {
    bottom: 152px;
    right: 20px;
    left: 20px;
    width: auto;
  }
}
