/* Sistema de reservas. Reutiliza los tokens, botones, tipografías y el grano
   de ../styles.css; aquí solo se añade lo específico del flujo. */

.booking-body { background: var(--bg); }

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

.booking {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
}

/* ---------- Barra superior ---------- */
.booking-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px clamp(20px, 4vw, 56px) 0;
}

.booking-close {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.booking-close svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.3;
    transition: transform var(--transition) var(--ease-out);
}

.booking-close:hover svg { transform: rotate(90deg); }

/* ---------- Progreso ---------- */
.booking-progress {
    width: min(calc(100% - 40px), 760px);
    margin: 26px auto 0;
}

.booking-progress[hidden] { display: none; }

.booking-progress__label {
    margin-bottom: 12px;
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.booking-progress__bar {
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.booking-progress__bar span {
    display: block;
    height: 100%;
    width: 4%;
    background: var(--text);
    transition: width 520ms var(--ease-out);
}

.booking-progress__steps {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    list-style: none;
    gap: 6px;
}

.booking-progress__steps li {
    font-size: 0.56rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.55;
    transition: opacity var(--transition);
}

.booking-progress__steps li.is-done,
.booking-progress__steps li.is-current { opacity: 1; color: var(--text); }
.booking-progress__steps li.is-current { font-weight: 600; }

/* ---------- Escenario ---------- */
.booking-stage {
    flex: 1;
    width: min(calc(100% - 40px), 760px);
    margin: 0 auto;
    padding: clamp(28px, 6vh, 64px) 0 40px;
    outline: none;
}

.screen { width: 100%; }

.enter-forward { animation: screen-in-fwd 520ms var(--ease-out) both; }
.enter-back    { animation: screen-in-back 520ms var(--ease-out) both; }
.leave-forward { animation: screen-out-fwd 170ms ease-in both; }
.leave-back    { animation: screen-out-back 170ms ease-in both; }

@keyframes screen-in-fwd  { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes screen-in-back { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes screen-out-fwd  { to { opacity: 0; transform: translateX(-24px); } }
@keyframes screen-out-back { to { opacity: 0; transform: translateX(24px); } }

.q-title {
    margin-bottom: clamp(26px, 4vw, 42px);
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.2vw, 3.9rem);
    font-weight: 300;
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
    outline: none;
}

.q-title em { font-style: italic; color: var(--muted); }

/* ---------- Navegación inferior ---------- */
.booking-bottom {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 70%, rgba(245, 241, 236, 0));
}

.booking-bottom[hidden] { display: none; }

.booking-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: min(calc(100% - 40px), 760px);
    margin: 0 auto;
}

.booking-nav .button { min-width: 140px; cursor: pointer; }
.booking-nav .button--dark { margin-left: auto; }
.booking-nav .button--light { background: transparent; color: var(--text); }
.booking-nav .button--light:hover { color: #fff; background: var(--text); }

.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.button.is-loading { gap: 12px; }

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tarjetas de servicio ---------- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    border: 0;
}

.service-card { display: block; cursor: pointer; }
.service-card input { position: absolute; opacity: 0; pointer-events: none; }

.service-card__body {
    position: relative;
    display: flex;
    min-height: 230px;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition) var(--ease-out), box-shadow var(--transition);
}

.service-card:hover .service-card__body { transform: translateY(-3px); box-shadow: var(--shadow); }

.service-card__icon svg {
    width: 30px;
    height: 30px;
    margin-bottom: auto;
    stroke-width: 1.2;
}

.service-card__icon { display: block; margin-bottom: 36px; }

.service-card__title {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.service-card__text {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--muted);
    transition: color var(--transition);
}

.service-card__check {
    position: absolute;
    top: 22px;
    right: 22px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity var(--transition), transform var(--transition) var(--ease-out);
}

.service-card__check svg { width: 15px; height: 15px; stroke-width: 2; }

.service-card input:checked + .service-card__body {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.service-card input:checked + .service-card__body .service-card__text { color: rgba(255, 255, 255, 0.7); }
.service-card input:checked + .service-card__body .service-card__check { opacity: 1; transform: none; }
.service-card input:focus-visible + .service-card__body { outline: 2px solid var(--text); outline-offset: 4px; }

/* ---------- Avisos ---------- */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 26px;
    padding: 18px 20px;
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    line-height: 1.6;
}

.notice svg { flex: none; width: 22px; height: 22px; margin-top: 1px; stroke-width: 1.4; }
.notice strong { font-weight: 600; }
.notice small { color: var(--muted); }
.notice--demo { background: #fbf3dc; border-color: rgba(120, 90, 10, 0.25); margin-top: 0; margin-bottom: 22px; }

.demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: -10px 0 26px;
    padding: 8px 14px;
    background: #fbf3dc;
    border: 1px solid rgba(120, 90, 10, 0.25);
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.4;
}

.demo-badge span { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #b98a14; }
.demo-badge--block { display: flex; border-radius: var(--radius-sm); margin: 22px 0 0; }

/* ---------- Campos ---------- */
.field { position: relative; }

.field__label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.optional { font-weight: 400; letter-spacing: 0.06em; text-transform: none; color: var(--muted); }

.field__control { position: relative; }

.field input,
.field textarea {
    width: 100%;
    padding: 18px 52px 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 300;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field textarea { padding-right: 20px; resize: vertical; min-height: 150px; line-height: 1.55; font-size: 1rem; }

.field input::placeholder,
.field textarea::placeholder { color: rgba(23, 23, 23, 0.35); }

.field input:focus,
.field textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.08); }

.field__ok {
    position: absolute;
    top: 50%;
    right: 18px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2f7a4d;
    color: #fff;
    opacity: 0;
    transform: translateY(-50%) scale(0.6);
    transition: opacity var(--transition), transform var(--transition) var(--ease-out);
}

.field__ok svg { width: 13px; height: 13px; stroke-width: 2.4; }
.field.is-valid .field__ok { opacity: 1; transform: translateY(-50%); }
.field.is-valid input,
.field.is-valid textarea { border-color: rgba(47, 122, 77, 0.55); }
.field.is-invalid input,
.field.is-invalid textarea { border-color: #b3261e; box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.1); }

.field__row { display: flex; justify-content: space-between; gap: 16px; }
.field__count { margin-top: 10px; font-size: 0.7rem; color: var(--muted); white-space: nowrap; }

.field__hint { margin-top: 10px; font-size: 0.78rem; color: var(--muted); }

.field-error {
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #b3261e;
}

.field-error[hidden] { display: none; }

/* ---------- Subida de archivos ---------- */
.uploader { margin-top: 34px; }

.dropzone {
    position: relative;
    border: 1px dashed rgba(23, 23, 23, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.5);
    transition: background var(--transition), border-color var(--transition);
}

.dropzone.is-over,
.dropzone.is-focus { background: #fff; border-color: var(--text); }
.dropzone.is-focus { outline: 2px solid var(--text); outline-offset: 4px; }

.dropzone__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 26px 20px;
    font-size: 0.86rem;
    text-align: center;
    cursor: pointer;
}

.dropzone__label svg { flex: none; width: 24px; height: 24px; stroke-width: 1.3; }
.dropzone__label strong { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.file-list { margin-top: 16px; display: grid; gap: 10px; list-style: none; }

.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: screen-in-fwd 360ms var(--ease-out) both;
}

.file-item__thumb,
.file-item__icon {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
}

.file-item__icon {
    display: grid;
    place-items: center;
    background: var(--surface-soft);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.file-item__meta { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.file-item__name { overflow: hidden; font-size: 0.86rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.file-item__size { font-size: 0.72rem; color: var(--muted); }

.file-item__remove {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.file-item__remove:hover { border-color: var(--text); }
.file-item__remove svg { width: 16px; height: 16px; stroke-width: 1.6; }

/* ---------- Calendario ---------- */
.datetime {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(20px, 4vw, 44px);
    align-items: start;
}

.calendar {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.calendar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }

.calendar__title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 300;
    letter-spacing: -0.01em;
}

.calendar__nav {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.calendar__nav svg { width: 18px; height: 18px; stroke-width: 1.6; }
.calendar__nav:hover:not(:disabled) { background: var(--text); color: #fff; border-color: var(--text); }
.calendar__nav:disabled { opacity: 0.3; cursor: not-allowed; }

.calendar__week,
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.calendar__week span {
    padding-bottom: 8px;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.calendar__grid { transition: opacity var(--transition); }
.calendar__grid.is-loading { opacity: 0.45; }

.day {
    width: 100%;
    max-width: 48px;
    justify-self: center;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    min-height: 40px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--text);
    font-size: 0.86rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.day--empty { pointer-events: none; }
.day:disabled { color: rgba(23, 23, 23, 0.25); cursor: not-allowed; }
.day.has-slots { font-weight: 500; border-color: var(--border); }
.day.has-slots:hover { border-color: var(--text); }
.day.is-selected { background: var(--text); color: #fff; border-color: var(--text); }

.slots__title {
    margin-bottom: 18px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.2;
}

.slots__empty { font-size: 0.86rem; color: var(--muted); }

.slots__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }

.slot {
    min-height: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.slot:hover { border-color: var(--text); }
.slot.is-selected { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- Resumen ---------- */
.summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.summary__row {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    align-items: baseline;
    gap: 6px 18px;
    padding: 16px 22px;
}

.summary__row + .summary__row { border-top: 1px solid var(--border); }
.summary dt { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.summary dd { min-width: 0; font-size: 0.92rem; overflow-wrap: anywhere; }
.summary dd strong { font-weight: 600; }
.summary__text { white-space: pre-wrap; }
.summary__none { color: var(--muted); }
.summary__files { list-style: none; display: grid; gap: 4px; }
.summary__files small { color: var(--muted); margin-left: 6px; }
.summary small { color: var(--muted); }

.summary__edit {
    padding: 6px 2px;
    background: none;
    border: 0;
    border-bottom: 1px solid currentColor;
    color: var(--text);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    line-height: 1.2;
}

.summary__edit:hover { color: var(--muted); }

/* ---------- Consentimientos ---------- */
.consents { margin-top: 30px; display: grid; gap: 14px; border: 0; }

.check { position: relative; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; font-size: 0.88rem; line-height: 1.55; }
.check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }

.check__box {
    flex: none;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    background: var(--surface);
    border: 1px solid rgba(23, 23, 23, 0.4);
    border-radius: 6px;
    color: #fff;
    transition: background var(--transition), border-color var(--transition);
}

.check__box svg { width: 14px; height: 14px; stroke-width: 2.6; opacity: 0; transform: scale(0.6); transition: opacity var(--transition), transform var(--transition) var(--ease-out); }
.check input:checked + .check__box { background: var(--text); border-color: var(--text); }
.check input:checked + .check__box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { outline: 2px solid var(--text); outline-offset: 3px; }
.check__text em { color: var(--muted); font-style: normal; }

/* ---------- Pago ---------- */
.pay-card {
    padding: clamp(22px, 4vw, 34px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.pay-card__amount {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
}

.pay-card__amount span { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.pay-card__amount strong { font-family: var(--font-display); font-size: clamp(2.6rem, 8vw, 3.8rem); font-weight: 300; line-height: 1; letter-spacing: -0.03em; }
.pay-card__note { margin-bottom: 20px; font-size: 0.84rem; color: var(--muted); }
.pay-card .summary { border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.pay-card .summary__row { padding-inline: 0; grid-template-columns: 130px 1fr; }

.pay-error {
    margin-top: 18px;
    padding: 16px 20px;
    background: #fbeceb;
    border: 1px solid rgba(179, 38, 30, 0.3);
    border-radius: var(--radius-sm);
    color: #8c1d18;
    font-size: 0.86rem;
}

.pay-error[hidden] { display: none; }
.pay-error .text-link { margin-top: 10px; background: none; border: 0; color: inherit; cursor: pointer; }

/* ---------- Confirmación ---------- */
.success { text-align: center; margin-bottom: 34px; }
.success .q-title { margin-bottom: 14px; }
.success__lead { color: var(--muted); font-size: 0.98rem; }

.success__mark {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 26px;
    background: var(--text);
    border-radius: 50%;
    color: #fff;
    animation: pop 700ms var(--ease-out) both;
}

.success__mark svg { width: 32px; height: 32px; stroke-width: 1.8; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 600ms 350ms ease-out forwards; }

@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.ticket {
    display: grid;
    grid-template-columns: 1fr 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ticket .summary { border: 0; border-radius: 0; background: transparent; }
.ticket .summary__row { grid-template-columns: 90px 1fr; }

.ticket__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 26px;
    border-left: 1px dashed rgba(23, 23, 23, 0.3);
    background: var(--surface-warm);
}

.qr { width: 164px; padding: 10px; background: #fff; border-radius: 10px; line-height: 0; }
.qr svg { width: 100%; height: auto; }
.qr__fallback { display: block; padding: 8px; font-size: 0.72rem; line-height: 1.5; text-align: center; }
.ticket__caption { font-size: 0.7rem; text-align: center; color: var(--muted); line-height: 1.5; }
.booking-id { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.04em; overflow-wrap: anywhere; }

.success__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px; margin-top: 30px; }
.success__actions .text-link { background: none; border: 0; color: var(--text); cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .booking-top { padding-top: 18px; }
    .booking-progress__steps { display: none; }
    .booking-stage { padding-top: 24px; }

    .service-grid { grid-template-columns: 1fr; gap: 12px; }
    .service-card__body { min-height: 150px; padding: 22px; }
    .service-card__icon { margin-bottom: 22px; }

    .datetime { grid-template-columns: 1fr; }
    .calendar { padding: 16px; }

    .summary__row { grid-template-columns: 1fr auto; padding: 14px 18px; }
    .summary dt { grid-column: 1 / -1; }
    .summary dd { grid-column: 1; }
    .summary__edit { grid-column: 2; grid-row: 2; }
    .pay-card .summary__row { grid-template-columns: 1fr; }
    .ticket .summary__row { grid-template-columns: 1fr; }

    .ticket { grid-template-columns: 1fr; }
    .ticket__qr { border-left: 0; border-top: 1px dashed rgba(23, 23, 23, 0.3); }

    .booking-nav .button { min-width: 0; flex: 1; padding-inline: 16px; }
    .booking-nav .button--dark { margin-left: 0; }
    .field input { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .enter-forward, .enter-back, .leave-forward, .leave-back, .file-item,
    .success__mark, .success__mark svg { animation: none !important; }
    .success__mark svg { stroke-dashoffset: 0; }
    .booking-progress__bar span { transition: none; }
}
