/* ============================================================
   components.css — Piezas reutilizables
   Logo, navegación, botones, mockup de celular, tarjetas,
   acordeón, formulario y botón flotante.
   ============================================================ */

/* ---------- Logo (serif elegante, letras espaciadas) ---------- */
.logo {
  font-family: var(--font-logo);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: .32em;
  margin-right: -.32em;          /* compensa el espaciado final */
  line-height: 1;
  color: var(--ink);
}
.logo--badge {
  display: inline-grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  font-size: 1.35rem;
  margin-right: 0;
  padding-left: .32em;
  box-shadow: 0 0 0 1px var(--cream-15);
}

/* ---------- Navegación ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  transition: background .35s ease, box-shadow .35s ease, transform .4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(251, 246, 238, .86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--ink-10);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav__links {
  display: flex;
  gap: .25rem;
  margin-left: auto;
}
.nav__links a {
  position: relative;
  padding: .5rem .85rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink-70);
  border-radius: 999px;
  transition: color .25s, background .25s;
}
.nav__links a:hover { color: var(--ink); background: var(--sand-30); }
.nav__links a.is-active { color: var(--ink); }
.nav__links a.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--terra);
  transform: translateX(-50%);
}

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--ink);
  position: relative;
}
.nav__toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--cream);
  transition: transform .35s var(--ease-out), top .35s var(--ease-out);
}
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem var(--gutter) 1.5rem;
  background: var(--cream);
  border-top: 1px solid var(--ink-10);
  box-shadow: var(--shadow);
}
.mobile-menu a:not(.btn) {
  padding: .9rem 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--ink-10);
}
.mobile-menu .btn { margin-top: 1rem; }

/* ---------- Botones ---------- */
.btn {
  --pad-y: .85rem;
  --pad-x: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .35s var(--ease-spring), box-shadow .35s var(--ease-out), background .25s, color .25s;
  will-change: transform;
}
.btn .icon { width: 1.25em; height: 1.25em; flex: none; }

/* Texto oscuro sobre terracota para cumplir contraste AA */
.btn--primary {
  background: var(--terra);
  color: var(--ink);
  box-shadow: 0 10px 24px -10px rgba(224, 122, 95, .9), inset 0 -2px 0 rgba(30, 30, 30, .12);
}
.btn--primary:hover { box-shadow: 0 16px 30px -10px rgba(224, 122, 95, .95), inset 0 -2px 0 rgba(30, 30, 30, .12); }
.btn--primary:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

.btn--ghost {
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--cream); }

.btn--sm { --pad-y: .6rem; --pad-x: 1.15rem; font-size: .9rem; }
.btn--lg { --pad-y: 1.05rem; --pad-x: 1.85rem; font-size: 1.05rem; }
.btn--block { width: 100%; }

.link-btn {
  font-weight: 700;
  color: var(--steel);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon { width: 24px; height: 24px; }

/* ---------- Pill / Badge ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 1rem .45rem .75rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--ink-10);
  font-weight: 700;
  font-size: .9rem;
}
.pill__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 0 rgba(224, 122, 95, .6);
  animation: ping 2s var(--ease-out) infinite;
}

.badge {
  padding: .3rem .75rem;
  border-radius: 999px;
  background: var(--terra-15);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .04em;
}

/* ---------- Mockup de celular ---------- */
.phone {
  position: relative;
  width: 290px;
  aspect-ratio: 9 / 18.5;
  padding: 12px;
  border-radius: 46px;
  background: var(--ink);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px #333;
}
.phone__notch {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 84px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(-50%);
  z-index: 2;
}
.phone__screen {
  position: relative;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: var(--cream);
}

/* Pantalla de tarjeta de fidelidad */
.loyalty {
  display: flex;
  flex-direction: column;
  padding: 3.4rem 1.2rem 1.2rem;
  gap: .65rem;
}
.loyalty__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.loyalty__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}
.loyalty__tag {
  font-size: .68rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--steel-15);
  color: var(--ink);
}
.loyalty__hello {
  margin-top: .4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.15;
}
.loyalty__meta { font-size: .85rem; color: var(--ink-70); }
.loyalty__meta strong { color: var(--ink); font-size: 1rem; }

.stamps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
  padding: .9rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.stamps span {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed var(--sand);
  position: relative;
  transition: background .3s, border-color .3s;
}
.stamps span::after {
  content: '☕';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .95rem;
  transform: scale(0);
  transition: transform .45s var(--ease-spring);
}
.stamps span.is-on {
  background: var(--terra);
  border: 2px solid var(--terra);
  animation: stamp .5s var(--ease-spring);
}
.stamps span.is-on::after { transform: scale(1); }
.stamps--lg { gap: .7rem; padding: 1rem; }
.stamps--lg span::after { font-size: 1.15rem; }

.loyalty__reward {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .8rem;
  border-radius: 14px;
  background: var(--camel-15);
  font-size: .8rem;
  line-height: 1.3;
}
.loyalty__reward span { font-size: 1.2rem; }
.loyalty__qr {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.loyalty__qr small { font-size: .75rem; font-weight: 700; color: var(--ink-70); }

/* QR dibujado con CSS (decorativo) */
.qr {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 6px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 16px 16px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 16px 16px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 16px 16px no-repeat,
    repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 8px 8px;
  box-shadow: inset 0 0 0 3px #fff;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--sand-30);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--camel), var(--terra));
  transition: width .6s var(--ease-out);
}

/* ---------- Tarjetas flotantes (notificaciones) ---------- */
.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem .75rem .75rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  white-space: nowrap;
  z-index: 3;
}
.float-card strong { display: block; font-family: var(--font-display); font-size: .88rem; }
.float-card small { font-size: .76rem; color: var(--ink-70); }
.float-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.float-card__icon .icon { width: 22px; height: 22px; }
.float-card__icon--steel { background: var(--steel-15); color: var(--steel); }
.float-card__icon--terra { background: var(--terra-15); color: var(--terra); }
.float-card__icon--camel { background: var(--camel-15); color: var(--camel); }

/* ---------- Avatares ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  color: var(--ink);
}
.avatar--terra { background: var(--terra); }
.avatar--steel { background: var(--steel); }
.avatar--camel { background: var(--camel); }

/* ---------- Acordeón (details/summary) ---------- */
.accordion { display: grid; gap: .75rem; }
.accordion__item {
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--ink-10);
  transition: box-shadow .3s;
}
.accordion__item[open] { box-shadow: var(--shadow), inset 0 0 0 1px var(--ink-10); }
.accordion__item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.accordion__item summary::-webkit-details-marker { display: none; }
.accordion__item summary::after {
  content: '+';
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sand-30);
  font-size: 1.3rem;
  font-weight: 600;
  transition: transform .35s var(--ease-spring), background .25s;
}
.accordion__item[open] summary::after { transform: rotate(45deg); background: var(--terra); }
.accordion__body {
  padding: 0 1.4rem 1.3rem;
  color: var(--ink-70);
}
.accordion__item[open] .accordion__body { animation: fadeDown .4s var(--ease-out); }

/* ---------- Formulario ---------- */
.field { display: grid; gap: .4rem; border: 0; padding: 0; min-width: 0; }
.field > span, .field legend {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  padding: 0;
  margin-bottom: .4rem;
}
.field > span { margin-bottom: 0; }
.field input[type="text"] {
  width: 100%;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--sand);
  background: var(--cream);
  transition: border-color .25s, box-shadow .25s;
}
.field input[type="text"]:focus {
  outline: none;
  border-color: var(--steel);
  box-shadow: 0 0 0 4px var(--steel-15);
}
.field input[aria-invalid="true"] { border-color: var(--terra); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: .5rem .95rem;
  border-radius: 999px;
  border: 2px solid var(--sand);
  font-weight: 700;
  font-size: .9rem;
  transition: background .2s, border-color .2s, transform .3s var(--ease-spring);
}
.chip:hover span { border-color: var(--camel); }
.chip input:checked + span {
  background: var(--terra);
  border-color: var(--terra);
  transform: scale(1.04);
}
.chip input:focus-visible + span { outline: 3px solid var(--steel); outline-offset: 2px; }

/* ---------- Botón flotante WhatsApp ---------- */
.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: .6rem;
  height: 58px;
  padding: 0 17px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-lg);
  transform: translateY(140%);
  transition: transform .5s var(--ease-spring), background .25s;
}
.wa-float.is-visible { transform: none; }
.wa-float .icon { width: 26px; height: 26px; color: var(--terra); }
.wa-float__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  transition: max-width .45s var(--ease-out);
}
.wa-float:hover .wa-float__label,
.wa-float:focus-visible .wa-float__label { max-width: 180px; }
