/* Componentes reutilizables: botones, navegación, chips, etc. */

/* ---------- Botones ---------- */
.btn {
  --h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: var(--h);
  padding: 0 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}
.btn .icon { transition: transform 0.35s var(--ease-out); }
.btn:hover .icon[class*="icon--sm"] { transform: translateX(3px); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn--sm { --h: 42px; padding: 0 1.15rem; }
.btn--lg { --h: 56px; padding: 0 1.75rem; font-size: 1rem; }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 1px 1px rgba(21, 54, 42, 0.2), 0 8px 20px -10px rgba(29, 115, 80, 0.7);
}
.btn--primary:hover {
  background: var(--cta-hover);
  box-shadow: 0 1px 1px rgba(21, 54, 42, 0.2), 0 14px 28px -12px rgba(29, 115, 80, 0.75);
  transform: translateY(-1px);
}
.btn--outline { border-color: var(--green-800); color: var(--green-800); }
.btn--outline:hover { background: var(--green-800); color: #fff; }
.btn--ghost { background: var(--sage-50); color: var(--green-800); }
.btn--ghost:hover { background: var(--sage-100); }
.btn--quiet { color: var(--green-800); padding-inline: 0.5rem; }
.btn--quiet:hover { color: var(--cta); }
.btn--light { background: #fff; color: var(--green-900); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45); }
.btn--light:hover { background: var(--cream); transform: translateY(-1px); }
.btn--glass {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
}
.btn--glass:hover { background: rgba(255, 255, 255, 0.18); border-color: #fff; }

/* ---------- Encabezados de sección ---------- */
.h2 { font-size: var(--fs-h2); color: var(--green-900); }
.h2--xl { font-size: var(--fs-h2-xl); line-height: 0.98; }
.lead { font-size: var(--fs-lead); color: var(--ink-2); line-height: 1.55; max-width: 38rem; }

.section-head { display: grid; gap: 1.1rem; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); max-width: 46rem; }
.section-head--center { text-align: center; margin-inline: auto; justify-items: center; }
.section-head--split { max-width: none; }
@media (min-width: 960px) {
  .section-head--split { grid-template-columns: 1.15fr 1fr; align-items: end; gap: 4rem; }
  .section-head--split .lead { justify-self: end; }
}

.demo-note {
  margin-top: 1.75rem;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.demo-note--center { text-align: center; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--green-800); }
.brand__mark { width: 40px; height: 40px; flex: none; color: var(--green-800); }
.brand__text { display: grid; line-height: 1; }
.brand__text strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: 0.06em;
  color: var(--green-900);
}
.brand__text small {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-weight: 500;
}
.brand--light .brand__mark { color: var(--sage-500); }
.brand--light .brand__text strong { color: #fff; }
.brand--light .brand__text small { color: var(--on-dark-2); }

/* ---------- Header / navegación ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -22px rgba(28, 36, 32, 0.35);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 80px;
}
.is-scrolled .nav { height: 68px; }

.nav-links { display: none; gap: 0.25rem; }
.nav-links a {
  position: relative;
  padding: 0.5rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--radius-pill);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--green-900); background: var(--sage-50); }
.nav-links a[aria-current] { color: var(--green-900); }
.nav-links a[aria-current]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cta);
  transform: translateX(-50%);
}

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-phone {
  display: none;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--green-800);
  font-variant-numeric: tabular-nums;
}
.nav-phone:hover { color: var(--cta); }

.nav-toggle {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 50%;
  color: var(--green-900);
}
.nav-toggle .icon--close { display: none; }
.nav-toggle[aria-expanded="true"] .icon--open { display: none; }
.nav-toggle[aria-expanded="true"] .icon--close { display: block; }

@media (max-width: 479px) {
  .nav-actions .btn--sm { display: none; }
}
@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
}
@media (min-width: 1240px) {
  .nav-phone { display: inline-flex; }
}

/* ---------- Menú mobile ---------- */
.mobile-menu {
  position: fixed;
  inset: 72px 0 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease-out), visibility 0s linear 0.4s;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease-out), visibility 0s;
}
html.menu-open .site-header { background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.mobile-menu nav { display: grid; }
.mobile-menu nav a {
  display: flex;
  align-items: center;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--green-900);
}
.mobile-menu nav a:active { color: var(--cta); }
.mobile-menu__foot { display: grid; gap: 0.75rem; }
.mobile-menu__meta { margin-top: 0.5rem; font-size: var(--fs-sm); color: var(--ink-3); text-align: center; }
@media (min-width: 1024px) { .mobile-menu { display: none; } }

/* ---------- Chips flotantes (hero) ---------- */
.chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem 0.55rem 0.55rem;
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--green-900);
  white-space: nowrap;
}
.chip__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sage-50);
  color: var(--cta);
}

/* ---------- Rieles (carrusel con scroll en mobile, grilla en desktop) ---------- */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(78%, 1fr);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  padding: 0.25rem var(--gutter) 1rem;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 720px) {
  .rail { grid-auto-columns: minmax(46%, 1fr); }
}
@media (min-width: 960px) {
  .rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.25rem, 2vw, 2rem);
    overflow: visible;
    margin-inline: 0;
    padding: 0;
  }
}

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 58px;
  padding: 0 17px;
  border-radius: var(--radius-pill);
  background: var(--cta);
  color: #fff;
  box-shadow: 0 4px 10px rgba(21, 54, 42, 0.18), 0 18px 36px -14px rgba(21, 54, 42, 0.55);
  transition: background-color 0.25s var(--ease), transform 0.35s var(--ease-out), gap 0.4s var(--ease-out);
}
.wa-float .icon { width: 24px; height: 24px; }
.wa-float__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: max-width 0.45s var(--ease-out);
}
.wa-float:hover { background: var(--cta-hover); transform: translateY(-2px); gap: 0.6rem; }
.wa-float:hover .wa-float__label { max-width: 220px; }
html.menu-open .wa-float { opacity: 0; pointer-events: none; }
