/* Fidely — móvil interactivo (la app de la clienta de una clínica de ejemplo)
   Módulo autónomo: no depende de site.css salvo por las @font-face de DM Sans y Playfair Display.
   Todo cuelga de .pd (el contenedor) y usa el prefijo pd-. El móvil se diseña a 380 x 800 px (pantalla de 360 x 780)
   y se escala con transform para que quepa en cualquier ancho (ver .pd-device).
   Variables públicas:
     --brand        color de la clínica (botón principal, selecciones)
     --brand-ink    color del texto sobre --brand (la API lo calcula por contraste)
     --brand-text   --brand oscurecido hasta tener 5,3:1 sobre blanco, para texto pequeño (lo calcula la API)
     --phone-font   tipografía del saludo, las cifras y el nombre de la clínica (la interfaz va siempre en DM Sans)
     --pd-width     ancho del móvil, de 280 a 360 px (por defecto 340 px; nunca más del 86 % de la ventana) */

.pd-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  --brand: #2ECC71;
  --brand-ink: #1B2340;
  --brand-text: #197A41;
  --brand-tint: #E8F8F0;
  --brand-tint: color-mix(in srgb, var(--brand) 12%, #fff);
  --phone-font: 'Playfair Display', Georgia, 'Times New Roman', serif;

  /* tokens internos (los de Fidely) */
  --pd-navy: #1B2340;
  --pd-navy-950: #0F1730;
  --pd-card: #17213D;
  --pd-card: color-mix(in srgb, var(--brand) 6%, var(--pd-navy-950));
  --pd-ink-2: #475467;
  --pd-ink-3: #5B6472;
  --pd-line: #E4E7EC;
  --pd-paper: #FFFFFF;
  --pd-paper-2: #F4F5F8;
  --pd-green-ink: #197A41;
  --pd-green-50: #E8F8F0;
  --pd-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pd-r-card: 20px;
  --pd-r-control: 14px;
  --pd-r-tag: 8px;
  --pd-shadow-card: 0 1px 2px rgba(27, 35, 64, .05), 0 8px 24px rgba(27, 35, 64, .07);
  --pd-shadow-float: 0 12px 32px rgba(15, 23, 48, .28), 0 2px 6px rgba(15, 23, 48, .12);
  --pd-ease: cubic-bezier(.16, 1, .3, 1);
  --pd-slide: .2s cubic-bezier(.22, .8, .24, 1);
}

/* Antes de que el JS monte el móvil, el hueco ya está reservado (sin saltos de página) */
.pd-wrap:not(.is-ready)::before { content: ''; display: block; width: min(var(--pd-width, 340px), 86vw); max-width: 100%; aspect-ratio: 380 / 800; }

.pd {
  /* Escala: sin atan2() se queda en 340/380; con él sigue el ancho real del contenedor */
  --pd-s: .895;

  position: relative;
  width: min(var(--pd-width, 340px), 86vw);
  max-width: 100%;
  aspect-ratio: 380 / 800;
  container-type: inline-size;
  flex: none;
}

@supports (transform: scale(tan(atan2(100px, 380px)))) {
  .pd { --pd-s: tan(atan2(100cqw, 380px)); }
}

/* El marco real mide 380 x 800 y se reduce con la escala. El contenedor (.pd) ya tiene el tamaño reducido. */
.pd-device {
  position: absolute;
  left: 0;
  top: 0;
  width: 380px;
  height: 800px;
  padding: 10px;
  border-radius: 54px;
  background: var(--pd-navy-950);
  box-shadow: 0 40px 70px -28px rgba(15, 23, 48, .55), 0 10px 22px -8px rgba(15, 23, 48, .25), inset 0 0 0 1px rgba(255, 255, 255, .09);
  transform: scale(var(--pd-s));
  transform-origin: 0 0;
  font-family: var(--pd-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--pd-navy);
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.pd-device *, .pd-device *::before, .pd-device *::after { box-sizing: border-box; }
:where(.pd-device) :where(img, svg) { display: block; max-width: none; }
:where(.pd-device) :where(h1, h2, h3, h4, p, ul, ol) { margin: 0; padding: 0; }
:where(.pd-device) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:where(.pd-device) img { -webkit-user-drag: none; user-drag: none; }
.pd-device :focus-visible { outline: 2px solid var(--pd-navy); outline-offset: 2px; border-radius: 8px; }

.pd-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 44px;
  background: var(--pd-paper-2);
  isolation: isolate;
}

/* Isla dinámica y barra de inicio dibujadas */
.pd-screen::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 70;
  width: 104px;
  height: 30px;
  border-radius: 20px;
  background: var(--pd-navy-950);
  transform: translateX(-50%);
  pointer-events: none;
}

.pd-homebar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  z-index: 70;
  width: 118px;
  height: 5px;
  border-radius: 3px;
  background: var(--pd-navy);
  opacity: .85;
  transform: translateX(-50%);
  pointer-events: none;
}

.pd-status {
  position: absolute;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 12px 26px 0 32px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pd-navy);
  background: transparent;
  pointer-events: none;
  transition: color .2s, background-color .2s;
}

.pd-screen[data-tone="light"] .pd-status { color: #fff; }
.pd-screen.is-solid .pd-status { background: var(--pd-status-bg, var(--pd-paper-2)); box-shadow: 0 1px 0 var(--pd-line); }
.pd-status-icons { display: inline-flex; align-items: center; gap: 5px; }
.pd-status-icons svg { fill: currentColor; stroke: none; }

/* ---------- Estructura: cabecera, cuerpo con scroll, pestañas ---------- */
.pd-main {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.pd-head {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 56px 16px 12px;
  background: var(--pd-paper-2);
}

.pd-head[hidden] { display: none; }
.pd-head-text { min-width: 0; padding-top: 2px; }
.pd-title { font-size: 28px; font-weight: 700; line-height: 34px; letter-spacing: -.025em; }
.pd-subtitle { margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--pd-ink-2); }

.pd-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  scrollbar-width: none;
  cursor: grab;
  /* sin overscroll-behavior: contain: al llegar al borde, la página sigue moviéndose */
}

.pd-scroll::-webkit-scrollbar { display: none; }
.pd-scroll.is-dragging, .pd-scroll.is-dragging * { cursor: grabbing; }
.pd-device .pd-scroll:focus-visible { outline: 3px solid var(--pd-navy); outline-offset: -3px; border-radius: 0; }

.pd-view { display: block; padding-bottom: 32px; animation: pd-fade .16s ease-out both; }
.pd-view.is-quiet { animation: none; }
@keyframes pd-fade { from { opacity: 0; } to { opacity: 1; } }

.pd-pad { padding: 0 16px; }

.pd-tabs {
  position: relative;
  z-index: 4;
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 4px 26px;
  background: var(--pd-paper);
  box-shadow: 0 -1px 0 var(--pd-line);
}

.pd-tab {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  min-height: 52px;
  padding: 4px 0 2px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pd-ink-3);
  transition: color .15s;
}

.pd-tab .pd-i { stroke-width: 1.8; }
.pd-tab.is-on { color: var(--pd-navy); font-weight: 700; }
.pd-tab.is-on .pd-i { stroke-width: 2.2; }
.pd-tab:active .pd-i { transform: scale(.92); }

/* ---------- Iconos y piezas pequeñas ---------- */
.pd-i { flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.pd-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--pd-r-tag);
  background: var(--pd-paper-2);
  color: var(--pd-navy);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.pd-tag--soft { background: var(--brand-tint); color: var(--brand-text); }
.pd-tag--ok { background: var(--pd-green-50); color: var(--pd-green-ink); }
.pd-tag--glass { background: rgba(255, 255, 255, .14); color: #fff; }
.pd-tag--light { background: #fff; color: var(--pd-navy); }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.pd-avatar-btn, .pd-chip-btn, .pd-back {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 999px;
  font-weight: 700;
  transition: background-color .15s, transform .15s;
}

.pd-avatar-btn::before, .pd-chip-btn::before, .pd-back::before { content: ''; position: absolute; inset: -4px; }
.pd-avatar-btn { width: 40px; background: rgba(27, 35, 64, .08); color: var(--pd-navy); font-size: 14px; letter-spacing: .02em; }
.pd-avatar-btn:active, .pd-chip-btn:active, .pd-back:active { transform: scale(.94); }

.pd-avatar-btn--photo, .pd-chip-btn, .pd-back--photo {
  background: rgba(15, 23, 48, .42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38);
  color: #fff;
}

.pd-chip-btn { gap: 6px; padding: 0 12px 0 10px; font-size: 14px; }
.pd-chip-btn .pd-i:last-child { opacity: .8; }
.pd-device .pd-avatar-btn--photo:focus-visible, .pd-device .pd-chip-btn:focus-visible, .pd-device .pd-back--photo:focus-visible { outline-color: #fff; }

.pd-link { font-size: 14px; font-weight: 700; color: var(--brand-text); }
.pd-muted { color: var(--pd-ink-2); }

/* ---------- Secciones ---------- */
.pd-sec { margin-top: 28px; }
.pd-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pd-sec-title { font-size: 20px; font-weight: 700; line-height: 26px; letter-spacing: -.02em; text-wrap: balance; }
.pd-sec-sub { margin: -8px 0 14px; font-size: 14px; line-height: 1.4; color: var(--pd-ink-2); }
.pd-intro { margin: 0 0 20px; font-size: 15px; line-height: 22px; color: var(--pd-ink-2); }

/* ---------- Tarjetas y listas ---------- */
.pd-card {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: var(--pd-r-card);
  background: var(--pd-paper);
  box-shadow: var(--pd-shadow-card);
  text-align: left;
}

button.pd-card, a.pd-card { transition: transform .15s var(--pd-ease), box-shadow .15s; }
button.pd-card:active { transform: scale(.985); }
.pd-card + .pd-card, .pd-card + .pd-list, .pd-list + .pd-card, .pd-list + .pd-list { margin-top: 12px; }
.pd-card-name { display: block; font-size: 17px; font-weight: 700; line-height: 23px; letter-spacing: -.015em; }

.pd-list { display: block; overflow: hidden; border-radius: var(--pd-r-card); background: var(--pd-paper); box-shadow: var(--pd-shadow-card); }
.pd-list > * + * { border-top: 1px solid var(--pd-line); }

.pd-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 16px; text-align: left; }
.pd-row-main { flex: 1; min-width: 0; display: block; }
.pd-row-title { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.pd-row-meta { display: block; font-size: 13px; line-height: 1.35; color: var(--pd-ink-2); }
.pd-row-end { flex: none; font-size: 15px; font-weight: 700; }
.pd-row > .pd-i:last-child { flex: none; color: var(--pd-ink-3); }
button.pd-row:active { background: var(--pd-paper-2); }
@media (hover: hover) { button.pd-row:hover { background: var(--pd-paper-2); } }

.pd-media { position: relative; display: block; height: 130px; overflow: hidden; background: var(--brand-tint); }
.pd-media picture, .pd-media img { display: block; width: 100%; height: 100%; }
.pd-media img { object-fit: cover; }

/* ---------- Inicio ---------- */
.pd-hero { position: relative; height: 262px; overflow: hidden; background: var(--pd-navy); }
.pd-hero picture, .pd-hero img { display: block; width: 100%; height: 100%; }
.pd-hero img { object-fit: cover; object-position: 50% 58%; }
.pd-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 23, 48, .45) 0, rgba(15, 23, 48, 0) 30%, rgba(15, 23, 48, .7) 100%); pointer-events: none; }
.pd-hero-top { position: absolute; z-index: 2; top: 56px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; }
.pd-hero-text { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 66px; color: #fff; }
.pd-greet { display: block; font-size: 15px; font-weight: 500; line-height: 1.3; color: rgba(255, 255, 255, .85); }
.pd-hero-name { display: block; font-family: var(--phone-font); font-size: 36px; font-weight: 600; line-height: 42px; letter-spacing: -.01em; font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.pd-hero-clinic { display: block; margin-top: 2px; font-family: var(--phone-font); font-size: 15px; font-weight: 600; line-height: 1.3; color: rgba(255, 255, 255, .85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pd-float { position: relative; z-index: 1; margin-top: -56px; padding: 0 16px; }

.pd-loyalty {
  display: block;
  width: 100%;
  padding: 18px 20px 18px;
  border-radius: 24px;
  background: var(--pd-card);
  box-shadow: var(--pd-shadow-float), inset 0 0 0 1px rgba(255, 255, 255, .07);
  color: #fff;
  text-align: left;
  transition: transform .15s var(--pd-ease);
}

.pd-loyalty:active { transform: scale(.985); }
.pd-loyalty-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 26px; }
.pd-loyalty-name { display: block; margin-top: 12px; font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-points { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.pd-figure { font-family: var(--phone-font); font-size: 50px; font-weight: 700; line-height: 58px; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.pd-points-unit { font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .72); }
.pd-progress { display: block; height: 6px; margin-top: 8px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.pd-progress > span { display: block; height: 100%; border-radius: 3px; background: #fff; }
.pd-loyalty-next { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 14px; line-height: 1.35; color: rgba(255, 255, 255, .82); }
.pd-loyalty-next .pd-i { color: rgba(255, 255, 255, .6); }

.pd-appt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.pd-appt-date { flex: none; display: grid; justify-items: center; gap: 2px; width: 58px; padding-right: 14px; border-right: 1px solid var(--pd-line); font-size: 13px; line-height: 1.2; }
.pd-appt-date strong { font-weight: 700; }
.pd-appt-date span { color: var(--pd-ink-2); }
.pd-appt-name { display: block; font-size: 17px; font-weight: 700; line-height: 23px; letter-spacing: -.015em; }
.pd-appt-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--pd-ink-2); }
.pd-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--pd-green-ink); }
.pd-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #2ECC71; }

/* ---------- Carrusel de promociones ---------- */
.pd-rail {
  display: flex;
  gap: 12px;
  margin: 0 -16px;
  padding: 2px 16px 22px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pd-rail::-webkit-scrollbar { display: none; }
.pd-rail > * { flex: none; scroll-snap-align: start; }
.pd-rail + .pd-sec { margin-top: 6px; }

.pd-promo { display: flex; flex-direction: column; width: 238px; overflow: hidden; padding: 0; }
.pd-promo-body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.pd-promo-title { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.pd-promo-text { display: block; font-size: 13px; line-height: 1.4; color: var(--pd-ink-2); }
.pd-promo-foot { display: flex; align-items: center; min-height: 28px; margin-top: auto; padding-top: 10px; }
.pd-promo-foot .pd-i { margin-left: auto; color: var(--pd-navy); }

.pd-hook {
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding: 16px 18px;
  color: var(--brand-text);
  font-family: var(--phone-font);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.015em;
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}

.pd-reco-price { margin-left: auto; padding-left: 8px; font-size: 15px; font-weight: 700; }

/* ---------- Tratamientos ---------- */
.pd-tcard { padding: 0; overflow: hidden; }
.pd-tcard .pd-media { height: 176px; }
.pd-tcard-body { display: block; padding: 16px; }
.pd-tcard-body .pd-tags { margin-top: 10px; }
.pd-price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; }
.pd-price-row .pd-muted { font-size: 13px; }
.pd-price { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

/* ---------- Planes ---------- */
.pd-notice { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 14px 16px; border-radius: var(--pd-r-control); background: var(--pd-green-50); color: var(--pd-navy); font-size: 15px; line-height: 1.35; }
.pd-notice .pd-i { color: var(--pd-green-ink); }
.pd-plan { padding: 20px; margin-bottom: 14px; }
.pd-plan.is-featured { box-shadow: inset 0 0 0 1.5px var(--brand-text), 0 8px 24px rgba(27, 35, 64, .1); }
.pd-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-plan-name { display: block; font-size: 24px; font-weight: 700; line-height: 30px; letter-spacing: -.03em; }
.pd-plan-sum { display: block; margin-top: 4px; font-size: 14px; line-height: 21px; color: var(--pd-ink-2); }
.pd-plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 16px; }
.pd-plan-price .pd-figure { font-size: 46px; line-height: 52px; }
.pd-plan-unit { font-size: 15px; font-weight: 500; color: var(--pd-ink-2); }
.pd-plan .pd-tags { margin-top: 8px; }
.pd-checks { list-style: none; display: grid; gap: 10px; margin-top: 16px; }
.pd-checks li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 21px; }
.pd-checks .pd-i { margin-top: 3px; color: var(--brand-text); }
.pd-plan .pd-btn { margin-top: 20px; }
.pd-bullets { list-style: none; display: grid; gap: 8px; }
.pd-bullets li { position: relative; padding-left: 14px; font-size: 14px; line-height: 21px; color: var(--pd-ink-2); }
.pd-bullets li::before { content: ''; position: absolute; left: 1px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--pd-ink-3); }
.pd-conditions { margin-top: 8px; }

/* ---------- Premios ---------- */
.pd-balance { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 20px; }
.pd-balance-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--pd-paper-2); color: var(--pd-navy); }
.pd-balance .pd-row-title { font-size: 17px; letter-spacing: -.015em; }
.pd-balance > .pd-i:last-child { color: var(--pd-ink-3); }

.pd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pd-rcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.pd-rcard + .pd-rcard { margin-top: 0; }
.pd-rcard .pd-media { height: 118px; }
.pd-rcard.is-locked .pd-media::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, .55); }
.pd-rcard-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px 12px; }
.pd-rcard .pd-card-name { font-size: 15px; line-height: 20px; letter-spacing: -.01em; min-height: 40px; }
.pd-rcard-foot { display: block; padding: 10px 14px; border-top: 1px solid var(--pd-line); font-size: 13px; font-weight: 600; color: var(--pd-ink-2); }
.pd-rcard-foot.is-ok { color: var(--pd-green-ink); }

.pd-earn { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 64px; width: 100%; text-align: left; }
.pd-earn-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--pd-paper-2); color: var(--pd-navy); }
.pd-earn > .pd-tag { margin-left: auto; }

/* ---------- Reservar ---------- */
.pd-steps { padding-bottom: 4px; }
.pd-step-sub { display: block; margin: -10px 0 14px; font-size: 13px; color: var(--pd-ink-2); }
.pd-rail--pick { padding-bottom: 6px; margin-bottom: 0; }
.pd-pick { display: flex; flex-direction: column; width: 172px; overflow: hidden; padding: 0; box-shadow: var(--pd-shadow-card), inset 0 0 0 2px transparent; }
.pd-pick .pd-media { height: 92px; }
.pd-pick-body { display: block; padding: 10px 12px 12px; }
.pd-pick-name { display: block; font-size: 14px; font-weight: 700; line-height: 18px; min-height: 36px; letter-spacing: -.01em; }
.pd-pick-meta { display: block; margin-top: 4px; font-size: 13px; color: var(--pd-ink-2); }
.pd-pick[aria-pressed="true"] { box-shadow: var(--pd-shadow-card), inset 0 0 0 2px var(--brand-text); }

.pd-cal { padding: 8px 12px 12px; }
.pd-cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 4px 6px; }
.pd-cal-month { font-size: 15px; font-weight: 700; }
.pd-cal-nav { display: flex; }
.pd-cal-nav button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--pd-navy); }
.pd-cal-nav button:disabled { opacity: .3; cursor: not-allowed; }
.pd-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.pd-cal-dow { display: grid; place-items: center; height: 28px; font-size: 12px; font-weight: 600; color: var(--pd-ink-3); }
.pd-day { display: grid; place-items: center; justify-self: center; width: 40px; height: 40px; border-radius: 12px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .15s; }
.pd-day:disabled { color: #A3AAB7; font-weight: 500; cursor: not-allowed; }
.pd-day.is-today { box-shadow: inset 0 0 0 1.5px var(--pd-line); }
.pd-day[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
@media (hover: hover) { .pd-day:not(:disabled):not([aria-pressed="true"]):hover { background: var(--pd-paper-2); } }

.pd-times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pd-time { min-height: 44px; border-radius: 12px; background: var(--pd-paper); box-shadow: var(--pd-shadow-card); font-size: 14px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; transition: background-color .15s; }
.pd-time[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.pd-empty { padding: 4px 4px 0; font-size: 14px; line-height: 21px; color: var(--pd-ink-2); }

.pd-summary { padding: 18px; }
.pd-summary-label { display: block; font-size: 13px; color: var(--pd-ink-2); }
.pd-summary-name { display: block; margin-top: 2px; font-size: 17px; font-weight: 700; line-height: 23px; letter-spacing: -.015em; }
.pd-summary-meta { display: block; margin-top: 2px; font-size: 14px; color: var(--pd-ink-2); }
.pd-summary .pd-btn { margin-top: 16px; }

/* ---------- Botones ---------- */
.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: var(--pd-r-control);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: transform .15s var(--pd-ease), background-color .2s, color .2s;
}

.pd-btn:active { transform: scale(.98); }
.pd-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.pd-btn--outline { background: transparent; color: var(--pd-navy); box-shadow: inset 0 0 0 1.5px var(--pd-navy); }
.pd-btn--quiet { min-height: 44px; background: transparent; color: var(--pd-navy); }

/* ---------- Pantallas de detalle (se deslizan por encima) ---------- */
.pd-stack { position: absolute; inset: 0; z-index: 20; pointer-events: none; }

.pd-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--pd-paper-2);
  pointer-events: auto;
  animation: pd-slide-in var(--pd-slide) both;
}

.pd-layer--photo { background: #fff; }
.pd-layer.is-leaving { animation: pd-slide-out var(--pd-slide) both; pointer-events: none; }
@keyframes pd-slide-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes pd-slide-out { from { transform: none; } to { transform: translateX(100%); } }

.pd-layer-head { position: relative; z-index: 3; flex: none; display: flex; align-items: center; gap: 12px; padding: 56px 16px 12px; background: var(--pd-paper-2); }
.pd-layer-title { min-width: 0; font-size: 20px; font-weight: 700; line-height: 26px; letter-spacing: -.02em; }
.pd-back { width: 40px; background: rgba(27, 35, 64, .08); color: var(--pd-navy); }
.pd-back--photo { position: absolute; z-index: 5; top: 56px; left: 16px; }

.pd-photo { position: relative; height: 268px; overflow: hidden; background: var(--brand-tint); }
.pd-photo picture, .pd-photo img { display: block; width: 100%; height: 100%; }
.pd-photo img { object-fit: cover; }
.pd-photo::after { content: ''; position: absolute; inset: 0 0 auto; height: 96px; background: linear-gradient(180deg, rgba(15, 23, 48, .45), rgba(15, 23, 48, 0)); pointer-events: none; }

.pd-layer--photo .pd-layer-scroll { display: flex; flex-direction: column; }
.pd-photo { flex: none; }
.pd-sheet { position: relative; flex: 1 0 auto; margin-top: -24px; padding: 24px 16px 32px; border-radius: 26px 26px 0 0; background: #fff; }
.pd-detail-title { font-size: 28px; font-weight: 700; line-height: 34px; letter-spacing: -.03em; text-wrap: balance; }
.pd-sheet > .pd-tag { margin-bottom: 12px; }
.pd-lead { margin-top: 12px; font-size: 15px; line-height: 23px; color: var(--pd-ink-2); }
.pd-mini { margin: 24px 0 12px; font-size: 17px; font-weight: 700; line-height: 23px; letter-spacing: -.015em; }
.pd-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
.pd-detail-price { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.pd-detail-points { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; }
.pd-detail-points .pd-figure { font-size: 30px; line-height: 36px; }
.pd-detail-points span:last-child { font-size: 15px; color: var(--pd-ink-2); }
.pd-detail-state { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--pd-ink-2); }
.pd-detail-state.is-ok { color: var(--pd-green-ink); }

.pd-actionbar { position: relative; z-index: 3; flex: none; padding: 12px 16px 30px; background: #fff; box-shadow: 0 -1px 0 var(--pd-line), 0 -10px 24px rgba(27, 35, 64, .05); }

.pd-layer-scroll { background: transparent; }
.pd-layer-body { padding: 4px 16px 32px; }

/* Resultados: canje hecho, reserva hecha, plan activado */
.pd-done-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); }
.pd-done-mark .pd-i { stroke-width: 2.4; }
.pd-result { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--pd-line); }
.pd-result-title { margin-top: 16px; font-size: 22px; font-weight: 700; line-height: 28px; letter-spacing: -.025em; }
.pd-result-text { margin-top: 6px; font-size: 15px; line-height: 22px; color: var(--pd-ink-2); }
.pd-code { display: grid; justify-items: center; gap: 4px; margin-top: 20px; padding: 18px 12px; border-radius: var(--pd-r-card); background: var(--brand-tint); }
.pd-code-label { font-size: 13px; color: var(--pd-ink-2); }
.pd-code-value { font-family: var(--phone-font); font-size: 34px; font-weight: 700; line-height: 40px; letter-spacing: .06em; font-variant-numeric: lining-nums; }
.pd-code--invite { margin-top: 14px; }
.pd-code--invite .pd-code-value { font-size: 28px; line-height: 34px; }

.pd-booked { padding-top: 12px; }
.pd-booked .pd-detail-title { margin-top: 20px; }
.pd-booked .pd-lead { margin-top: 6px; }
.pd-summary-list { margin-top: 24px; }
.pd-kv { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 16px; font-size: 15px; }
.pd-kv span:first-child { flex: none; color: var(--pd-ink-2); }
.pd-kv span:last-child { min-width: 0; font-weight: 600; text-align: right; }
.pd-note { margin-top: 16px; font-size: 14px; line-height: 21px; color: var(--pd-ink-2); }

/* Perfil */
.pd-profile-top { display: flex; align-items: center; gap: 16px; padding: 8px 0 4px; }
.pd-avatar { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 22px; font-weight: 700; letter-spacing: .02em; transition: background-color .2s, color .2s; }
.pd-profile-name { display: block; font-size: 22px; font-weight: 700; line-height: 28px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.pd-profile-mail { display: block; font-size: 14px; color: var(--pd-ink-2); overflow-wrap: anywhere; }
.pd-field { display: block; padding: 12px 16px; }
.pd-field-label { display: block; font-size: 13px; color: var(--pd-ink-2); }
.pd-field-value { display: block; font-size: 15px; font-weight: 600; line-height: 1.4; }
.pd-level { display: block; padding: 16px; }
.pd-level-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pd-level-name { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.pd-level-next { font-size: 13px; color: var(--pd-ink-2); text-align: right; }
.pd-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 12px; }
.pd-meter span { height: 6px; border-radius: 3px; background: var(--pd-line); }
.pd-meter span.is-on { background: var(--pd-navy); }
.pd-meter-labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 6px; font-size: 12px; color: var(--pd-ink-2); }
.pd-meter-labels span:nth-child(2) { text-align: center; }
.pd-meter-labels span:nth-child(3) { text-align: right; }

.pd-hist { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 64px; }
.pd-hist-main { flex: 1; min-width: 0; display: block; }
.pd-hist-title { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.pd-hist-meta { display: block; font-size: 13px; color: var(--pd-ink-2); }
.pd-hist-amount { flex: none; text-align: right; }
.pd-delta { display: block; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pd-delta.is-plus { color: var(--pd-green-ink); }
.pd-hist-balance { display: block; font-size: 12px; color: var(--pd-ink-2); font-variant-numeric: tabular-nums; }

.pd-note-card { display: block; width: 100%; padding: 14px 16px; text-align: left; }
.pd-note-card.is-new { box-shadow: var(--pd-shadow-card), inset 3px 0 0 var(--brand-text); }
.pd-note-title { display: block; font-size: 15px; font-weight: 700; line-height: 1.35; }
.pd-note-text { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--pd-ink-2); }
.pd-note-when { display: block; margin-top: 8px; font-size: 12px; color: var(--pd-ink-2); }

/* ---------- Aviso y pista ---------- */
.pd-toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 112px;
  z-index: 60;
  padding: 12px 14px;
  border-radius: var(--pd-r-control);
  background: var(--pd-navy-950);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 10px 24px rgba(15, 23, 48, .3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, transform .25s var(--pd-ease), visibility 0s .25s;
  pointer-events: none;
}

.pd-toast.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.pd-hint {
  position: absolute;
  left: 50%;
  bottom: 102px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 48, .84);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(15, 23, 48, .25);
  transform: translateX(-50%);
  transition: opacity .3s, visibility 0s;
  pointer-events: none;
}

.pd-hint .pd-i { animation: pd-bob 1.6s ease-in-out infinite; }
.pd-hint.is-off { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
@keyframes pd-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }

/* El móvil tiene hover real solo con ratón */
@media (hover: hover) {
  button.pd-card:hover { box-shadow: 0 6px 16px rgba(27, 35, 64, .1), 0 2px 4px rgba(27, 35, 64, .06); }
  button.pd-loyalty:hover { box-shadow: var(--pd-shadow-float), 0 0 0 2px rgba(255, 255, 255, .12); }
  .pd-avatar-btn:not(.pd-avatar-btn--photo):hover, .pd-back:not(.pd-back--photo):hover { background: rgba(27, 35, 64, .14); }
  .pd-btn:not(:disabled):not(.pd-btn--outline):not(.pd-btn--quiet):hover { filter: brightness(.94); }
}

@media (prefers-reduced-motion: reduce) {
  .pd-view, .pd-layer, .pd-layer.is-leaving { animation: none; }
  .pd-hint .pd-i { animation: none; }
  .pd-toast, .pd-hint, .pd-btn, .pd-tab, .pd-status { transition: none; }
}
