/* Booking widget for embedding in someone else's page (with js/agenda-modal.js).
   Every rule is scoped under .dp-embed so the host's styles are not touched,
   and the look comes from the custom properties below: a client theme only
   overrides them (see integrations/<cliente>/agenda-theme.css). */

.dp-embed {
  --dp-bg: #ffffff;
  --dp-surface: #f6f7f9;
  --dp-text: #15181d;
  --dp-muted: #5b6370;
  --dp-border: #dfe3e8;
  --dp-primary: #1f5fbf;
  --dp-primary-text: #ffffff;
  --dp-danger: #b42318;
  --dp-success: #1a7f37;
  --dp-whatsapp: #128c7e;
  --dp-focus: #ffbf47;
  --dp-font-body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --dp-font-heading: var(--dp-font-body);
  --dp-radius: 8px;

  color: var(--dp-text);
  font-family: var(--dp-font-body);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}
.dp-embed *, .dp-embed *::before, .dp-embed *::after { box-sizing: border-box; }

/* Modal */
.dp-embed.dp-modal {
  width: min(36rem, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  background: var(--dp-bg);
  overflow: auto;
}
.dp-embed.dp-modal::backdrop { background: rgba(0, 0, 0, 0.7); }
/* Only vertical scrolling inside the agenda; reaching the end doesn't move the page. */
.dp-embed.dp-modal { overflow-x: hidden; overscroll-behavior: contain; }
.dp-embed .dp-modal__body { padding: 28px 20px 24px; min-height: 16rem; }
.dp-embed .dp-modal__close {
  position: sticky; top: 0; float: right; z-index: 1;
  width: 44px; height: 44px; margin: 4px 4px 0 0;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--dp-muted); font-size: 28px; line-height: 1; cursor: pointer;
}
.dp-embed .dp-modal__close:hover { color: var(--dp-text); }

/* Confirmation popup (site-config.js → booking.successPopup) */
.dp-embed.dp-popup {
  width: min(26rem, calc(100vw - 32px));
  margin: auto;
  padding: 28px 24px 20px;
  border: 1px solid var(--dp-primary);
  border-radius: var(--dp-radius);
  background: var(--dp-bg);
  text-align: center;
}
.dp-embed.dp-popup::backdrop { background: rgba(0, 0, 0, 0.6); }
.dp-embed .dp-popup__text { margin: 0; font-family: var(--dp-font-heading); font-size: 1.3rem; line-height: 1.4; }
.dp-embed.dp-popup .actions { justify-content: center; }

/* Text */
.dp-embed h3, .dp-embed .booking__title { margin: 4px 0; font-family: var(--dp-font-heading); font-size: 1.5rem; font-weight: 600; line-height: 1.2; color: var(--dp-text); }
.dp-embed .booking__title:focus { outline: none; }
.dp-embed .booking__header { margin-bottom: 16px; padding-right: 40px; }
.dp-embed .booking__progress { margin: 0; color: var(--dp-muted); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.dp-embed p { margin: 0 0 8px; }
.dp-embed .hint { color: var(--dp-muted); font-size: 0.95rem; }
.dp-embed .lead { font-family: var(--dp-font-heading); font-size: 1.25rem; font-weight: 600; margin-bottom: 16px; }
.dp-embed .loading { color: var(--dp-muted); }

/* Buttons */
.dp-embed .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.dp-embed .actions--nav { justify-content: space-between; }
.dp-embed .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 8px 22px;
  border: 1px solid var(--dp-primary); border-radius: var(--dp-radius);
  background: var(--dp-primary); color: var(--dp-primary-text);
  font-family: var(--dp-font-heading); font-size: 1.05rem; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none; cursor: pointer;
}
.dp-embed .button--ghost { background: transparent; color: var(--dp-text); border-color: var(--dp-border); }
.dp-embed .button--whatsapp { background: var(--dp-whatsapp); border-color: var(--dp-whatsapp); color: #fff; }
.dp-embed .button--danger { background: var(--dp-danger); border-color: var(--dp-danger); color: #fff; }
.dp-embed .button[disabled] { opacity: 0.6; cursor: progress; }
.dp-embed .link-button { background: none; border: 0; padding: 0; color: var(--dp-primary); font: inherit; font-size: 0.95rem; text-decoration: underline; cursor: pointer; }
.dp-embed .button:focus-visible, .dp-embed a:focus-visible, .dp-embed .link-button:focus-visible,
.dp-embed .dp-modal__close:focus-visible { outline: 3px solid var(--dp-focus); outline-offset: 2px; }

/* Notices */
.dp-embed .notice { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--dp-border); border-radius: var(--dp-radius); background: var(--dp-surface); }
.dp-embed .notice--error { border-color: var(--dp-danger); }
.dp-embed .notice p:last-child { margin-bottom: 0; }

/* Choices (service, payment) */
.dp-embed .fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.dp-embed .fieldset legend { margin-bottom: 8px; padding: 0; font-weight: 600; color: var(--dp-text); }
.dp-embed .choice { position: relative; }
.dp-embed .choice input { position: absolute; opacity: 0; }
.dp-embed .choice label {
  display: flex; flex-direction: column; gap: 2px; min-height: 48px; justify-content: center;
  margin: 0; padding: 8px 14px; border: 1px solid var(--dp-border); border-radius: var(--dp-radius);
  background: transparent; color: var(--dp-text); cursor: pointer; font-size: 1rem; letter-spacing: normal; text-transform: none;
}
.dp-embed .choice input:checked + label { border-color: var(--dp-primary); background: var(--dp-surface); }
.dp-embed .choice input:focus-visible + label { outline: 3px solid var(--dp-focus); outline-offset: 2px; }
.dp-embed .choice__title { font-weight: 600; }
/* Checkbox ("Recordar mis datos"): a visible box, not a selectable card. */
.dp-embed .choice--check { display: flex; gap: 10px; align-items: flex-start; }
.dp-embed .choice--check input { position: static; opacity: 1; flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--dp-primary); }
.dp-embed .choice--check input:focus-visible { outline: 3px solid var(--dp-focus); outline-offset: 2px; }
.dp-embed .choice--check label,
.dp-embed .choice--check input:checked + label { min-height: 0; padding: 0; border: 0; background: transparent; }
.dp-embed .choice__hint { color: var(--dp-success); font-size: 0.9rem; }
/* Drink and cigar menu: name and price on one line, description below. */
.dp-embed .extras-menu + .extras-menu { margin-top: 24px; }
.dp-embed .choice__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dp-embed .choice__price { flex: none; color: var(--dp-primary); font-variant-numeric: tabular-nums; }
.dp-embed .choice--extra .hint { margin: 0; font-size: 0.9rem; }
.dp-embed .notice--deposit { border-color: var(--dp-primary); }
/* Members (D-71): "¿Eres miembro?" and the usual-order card. */
.dp-embed .member-link { margin: 0 0 12px; }
.dp-embed .member-card, .dp-embed .member-form { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--dp-primary); border-radius: var(--dp-radius); }
.dp-embed .member-card__title { margin: 0 0 6px; font-weight: 600; }

/* Membresía tab and its welcome notice (js/membership.js, D-74). */
.dp-embed.membership { max-width: 26rem; color: var(--dp-text); font-family: var(--dp-font-body); }
.dp-embed.membership .member-form { padding: 20px 18px 6px; background: var(--dp-surface); }
.dp-embed.membership .welcome { padding: 18px; }
.dp-embed .welcome__kicker { margin: 0 0 4px; color: var(--dp-success); font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; }
.dp-embed .welcome__title { margin: 0 0 10px; font-family: var(--dp-font-heading); font-size: 1.7rem; font-weight: 500; line-height: 1.2; }
.dp-embed .welcome__question { margin: 0 0 6px; font-family: var(--dp-font-heading); font-size: 1.3rem; }
.dp-embed .welcome__items { margin: 0 0 16px; color: var(--dp-muted); line-height: 1.5; }
/* Birthday gift (D-77): the message, then until when the gift waits. */
.dp-embed .welcome__birthday { margin: 0 0 8px; line-height: 1.6; }
.dp-embed .welcome__until { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--dp-border, rgba(127, 127, 127, 0.3)); color: var(--dp-success); font-size: 0.9rem; }
.dp-embed .member-card__birthday { margin: 0 0 8px; color: var(--dp-success); font-weight: 600; }
.dp-embed .member-card__gift { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--dp-border); }
.dp-embed .member-card__gift .actions { flex-wrap: wrap; }
/* Booksy's own booking window (D-79): its iframe comes 770px wide; here it fits the agenda. */
.dp-embed .booksy-window { margin: 16px 0; min-height: 200px; border-radius: 8px; overflow: hidden; background: #fff; }
.dp-embed .booksy-window iframe { display: block; width: 100% !important; max-width: 100%; border: 0; }
@media (max-width: 480px) {
  /* On a phone, edge to edge inside the agenda: Booksy needs the width. */
  .dp-embed .dp-modal__body .booksy-window { margin-left: -20px; margin-right: -20px; border-radius: 0; }
}
/* Gift left for the next booking (D-78): round gold button, bottom right, above the page. */
.dp-embed.dp-gift-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  display: grid; place-items: center; width: 58px; height: 58px; padding: 0;
  border: 0; border-radius: 50%; background: linear-gradient(145deg, #ecc983, #b68235); color: #14120f; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.dp-embed.dp-gift-fab[hidden] { display: none; }
.dp-embed.dp-gift-fab:hover { filter: brightness(1.08); }
.dp-embed.dp-gift-fab:focus-visible { outline: 3px solid var(--dp-text, #fff); outline-offset: 3px; }
@media (max-width: 480px) { .dp-embed.dp-gift-fab { right: 14px; bottom: 14px; width: 52px; height: 52px; } }
.dp-embed.dp-welcome { color: var(--dp-text); font-family: var(--dp-font-body); }
.dp-embed.dp-welcome .actions, .dp-embed.membership .welcome .actions { flex-wrap: wrap; }
.dp-embed.dp-welcome .actions .button { flex: 1 1 auto; }

/* Form fields */
.dp-embed .field { display: grid; gap: 4px; margin: 0 0 16px; }
.dp-embed .field > label, .dp-embed .field label { margin: 0; color: var(--dp-text); font-size: 0.95rem; font-weight: 600; letter-spacing: normal; text-transform: none; }
.dp-embed .field input, .dp-embed .field select, .dp-embed .field textarea {
  width: 100%; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--dp-border); border-radius: var(--dp-radius);
  background: var(--dp-surface); color: var(--dp-text); font: inherit;
}
.dp-embed .field textarea { min-height: 6rem; resize: vertical; }
.dp-embed .field input:focus-visible, .dp-embed .field select:focus-visible, .dp-embed .field textarea:focus-visible { outline: 3px solid var(--dp-focus); outline-offset: 1px; }
.dp-embed .field--error input, .dp-embed .field--error select, .dp-embed .field--error textarea { border-color: var(--dp-danger); }
.dp-embed .field__error { margin: 0; color: var(--dp-danger); font-weight: 600; }

/* Days and times */
.dp-embed .day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); gap: 8px; margin-bottom: 16px; }
.dp-embed .slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 8px; margin-bottom: 16px; }
.dp-embed .day, .dp-embed .slot {
  width: 100%; min-height: 48px; border: 1px solid var(--dp-border); border-radius: var(--dp-radius);
  background: transparent; color: var(--dp-text); font: inherit; cursor: pointer;
}
.dp-embed .day { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; line-height: 1.2; }
.dp-embed .day__weekday, .dp-embed .day__month { font-size: 0.8rem; color: var(--dp-muted); text-transform: capitalize; }
.dp-embed .day__number { font-family: var(--dp-font-heading); font-size: 1.35rem; font-weight: 700; }
.dp-embed .day:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.dp-embed .slot { padding: 8px; font-weight: 600; }
.dp-embed .day--selected, .dp-embed .slot--selected { border-color: var(--dp-primary); background: var(--dp-surface); }
.dp-embed .day:not(:disabled):hover, .dp-embed .slot:hover { border-color: var(--dp-primary); }
.dp-embed .day:focus-visible, .dp-embed .slot:focus-visible { outline: 3px solid var(--dp-focus); outline-offset: 2px; }

/* Summary */
.dp-embed .details { margin: 16px 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.dp-embed .details--compact { padding: 14px; background: var(--dp-surface); border-radius: var(--dp-radius); }
.dp-embed .details dt { color: var(--dp-muted); }
.dp-embed .details dd { margin: 0; overflow-wrap: anywhere; }

.dp-embed .sr-only, .dp-embed .honeypot {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Drink and cigar cards (js/drinks.js, D-72): small boxes, the logo in front,
   two on top and two below on every screen. */
.dp-embed .extra-menu { margin: 4px 0 22px; }
.dp-embed .extra-menu__title { margin: 0 0 10px; font-family: var(--dp-font-heading); font-size: 1.4rem; font-weight: 500; color: var(--dp-text); }
.dp-embed .extra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 24rem; }
.dp-embed .extra-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 10px;
  border: 1px solid var(--dp-border); border-radius: var(--dp-radius); background: var(--dp-surface);
  color: var(--dp-text); font: inherit; text-align: center; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dp-embed .extra-card:hover { border-color: var(--dp-primary); }
.dp-embed .extra-card:focus-visible { outline: 3px solid var(--dp-focus); outline-offset: 2px; }
.dp-embed .extra-card--selected { border: 2px solid var(--dp-primary); box-shadow: 0 0 0 1px var(--dp-primary) inset; }
.dp-embed .extra-card__logo { display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 4px; }
.dp-embed .extra-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.dp-embed .extra-logo__mark { font-family: var(--dp-font-heading); font-weight: 600; letter-spacing: 0.08em; }
.dp-embed .extra-logo__sub { font-family: var(--dp-font-body); letter-spacing: 0.16em; }
.dp-embed .extra-card__name { font-family: var(--dp-font-heading); font-size: 1rem; font-weight: 600; line-height: 1.2; }
.dp-embed .extra-card__price { color: var(--dp-success); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.dp-embed .extra-card--selected .extra-card__price::after { content: " ✓"; color: var(--dp-text); }
.dp-embed .extra-skip { margin-top: 10px; }
.dp-embed .extra-skip--selected { font-weight: 600; }
.dp-embed .extra-skip--selected::before { content: "✓ "; }
