/* ==========================================================================
   GlamFlow — Página pública de reservas (/r/<slug>/)
   Clara, pensada primero para celular. Sin dependencias externas.
   ========================================================================== */
:root {
  --r-bg: #F6F4FB;
  --r-card: #FFFFFF;
  --r-text: #1C1631;
  --r-muted: #6B6582;
  --r-line: #E7E3F1;
  --r-line-strong: #D5CFE6;
  --r-primary: #7C3AED;
  --r-primary-2: #A855F7;
  --r-primary-soft: #F1EAFE;
  --r-pink: #E8458F;
  --r-green: #15803D;
  --r-green-soft: #E7F6EC;
  --r-red: #B91C1C;
  --r-red-soft: #FDECEC;
  --r-radius: 16px;
  --r-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--r-bg); color: var(--r-text); font: 400 16px/1.5 var(--r-font); }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--r-primary); }
.r-hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(124,58,237,.45); outline-offset: 2px; }

.r-wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 16px 140px; }

/* Portada */
.r-cover {
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 85% -20%, rgba(232,69,143,.55), transparent 55%),
              linear-gradient(135deg, #2E1065 0%, #6D28D9 55%, #A855F7 100%);
  color: #fff; padding: 28px 0 64px;
}
.r-cover__inner { max-width: 620px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; }
.r-logo {
  width: 72px; height: 72px; flex: none; border-radius: 20px; overflow: hidden;
  display: grid; place-items: center; background: rgba(255,255,255,.16);
  border: 2px solid rgba(255,255,255,.35); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em;
}
.r-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.r-cover h1 { margin: 0; font-size: clamp(1.4rem, 5vw, 1.9rem); line-height: 1.15; letter-spacing: -.02em; }
.r-cover p { margin: 4px 0 0; color: rgba(255,255,255,.85); font-size: .95rem; }
.r-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.r-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: .76rem; font-weight: 600; }
.r-pill svg { width: 14px; height: 14px; }

/* Tarjetas de pasos */
.r-steps { margin-top: -40px; display: grid; gap: 12px; }
.r-step { background: var(--r-card); border: 1px solid var(--r-line); border-radius: var(--r-radius); box-shadow: 0 8px 24px rgba(46,16,101,.06); }
.r-step__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.r-step__num {
  width: 28px; height: 28px; flex: none; border-radius: 999px; display: grid; place-items: center;
  font-size: .8rem; font-weight: 800; color: var(--r-primary); background: var(--r-primary-soft);
}
.r-step.is-done .r-step__num { color: #fff; background: var(--r-green); }
.r-step.is-locked { opacity: .55; }
.r-step__title { margin: 0; font-size: 1.02rem; font-weight: 700; }
.r-step__summary { font-size: .86rem; color: var(--r-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-step__edit { margin-left: auto; border: 0; background: none; color: var(--r-primary); font-weight: 600; font-size: .86rem; cursor: pointer; padding: 6px; }
.r-step__body { padding: 0 18px 18px; }

/* Opciones */
.r-options { display: grid; gap: 8px; }
.r-option {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px; border-radius: 14px; border: 1.5px solid var(--r-line); background: #fff; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.r-option:hover { border-color: var(--r-line-strong); }
.r-option[aria-pressed="true"] { border-color: var(--r-primary); background: var(--r-primary-soft); }
.r-option:disabled { opacity: .45; cursor: not-allowed; }
.r-option__main { flex: 1; min-width: 0; }
.r-option__name { font-weight: 650; }
.r-option__meta { font-size: .84rem; color: var(--r-muted); }
.r-option__price { font-weight: 750; white-space: nowrap; }
.r-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--r-pink), var(--r-primary));
}
.r-avatar--any { background: var(--r-primary-soft); color: var(--r-primary); }
.r-avatar svg { width: 20px; height: 20px; }

/* Días */
.r-days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.r-day {
  flex: none; width: 64px; padding: 10px 0; border-radius: 14px; text-align: center; cursor: pointer;
  border: 1.5px solid var(--r-line); background: #fff; scroll-snap-align: start;
}
.r-day b { display: block; font-size: 1.25rem; line-height: 1.2; }
.r-day small { display: block; font-size: .72rem; color: var(--r-muted); text-transform: capitalize; }
.r-day[aria-pressed="true"] { border-color: var(--r-primary); background: var(--r-primary); color: #fff; }
.r-day[aria-pressed="true"] small { color: rgba(255,255,255,.85); }
.r-day:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* Horas */
.r-times { margin-top: 14px; }
.r-times h4 { margin: 12px 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--r-muted); }
.r-times__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .r-times__grid { grid-template-columns: repeat(4, 1fr); } }
.r-time {
  padding: 11px 0; border-radius: 12px; border: 1.5px solid var(--r-line); background: #fff;
  font-weight: 650; font-size: .92rem; cursor: pointer; font-variant-numeric: tabular-nums;
}
.r-time[aria-pressed="true"] { border-color: var(--r-primary); background: var(--r-primary); color: #fff; }
.r-note { padding: 14px; border-radius: 12px; background: var(--r-bg); color: var(--r-muted); font-size: .9rem; text-align: center; }

/* Formulario */
.r-field { display: grid; gap: 6px; margin-bottom: 12px; }
.r-field label { font-size: .86rem; font-weight: 600; }
.r-field input, .r-field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--r-line-strong); background: #fff; outline: none;
}
.r-field textarea { min-height: 76px; resize: vertical; }
.r-field input:focus, .r-field textarea:focus { border-color: var(--r-primary); }
.r-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.r-phone { display: flex; align-items: stretch; }
.r-phone span { display: grid; place-items: center; padding: 0 12px; border: 1.5px solid var(--r-line-strong); border-right: 0; border-radius: 12px 0 0 12px; background: var(--r-bg); font-weight: 600; color: var(--r-muted); }
.r-phone input { border-radius: 0 12px 12px 0; }
.r-check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--r-muted); }
.r-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--r-primary); flex: none; }
.r-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.r-error { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--r-red-soft); color: var(--r-red); font-size: .9rem; }

/* Barra fija inferior */
.r-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--r-line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.r-bar__inner { max-width: 620px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.r-bar__summary { flex: 1; min-width: 0; font-size: .84rem; color: var(--r-muted); }
.r-bar__summary strong { display: block; color: var(--r-text); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
}
.r-btn svg { width: 20px; height: 20px; }
.r-btn--primary { color: #fff; background: linear-gradient(135deg, var(--r-primary), var(--r-primary-2)); box-shadow: 0 10px 24px rgba(124,58,237,.3); }
.r-btn--primary:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.r-btn--ghost { color: var(--r-text); background: #fff; border: 1.5px solid var(--r-line-strong); }
.r-btn--wa { color: #fff; background: #16A34A; }
.r-btn--block { width: 100%; }
.r-btn--sm { min-height: 40px; padding: 0 14px; font-size: .88rem; border-radius: 12px; }

.r-wa-alt { margin-top: 16px; text-align: center; font-size: .9rem; color: var(--r-muted); }
.r-wa-alt a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #15803D; text-decoration: none; }
.r-wa-alt svg { width: 18px; height: 18px; }

/* Pie */
.r-foot { margin-top: 28px; text-align: center; font-size: .8rem; color: var(--r-muted); }
.r-foot a { color: inherit; font-weight: 600; text-decoration: none; }
.r-foot__dev { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: #10172A; color: #A5F3FC !important; }
.r-foot__dev img { height: 26px; width: auto; }
.r-foot__cta { margin-top: 6px; }
.r-foot__cta a { color: var(--r-primary) !important; }

/* Confirmación */
.r-done { margin-top: -40px; background: var(--r-card); border: 1px solid var(--r-line); border-radius: 20px; padding: 26px 20px; text-align: center; box-shadow: 0 8px 24px rgba(46,16,101,.06); }
.r-done__icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 999px; display: grid; place-items: center; background: var(--r-green-soft); color: var(--r-green); }
.r-done__icon svg { width: 34px; height: 34px; }
.r-done__icon--x { background: var(--r-red-soft); color: var(--r-red); }
.r-done h2 { margin: 0 0 4px; font-size: 1.4rem; letter-spacing: -.02em; }
.r-done p { margin: 0; color: var(--r-muted); }
.r-ticket { margin: 20px 0; padding: 16px; border-radius: 16px; background: var(--r-bg); text-align: left; display: grid; gap: 10px; }
.r-ticket div { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.r-ticket span { color: var(--r-muted); }
.r-ticket b { text-align: right; }
.r-actions { display: grid; gap: 8px; }
.r-link-btn { border: 0; background: none; color: var(--r-red); font-weight: 600; cursor: pointer; padding: 10px; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Evita que la tira de días ensanche la página en celulares */
.r-steps > *, .r-step__body, .r-step__head > div { min-width: 0; }
.r-wrap { overflow-x: clip; }
.r-step { scroll-margin-top: 12px; }

/* Estrellas del negocio (calificaciones de GlamFlow) */
.r-pill--stars b { color: #FDE68A; font-weight: 800; }

/* Cumpleaños opcional en la confirmación */
.r-cumple { margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--r-primary-soft); text-align: left; }
.r-cumple label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 8px; }
.r-cumple label span { display: block; font-weight: 400; color: var(--r-muted); font-size: .82rem; margin-top: 2px; }
.r-cumple__row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }
.r-cumple__row > * { min-width: 0; }
.r-cumple select { padding: 10px; border-radius: 10px; border: 1.5px solid var(--r-line-strong); background: #fff; font: inherit; }
.r-cumple .r-btn { padding: 10px 14px; }
.r-cumple--ok { text-align: center; font-weight: 600; color: var(--r-primary); }

/* Abono al reservar */
.r-abono-tag { color: var(--r-primary); font-weight: 700; }
.r-done__icon--wait { background: #FEF3C7 !important; color: #B45309 !important; }
.r-abono { margin: 14px 0 6px; padding: 16px; border-radius: 16px; border: 2px dashed #F59E0B; background: #FFFBEB; text-align: left; }
.r-abono__amount { font-size: 1.05rem; margin-bottom: 10px; }
.r-abono__amount b { font-size: 1.35rem; }
.r-abono__row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid #FDE68A; font-size: .92rem; }
.r-abono__row > * { min-width: 0; overflow-wrap: anywhere; }
.r-abono__row span { color: var(--r-muted); }
.r-abono__row b { text-align: right; }
.r-abono__row:has(> :nth-child(2):last-child) { grid-template-columns: auto 1fr; }
.r-abono__copy { border: 0; background: #F59E0B; color: #fff; font-weight: 700; font-size: .8rem; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.r-abono__note { margin: 10px 0 12px; font-size: .82rem; color: #92400E; }
.r-abono .r-btn { white-space: normal; text-align: center; }
