/* Reserva de turnos de Elbi dentro del portal.
   Viven en el shell (html/index.html), así que esta hoja se carga desde ahí
   y el router no la borra.

   La estructura copia el flujo público de Elbi (/:tagUrl/booking): stepper
   con círculos, tarjetas de servicio con foto, calendario, grilla de
   horarios y botones apilados.
   Los colores son los de Lubricantes Alvear en lugar del azul de Elbi. */

:root {
    --r-rojo: #bb1e1e;
    --r-rojo-claro: #e04a3a;
    --r-rojo-oscuro: #8f1616;
    --r-rojo-tinte: rgba(187, 30, 30, 0.08);
    --r-rojo-anillo: rgba(187, 30, 30, 0.2);
    --r-texto: #232323;
    --r-texto-2: #4a4642;
    --r-texto-3: #8a847d;
    --r-borde: #e6e2dc;
    --r-fondo: #ffffff;
    --r-fondo-2: #f7f5f2;
    --r-fondo-3: #efece7;
    --r-degrade: linear-gradient(90deg, var(--r-rojo) 0%, var(--r-rojo-claro) 100%);
    --r-degrade-hover: linear-gradient(90deg, var(--r-rojo-oscuro) 0%, var(--r-rojo) 100%);
    --r-sombra: 0 10px 15px -3px rgba(28, 25, 23, 0.1), 0 4px 6px -2px rgba(28, 25, 23, 0.05);
}

html[data-tema="oscuro"] {
    --r-texto: var(--o-texto);
    --r-texto-2: var(--o-texto-2);
    --r-texto-3: var(--o-texto-3);
    --r-borde: var(--o-borde);
    --r-fondo: var(--o-superficie);
    --r-fondo-2: var(--o-superficie-2);
    --r-fondo-3: var(--o-hover);
    --r-rojo-tinte: rgba(242, 109, 109, 0.12);
    --r-sombra: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* ---------- Botón flotante "Reservar turno" ---------- */

.unet-reservar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--r-degrade);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.unet-reservar .unet-svg {
    width: 22px;
    height: 22px;
}

.unet-reservar:hover,
.unet-reservar:focus {
    color: #fff;
    background: var(--r-degrade-hover);
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
}

.unet-reservar:focus-visible {
    outline: 2px solid var(--r-rojo);
    outline-offset: 3px;
}

.unet-reservar:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    .unet-reservar {
        gap: 7px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .unet-reservar .unet-svg {
        width: 20px;
        height: 20px;
    }
}

/* ---------- Shell del modal ---------- */

.reserva[hidden] {
    display: none;
}

.reserva {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(16px, env(safe-area-inset-top, 0px))
        max(16px, env(safe-area-inset-right, 0px))
        max(16px, env(safe-area-inset-bottom, 0px))
        max(16px, env(safe-area-inset-left, 0px));
}

/* En mobile: sin la demora del doble toque ni el resaltado gris de Android
   (cada control ya tiene su propio :hover/:active). */
.reserva button,
.reserva input,
.reserva select,
.reserva textarea,
.reserva a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.reserva-fondo {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(28, 25, 23, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.reserva-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(600px, 100%);
    height: auto;
    max-height: min(900px, 100%);
    overflow: hidden;
    background: var(--r-fondo);
    color: var(--r-texto);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.3);
    animation: reserva-aparece 0.25s ease-out;
}

@media (min-width: 720px) {
    .reserva {
        padding: 24px;
    }
}

@keyframes reserva-aparece {
    from { transform: translateY(8px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.reserva-cabeza {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 0;
}

.reserva-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--r-texto-3);
}

.reserva-cabeza h2 {
    margin: 0;
    text-wrap: balance;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--r-texto);
}

.reserva-cabeza h2:focus {
    outline: none;
}

.reserva-cabeza h2:focus-visible {
    outline: 2px solid var(--r-rojo);
    outline-offset: 4px;
    border-radius: 4px;
}

.reserva-subtitulo {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--r-texto-2);
}

.reserva-subtitulo:empty {
    display: none;
}

.reserva-x {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--r-fondo-2);
    color: var(--r-texto-2);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.reserva-x:hover {
    background: var(--r-fondo-3);
}

.reserva-x:focus-visible {
    outline: 2px solid var(--r-rojo);
    outline-offset: 2px;
}

.reserva-x .unet-svg {
    width: 20px;
    height: 20px;
}

/* ---------- Stepper (BookingTimeline de Elbi) ---------- */

.reserva-pasos {
    --avance: 0;
    position: relative;
    display: flex;
    margin: 0;
    padding: 16px 12px 0;
    list-style: none;
}

.reserva-pasos:empty {
    display: none;
}

/* la línea gris de fondo y la roja que avanza, entre el primer y el último círculo */
.reserva-pasos::before,
.reserva-pasos::after {
    content: "";
    position: absolute;
    top: 32px;
    left: calc(12px + (100% - 24px) * 0.125);
    height: 2px;
    border-radius: 2px;
}

.reserva-pasos::before {
    right: calc(12px + (100% - 24px) * 0.125);
    background: var(--r-borde);
}

.reserva-pasos::after {
    width: calc((100% - 24px) * 0.75 * var(--avance));
    background: var(--r-rojo);
    transition: width 0.5s ease;
}

.reserva-paso {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.reserva-paso-circulo {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 2px solid var(--r-borde);
    border-radius: 999px;
    background: var(--r-fondo);
    color: var(--r-texto-3);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.reserva-paso-circulo svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reserva-paso.is-hecho .reserva-paso-circulo,
.reserva-paso.is-actual .reserva-paso-circulo {
    border-color: var(--r-rojo);
    background: var(--r-rojo);
    color: #fff;
}

.reserva-paso.is-actual .reserva-paso-circulo {
    box-shadow: 0 0 0 4px var(--r-rojo-anillo);
}

.reserva-paso-nombre {
    max-width: 100%;
    font-size: 12px;
    font-weight: 600;
    color: var(--r-texto-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reserva-paso.is-hecho .reserva-paso-nombre {
    color: var(--r-texto-2);
}

.reserva-paso.is-actual .reserva-paso-nombre {
    color: var(--r-rojo);
}

/* ---------- Ficha del servicio elegido (pasos 2 a 4) ---------- */

.reserva-seleccion {
    padding: 14px 20px 0;
}

.reserva-seleccion[hidden] {
    display: none;
}

.reserva-ficha {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--r-borde);
    border-radius: 16px;
    background: var(--r-fondo-2);
}

.reserva-ficha-foto {
    width: 64px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 12px;
    object-fit: cover;
}

.reserva-ficha-datos {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.reserva-ficha-datos strong {
    max-width: 100%;
    font-size: 15px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reserva-ficha-meta,
.reserva-ficha-turno {
    font-size: 13px;
    color: var(--r-texto-2);
    font-variant-numeric: tabular-nums;
}

.reserva-ficha-meta b {
    color: var(--r-rojo);
}

.reserva-ficha-turno {
    font-weight: 600;
    color: var(--r-texto);
}

.reserva-ficha-cambiar {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--r-rojo);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.reserva-ficha-cambiar:hover {
    background: var(--r-rojo-tinte);
}

.reserva-ficha-cambiar:focus-visible {
    outline: 2px solid var(--r-rojo);
    outline-offset: 2px;
}

/* pill de tipo: los mismos tres colores que Elbi, porque dicen algo */
.reserva-tipo-pill {
    padding: 2px 10px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.reserva-tipo-pill.is-presencial {
    background: #fbe9e7;
    color: #8f1616;
    border-color: #f4c7c1;
}

.reserva-tipo-pill.is-online {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.reserva-tipo-pill.is-domicilio {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

/* ---------- Cuerpo y botones ---------- */

.reserva-cuerpo {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 16px 20px 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.reserva-cuerpo.is-entrando > * {
    animation: reserva-paso-entra 0.35s ease-out;
}

@keyframes reserva-paso-entra {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.reserva-acciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 20px 0;
    border-top: 1px solid var(--r-borde);
}

.reserva-aviso-acciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.reserva-aviso-acciones[hidden] {
    display: none;
}

.reserva-btn-wsp {
    border: 0;
    background-color: #25d366;
    color: #fff;
    text-decoration: none;
}

.reserva-btn-wsp .unet-svg {
    width: 22px;
    height: 22px;
}

.reserva-btn-wsp:hover,
.reserva-btn-wsp:focus {
    color: #fff;
    text-decoration: none;
    background-color: #20bd5a;
}

.reserva-btn-wsp:focus-visible {
    outline: 2px solid #128c7e;
    outline-offset: 2px;
}

.reserva-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--r-sombra);
    /* sin transición de background: un degradé no se interpola y en el
       medio el botón quedaba un instante blanco con el texto blanco */
    transition: transform 0.15s ease, color 0.2s ease, opacity 0.15s ease;
}

.reserva-btn[hidden] {
    display: none;
}

.reserva-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.reserva-btn:disabled {
    cursor: not-allowed;
}

.reserva-btn:focus-visible {
    outline: 2px solid var(--r-rojo);
    outline-offset: 2px;
}

.reserva-btn-pri {
    border: 0;
    background: var(--r-degrade);
    color: #fff;
}

.reserva-btn-pri:hover:not(:disabled) {
    background: var(--r-degrade-hover);
}

.reserva-btn-pri:disabled,
.reserva-btn-pri.is-apagado,
.reserva-btn-pri.is-apagado:hover:not(:disabled) {
    background: #9ca3af;
}

.reserva-btn-elbi {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.reserva-btn-pri:hover:not(:disabled) .reserva-btn-elbi {
    transform: scale(1.3);
}

.reserva-btn-sec {
    border: 2px solid var(--r-rojo);
    background: var(--r-fondo);
    color: var(--r-rojo);
    font-weight: 600;
}

.reserva-btn-sec:hover:not(:disabled) {
    background: var(--r-rojo);
    color: #fff;
}

.reserva-btn-peligro {
    border: 0;
    background: linear-gradient(90deg, #b91c1c 0%, #dc2626 100%);
    color: #fff;
}

.reserva-powered {
    margin: 10px 20px 14px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: var(--r-texto-3);
}

/* ---------- Estados ---------- */

.reserva-estado {
    padding: 24px 12px;
    text-align: center;
    color: var(--r-texto-2);
    text-wrap: pretty;
}

.reserva-estado p {
    max-width: 36ch;
    margin: 12px auto 0;
}

.reserva-estado .reserva-estado-alt {
    font-size: 13px;
    color: var(--r-texto-3);
}

.reserva-estado-elbi {
    width: 120px;
    height: 120px;
    animation: reserva-flota 3s ease-in-out infinite;
}

@keyframes reserva-flota {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.reserva-vacio {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 28px 12px;
    text-align: center;
    color: var(--r-texto-3);
    font-size: 14px;
}

.reserva-vacio strong {
    font-size: 16px;
    color: var(--r-texto-2);
}

.reserva-esqueleto {
    pointer-events: none;
}

.reserva-esqueleto .reserva-card-media,
.reserva-linea {
    background: linear-gradient(90deg, var(--r-fondo-3) 0%, var(--r-fondo-2) 50%, var(--r-fondo-3) 100%);
    background-size: 200% 100%;
    animation: reserva-brillo 1.2s ease-in-out infinite;
}

.reserva-linea {
    display: block;
    width: 70%;
    height: 12px;
    margin: 6px 0;
    border-radius: 6px;
}

.reserva-linea.is-corta {
    width: 40%;
}

@keyframes reserva-brillo {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

.reserva-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: -4px;
    border: 2px solid var(--r-borde);
    border-bottom-color: var(--r-rojo);
    border-radius: 999px;
    animation: reserva-gira 0.8s linear infinite;
}

@keyframes reserva-gira {
    to { transform: rotate(360deg); }
}

/* ---------- Paso 1: filtros y tarjetas de servicio ---------- */

.reserva-herramientas {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

@media (min-width: 560px) {
    .reserva-herramientas {
        flex-direction: row;
    }

    .reserva-herramientas > * {
        flex: 1;
    }
}

.reserva-buscar-caja {
    position: relative;
    display: block;
    margin: 0;
}

.reserva-buscar-caja .unet-svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--r-texto-3);
    pointer-events: none;
}

.reserva-buscar-caja .reserva-buscar {
    padding-left: 38px;
}

.reserva-buscar,
.reserva-filtro,
.reserva-campo input,
.reserva-campo textarea,
.reserva-campo select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--r-borde);
    border-radius: 10px;
    background: var(--r-fondo);
    color: var(--r-texto);
    font-family: inherit;
    font-size: 15px;
    padding: 10px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.reserva-buscar:hover,
.reserva-filtro:hover,
.reserva-campo input:hover,
.reserva-campo select:hover {
    border-color: rgba(187, 30, 30, 0.4);
}

.reserva-buscar:focus,
.reserva-filtro:focus,
.reserva-campo input:focus,
.reserva-campo textarea:focus,
.reserva-campo select:focus {
    outline: none;
    border-color: var(--r-rojo);
    box-shadow: 0 0 0 3px var(--r-rojo-anillo);
}

.reserva-servicios {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 560px) {
    .reserva-servicios {
        grid-template-columns: 1fr 1fr;
    }

    /* Un solo servicio: misma medida que una columna, pero en el medio. */
    .reserva-servicios:has(> .reserva-card:only-child) {
        grid-template-columns: calc((100% - 14px) / 2);
        justify-content: center;
    }
}

.reserva-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(187, 30, 30, 0.12);
    border-radius: 16px;
    background: var(--r-fondo);
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 6px 16px -6px rgba(28, 25, 23, 0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.reserva-card:hover {
    transform: scale(1.02);
    border-color: rgba(187, 30, 30, 0.35);
    box-shadow: 0 16px 32px -10px rgba(143, 22, 22, 0.35);
}

.reserva-card:active {
    transform: scale(0.99);
}

.reserva-card:focus-visible {
    outline: 2px solid var(--r-rojo);
    outline-offset: 3px;
}

.reserva-card.is-elegido {
    border-color: var(--r-rojo);
    box-shadow: 0 0 0 2px var(--r-rojo);
}

.reserva-card-media {
    position: relative;
    display: block;
    height: 128px;
    overflow: hidden;
    background: #2a2624;
}

.reserva-card-foto {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.reserva-card:hover .reserva-card-foto {
    transform: scale(1.1);
}

.reserva-card-foto.is-vacia {
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 20%, #4a2020 0%, #231a19 70%);
    color: rgba(255, 255, 255, 0.55);
}

.reserva-ficha-foto.is-vacia {
    display: grid;
    place-items: center;
    background: var(--r-rojo-tinte);
    color: var(--r-rojo);
}

.reserva-card-foto.is-vacia .unet-svg {
    width: 44px;
    height: 44px;
    stroke-width: 1.4;
}

.reserva-ficha-foto.is-vacia .unet-svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.6;
}

.reserva-card-velo {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.15) 60%, rgba(0, 0, 0, 0.25) 100%);
}

.reserva-card-tipo {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    background: var(--r-degrade);
}

.reserva-card-tipo.is-online {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.reserva-card-tipo.is-domicilio {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.reserva-card-dias {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 2px;
    padding: 3px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.reserva-card-dias i {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: var(--r-degrade);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.reserva-card-titulo {
    position: absolute;
    right: 12px;
    bottom: 10px;
    left: 12px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.reserva-card-cuerpo {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 14px;
}

.reserva-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    color: var(--r-texto-2);
}

.reserva-card-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.reserva-card-duracion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--r-texto-2);
    font-variant-numeric: tabular-nums;
}

.reserva-card-duracion .unet-svg {
    width: 16px;
    height: 16px;
}

.reserva-precio {
    font-size: 16px;
    font-weight: 700;
    color: var(--r-texto);
    font-variant-numeric: tabular-nums;
}

/* ---------- Campos ---------- */

.reserva-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.reserva-campo label,
.reserva-etiqueta {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--r-texto);
}

.reserva-campo textarea {
    resize: none;
}

.reserva-profesional-unico {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--r-borde);
    border-radius: 10px;
    background: var(--r-fondo-2);
    font-size: 15px;
}

.reserva-error {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #b91c1c;
}

.reserva-error-caja {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(185, 28, 28, 0.07);
}

.reserva-campo input[aria-invalid="true"] {
    border-color: #dc2626;
}

.reserva-ayuda {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    padding: 10px 12px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: rgba(255, 251, 235, 0.95);
    color: #92400e;
    font-size: 13px;
}

/* Alerta sobre el paso 1 (orden de llegada): tapa el panel sin ocultar el flujo. */
.reserva-alerta-orden {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 28px;
    pointer-events: auto;
}

.reserva-alerta-orden[hidden] {
    display: none !important;
}

.reserva-alerta-orden-fondo {
    position: absolute;
    inset: 0;
    background: rgba(28, 25, 23, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

html[data-tema="oscuro"] .reserva-alerta-orden-fondo {
    background: rgba(0, 0, 0, 0.65);
}

.reserva-alerta-orden-caja {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(100%, 440px);
    padding: 4px 2px 0;
    animation: reserva-alerta-aparece 0.22s ease-out;
}

.reserva-alerta-peligro {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 16px 18px;
    border: 2px solid var(--r-rojo);
    border-radius: 16px;
    /* Fondo negro sólido: translúcido no se leía sobre el flujo difuminado. */
    background: #111111;
    color: #fca5a5;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    box-shadow: 0 0 0 1px var(--r-rojo-anillo), var(--r-sombra);
}

.reserva-alerta-peligro .unet-svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html[data-tema="oscuro"] .reserva-alerta-peligro {
    border-color: #f26d6d;
    background: linear-gradient(180deg, rgba(187, 30, 30, 0.35) 0%, rgba(120, 20, 20, 0.28) 100%);
    color: #fecaca;
    box-shadow: 0 0 0 1px rgba(242, 109, 109, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
}

@keyframes reserva-alerta-aparece {
    from { transform: translateY(6px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.reserva-alerta-orden-caja .reserva-btn {
    width: 100%;
    justify-content: center;
}

.reserva-panel.is-orden-pendiente .reserva-pasos,
.reserva-panel.is-orden-pendiente .reserva-seleccion,
.reserva-panel.is-orden-pendiente .reserva-cuerpo,
.reserva-panel.is-orden-pendiente .reserva-acciones,
.reserva-panel.is-orden-pendiente .reserva-powered {
    pointer-events: none;
    user-select: none;
}

.reserva-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: rgba(239, 246, 255, 0.95);
    color: #1e40af;
    font-size: 14px;
    line-height: 1.45;
}

.reserva-info .unet-svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.reserva-horas-sin {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reserva-horas-sin .reserva-horas-vacio {
    padding: 20px 12px;
}

.reserva-ayuda .unet-svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.reserva-nota-ayuda {
    margin: 0;
    font-size: 12px;
    color: var(--r-texto-3);
}

/* WhatsApp: un solo recuadro; el país se elige con el mouse (fuera del tab). */
.reserva-tel {
    display: flex;
    align-items: stretch;
    min-height: 44px;
    border: 1px solid var(--r-borde);
    border-radius: 10px;
    background: var(--r-fondo);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.reserva-tel:hover {
    border-color: rgba(187, 30, 30, 0.4);
}

.reserva-tel:focus-within {
    border-color: var(--r-rojo);
    box-shadow: 0 0 0 3px var(--r-rojo-anillo);
}

.reserva-tel:has(input[aria-invalid="true"]) {
    border-color: #dc2626;
}

.reserva-tel-pais {
    flex-shrink: 0;
    width: auto;
    min-width: 5.75rem;
    max-width: none;
    margin: 0;
    padding: 8px 26px 8px 12px;
    border: 0;
    border-right: 1px solid var(--r-borde);
    border-radius: 0;
    background: transparent;
    color: var(--r-texto);
    font-family: inherit;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a847d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    box-shadow: none;
}

.reserva-tel-pais:focus {
    outline: none;
    box-shadow: none;
}

.reserva-tel input {
    flex: 1;
    min-width: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.reserva-tel input:focus {
    border-color: transparent;
    box-shadow: none;
}

.reserva-campo .reserva-tel input:hover,
.reserva-campo .reserva-tel .reserva-tel-pais:hover {
    border-color: transparent;
    box-shadow: none;
}

.reserva-campo .reserva-tel input[aria-invalid="true"] {
    border-color: transparent;
}

.reserva-campo .reserva-tel .reserva-tel-pais,
.reserva-campo .reserva-tel input {
    width: auto;
    min-height: 0;
    border-radius: 0;
}

.reserva-campo .reserva-tel input {
    width: 100%;
    flex: 1;
}

/* ---------- Paso 2: fecha, calendario y horarios ---------- */

.reserva-fecha-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--r-borde);
    border-radius: 10px;
    background: var(--r-fondo);
    color: var(--r-texto);
    font-family: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.reserva-fecha-btn:hover {
    border-color: rgba(187, 30, 30, 0.4);
    background: var(--r-fondo-2);
}

.reserva-fecha-btn:focus-visible {
    outline: none;
    border-color: var(--r-rojo);
    box-shadow: 0 0 0 3px var(--r-rojo-anillo);
}

.reserva-fecha-btn.is-vacia span:not(.reserva-fecha-flecha) {
    color: var(--r-texto-3);
}

.reserva-fecha-btn .unet-svg {
    width: 18px;
    height: 18px;
    color: var(--r-rojo);
}

.reserva-fecha-flecha {
    margin-left: auto;
    font-size: 22px;
    line-height: 1;
    color: var(--r-texto-3);
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}

.reserva-fecha-btn[aria-expanded="true"] .reserva-fecha-flecha {
    transform: rotate(-90deg);
}

.reserva-calendario {
    margin-top: 6px;
    padding: 12px;
    border: 1px solid var(--r-borde);
    border-radius: 16px;
    background: var(--r-fondo);
    box-shadow: var(--r-sombra);
    animation: reserva-paso-entra 0.2s ease-out;
}

.reserva-cal-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.reserva-cal-nav strong {
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
}

.reserva-cal-nav button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--r-borde);
    border-radius: 10px;
    background: var(--r-fondo);
    color: var(--r-texto);
    font-family: inherit;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.reserva-cal-nav button:hover:not(:disabled) {
    background: var(--r-fondo-2);
}

.reserva-cal-nav button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.reserva-cal-cabeza,
.reserva-cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.reserva-cal-cabeza span {
    padding-bottom: 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--r-texto-3);
}

.reserva-dia,
.reserva-dia-vacio {
    height: 42px;
}

.reserva-dia {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--r-texto);
    font-family: inherit;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.reserva-dia:hover {
    background: var(--r-rojo-tinte);
    color: var(--r-rojo);
}

.reserva-dia.is-hoy {
    border: 1px solid rgba(187, 30, 30, 0.35);
    background: var(--r-rojo-tinte);
    color: var(--r-rojo);
    font-weight: 600;
}

/* sin atención ese día (Elbi: gris tachado) */
.reserva-dia.is-cerrado {
    background: rgba(156, 163, 175, 0.12);
    color: #6b7280;
    text-decoration: line-through;
    opacity: 0.7;
    cursor: help;
}

/* licencia o día lleno (Elbi: rojo tachado) */
.reserva-dia.is-ocupado {
    background: rgba(220, 38, 38, 0.15);
    color: #b91c1c;
    font-weight: 700;
    text-decoration: line-through;
    opacity: 0.7;
    cursor: help;
}

.reserva-dia.is-pasado {
    color: var(--r-texto-3);
    opacity: 0.45;
    cursor: default;
}

.reserva-dia.is-pasado:hover {
    background: transparent;
}

.reserva-dia.is-sel,
.reserva-dia.is-sel:hover {
    background: var(--r-rojo);
    color: #fff;
    font-weight: 600;
    opacity: 1;
    box-shadow: var(--r-sombra);
}

.reserva-dia:focus-visible,
.reserva-hora:focus-visible,
.reserva-cal-nav button:focus-visible {
    outline: 2px solid var(--r-rojo);
    outline-offset: 2px;
}

.reserva-aviso {
    margin: 0;
    font-size: 13px;
    color: #b91c1c;
}

.reserva-aviso:empty {
    display: none;
}

#reserva-horas-titulo {
    scroll-margin-top: 12px;
}

.reserva-horas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--r-borde);
    border-radius: 14px;
    background: var(--r-fondo-2);
}

@media (min-width: 480px) {
    .reserva-horas {
        grid-template-columns: repeat(4, 1fr);
    }
}

.reserva-hora {
    min-height: 44px;
    border: 1px solid var(--r-borde);
    border-radius: 8px;
    background: var(--r-fondo);
    color: var(--r-texto);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.reserva-hora:hover:not(.is-sel) {
    border-color: var(--r-rojo);
    background: var(--r-rojo-tinte);
    color: var(--r-rojo);
}

.reserva-hora.is-sel {
    border-color: var(--r-rojo);
    background: var(--r-rojo);
    color: #fff;
    transform: scale(1.05);
    box-shadow: var(--r-sombra);
}

.reserva-horas-vacio {
    margin: 0;
    padding: 28px 12px;
    border: 1px solid var(--r-borde);
    border-radius: 14px;
    background: var(--r-fondo-2);
    text-align: center;
    font-size: 14px;
    color: var(--r-texto-3);
}

/* ---------- Paso 4 y resumen ---------- */

.reserva-resumen {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reserva-bloque {
    padding: 16px;
    border: 1px solid var(--r-borde);
    border-radius: 14px;
    background: var(--r-fondo-2);
}

.reserva-bloque h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
}

.reserva-fila {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    font-size: 14px;
}

.reserva-fila span {
    color: var(--r-texto-2);
}

.reserva-fila b {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.reserva-fila.is-costo b {
    font-size: 18px;
    color: var(--r-rojo);
}

.reserva-terminos {
    max-height: 46vh;
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--r-borde);
    border-left: 3px solid var(--r-rojo);
    border-radius: 14px;
    background: var(--r-fondo-2);
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

.reserva-terminos + .reserva-aviso {
    margin-top: 8px;
    color: var(--r-texto-3);
}

/* ---------- Éxito ---------- */

.reserva-ok {
    padding: 4px 8px;
    text-align: center;
    text-wrap: pretty;
}

.reserva-ok-elbi {
    display: block;
    width: 150px;
    height: 150px;
    margin: 0 auto;
    animation: reserva-flota 3s ease-in-out infinite;
}

.reserva-ok-badge {
    display: inline-block;
    margin: 10px auto 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.reserva-ok-badge.is-pago {
    background: #fffbeb;
    color: #92400e;
}

html[data-tema="oscuro"] .reserva-ok-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

html[data-tema="oscuro"] .reserva-ok-badge.is-pago {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
}

.reserva-ok h3 {
    margin: 8px 0 4px;
    font-size: 22px;
    font-weight: 700;
}

.reserva-ok p {
    max-width: 40ch;
    margin: 0 auto 10px;
    color: var(--r-texto-2);
}

.reserva-ok .reserva-ok-cuando {
    font-size: 16px;
    font-weight: 600;
    color: var(--r-texto);
    font-variant-numeric: tabular-nums;
}

.reserva-ok .reserva-ok-gracias {
    font-weight: 700;
    color: var(--r-texto-3);
}

.reserva-ok .reserva-ok-alerta {
    padding: 10px 12px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
    color: #92400e;
    font-size: 14px;
}

.reserva-pagar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 6px;
    padding: 12px 22px;
    border-radius: 12px;
    background: linear-gradient(135deg, #009ee3 0%, #00b4f0 100%);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.reserva-pagar:hover {
    color: #fff;
    text-decoration: none;
}

.reserva-confetti {
    position: fixed;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---------- Modo oscuro: sólo lo que no resuelven las variables ---------- */

html[data-tema="oscuro"] .reserva-ayuda,
html[data-tema="oscuro"] .reserva-ok .reserva-ok-alerta {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.08);
    color: #fcd34d;
}

html[data-tema="oscuro"] .reserva-info {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

html[data-tema="oscuro"] .reserva-error,
html[data-tema="oscuro"] .reserva-aviso,
html[data-tema="oscuro"] .reserva-dia.is-ocupado {
    color: var(--o-rojo);
}

html[data-tema="oscuro"] .reserva-dia.is-cerrado {
    color: var(--o-texto-3);
}

html[data-tema="oscuro"] .reserva-dia:hover,
html[data-tema="oscuro"] .reserva-dia.is-hoy,
html[data-tema="oscuro"] .reserva-hora:hover:not(.is-sel),
html[data-tema="oscuro"] .reserva-ficha-cambiar,
html[data-tema="oscuro"] .reserva-paso.is-actual .reserva-paso-nombre,
html[data-tema="oscuro"] .reserva-fila.is-costo b,
html[data-tema="oscuro"] .reserva-ficha-meta b {
    color: var(--o-rojo);
}

html[data-tema="oscuro"] .reserva-dia.is-sel {
    color: #fff;
}

html[data-tema="oscuro"] .reserva-btn-sec {
    border-color: var(--o-rojo);
    color: var(--o-rojo);
}

html[data-tema="oscuro"] .reserva-btn-sec:hover:not(:disabled) {
    background: var(--r-rojo);
    border-color: var(--r-rojo);
    color: #fff;
}

html[data-tema="oscuro"] .reserva-tipo-pill.is-presencial {
    background: rgba(242, 109, 109, 0.12);
    color: var(--o-rojo);
    border-color: rgba(242, 109, 109, 0.3);
}

html[data-tema="oscuro"] .reserva-card-dias {
    background: rgba(31, 29, 27, 0.85);
}

html[data-tema="oscuro"] .reserva-campo input[aria-invalid="true"] {
    border-color: var(--o-rojo);
}

/* ---------- Menos movimiento ---------- */

@media (prefers-reduced-motion: reduce) {
    .reserva-panel,
    .reserva-cuerpo.is-entrando > *,
    .reserva-calendario,
    .reserva-estado-elbi,
    .reserva-ok-elbi,
    .reserva-esqueleto .reserva-card-media,
    .reserva-linea,
    .reserva-spinner {
        animation: none;
    }

    .reserva-card,
    .reserva-card-foto,
    .reserva-btn,
    .reserva-hora,
    .reserva-pasos::after,
    .unet-reservar {
        transition: none;
    }

    .reserva-card:hover,
    .reserva-card:hover .reserva-card-foto,
    .reserva-hora.is-sel {
        transform: none;
    }
}
