/**
 * Reservas de zonas comunes - estilos del sitio
 *
 * Regla del proyecto: los colores, la tipografia, h1/h2 y los estados hover los pone la
 * PLANTILLA. Aqui solo se define estructura, tamano y espaciado, y se toman los colores
 * de las variables de Bootstrap/Cassiopeia con un valor de respaldo neutro.
 *
 * Las decisiones de maquetacion usan consultas de CONTENEDOR, no de pantalla: este
 * componente puede vivir en una columna estrecha de un monitor grande.
 */

.reservas {
    container-type: inline-size;
    container-name: reservas;
}

.reservas *,
.reservas *::before,
.reservas *::after {
    box-sizing: border-box;
}

/* ---------- Avisos ---------- */

.reservas-aviso {
    padding: .75rem 1rem;
    border-radius: .5rem;
    margin-bottom: 1rem;
    border-left: 4px solid currentColor;
    background: rgba(0, 0, 0, .04);
}

.reservas-aviso--info { color: var(--bs-info-text-emphasis, #055160); }
.reservas-aviso--warning { color: var(--bs-warning-text-emphasis, #664d03); }
.reservas-aviso--danger { color: var(--bs-danger-text-emphasis, #842029); }

.reservas-aviso > * { color: var(--bs-body-color, inherit); }

.reservas-barra {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.reservas-volver { margin-bottom: .5rem; }

/* ---------- Tarjetas de zonas ---------- */

.reservas-tarjetas {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@container reservas (min-width: 30rem) {
    .reservas-tarjetas { grid-template-columns: repeat(2, 1fr); }
}

@container reservas (min-width: 52rem) {
    .reservas-tarjetas { grid-template-columns: repeat(3, 1fr); }
}

.reservas-tarjeta__enlace {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .15));
    border-radius: .75rem;
    overflow: hidden;
    background: var(--bs-body-bg, #fff);
    transition: box-shadow .15s ease, transform .15s ease;
}

.reservas-tarjeta__enlace:hover,
.reservas-tarjeta__enlace:focus-visible {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12);
    transform: translateY(-2px);
}

.reservas-tarjeta__foto img {
    width: 100%;
    height: 10rem;
    object-fit: cover;
    display: block;
}

.reservas-tarjeta__cuerpo {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .9rem 1rem 1rem;
}

.reservas-tarjeta__titulo {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.3;
}

.reservas-tarjeta__estado {
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.reservas-tarjeta__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .2rem;
}

/* ---------- Etiquetas y puntos de estado ---------- */
/* La disponibilidad nunca se comunica solo con color: siempre hay texto al lado. */

.reservas-etiqueta {
    display: inline-block;
    font-size: .8rem;
    line-height: 1.4;
    padding: .15rem .55rem;
    border-radius: 1rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .15));
}

.reservas-etiqueta--valor { font-weight: 600; }

.reservas-punto {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

.reservas-punto--verde { background: var(--bs-success, #198754); }
.reservas-punto--rojo  { background: var(--bs-danger, #dc3545); }
.reservas-punto--gris  { background: var(--bs-secondary, #6c757d); }

/* ---------- Pasos del formulario ---------- */

.reservas-paso { margin: 1.5rem 0; }

.reservas-paso__titulo {
    font-size: 1.05rem;
    margin: 0 0 .6rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
}

.reservas-paso__fecha {
    font-size: .9rem;
    font-weight: 400;
    opacity: .75;
}

.reservas-opciones {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.reservas-opcion {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: .5rem 1rem;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .2));
    text-decoration: none;
    color: inherit;
}

.reservas-opcion.is-activa {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: inset 0 0 0 1px var(--bs-primary, #0d6efd);
    font-weight: 600;
}

/* ---------- Calendario ---------- */

.reservas-calendario__cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .5rem;
}

.reservas-calendario__nav {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .2));
    color: inherit;
}

.reservas-calendario__rejilla {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .25rem;
}

.reservas-calendario__dia-nombre {
    text-align: center;
    font-size: .75rem;
    text-transform: uppercase;
    opacity: .7;
    padding: .25rem 0;
}

.reservas-calendario__dia {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .15));
    text-decoration: none;
    color: inherit;
    font-variant-numeric: tabular-nums;
}

.reservas-calendario__dia.is-activa {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: inset 0 0 0 2px var(--bs-primary, #0d6efd);
    font-weight: 700;
}

.reservas-calendario__dia.is-nodisponible {
    opacity: .4;
    border-style: dashed;
    text-decoration: line-through;
    cursor: not-allowed;
}

.reservas-calendario__hueco { min-height: 44px; }

.reservas-leyenda {
    font-size: .8rem;
    margin: .6rem 0 0;
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* ---------- Franjas horarias ---------- */
/* Botones, nunca dos desplegables de hora: en un telefono es donde mas se falla. */

.reservas-franjas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: .5rem;
}

.reservas-franja__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.reservas-franja__label {
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .1rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .2));
    cursor: pointer;
    text-align: center;
}

.reservas-franja__hora {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.reservas-franja__estado {
    font-size: .75rem;
    opacity: .75;
}

.reservas-franja__input:checked + .reservas-franja__label {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: inset 0 0 0 2px var(--bs-primary, #0d6efd);
}

.reservas-franja__input:focus-visible + .reservas-franja__label {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

.reservas-franja.is-ocupada .reservas-franja__label {
    opacity: .45;
    border-style: dashed;
    cursor: not-allowed;
}

/* ---------- Campos ---------- */

.reservas-campo {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin: 1rem 0;
}

.reservas-campo--doble {
    flex-direction: row;
    gap: 1rem;
    flex-wrap: wrap;
}

.reservas-campo--doble > span {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1 1 8rem;
}

.reservas-campo--check {
    flex-direction: row;
    align-items: flex-start;
    gap: .5rem;
}

.reservas-campo input,
.reservas-campo select,
.reservas-campo textarea,
.reservas-buscador input {
    min-height: 44px;
    padding: .5rem .75rem;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .25));
    background: var(--bs-body-bg, #fff);
    color: inherit;
    font: inherit;
    width: 100%;
}

.reservas-campo--check input {
    min-height: 0;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: .2rem;
    flex: 0 0 auto;
}

.reservas-ayuda {
    font-size: .8rem;
    opacity: .75;
    font-weight: 400;
}

.reservas-enviar {
    min-height: 48px;
    width: 100%;
    margin-top: .5rem;
}

@container reservas (min-width: 30rem) {
    .reservas-enviar { width: auto; min-width: 14rem; }
}

/* ---------- Listado de reservas ---------- */

.reservas-lista {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: grid;
    gap: .75rem;
}

.reservas-item {
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .15));
    border-left-width: 4px;
    border-radius: .5rem;
    padding: .85rem 1rem;
}

.reservas-item--success { border-left-color: var(--bs-success, #198754); }
.reservas-item--warning { border-left-color: var(--bs-warning, #ffc107); }
.reservas-item--secondary { border-left-color: var(--bs-secondary, #6c757d); }

.reservas-item__cabecera {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    margin-bottom: .4rem;
}

.reservas-item__zona,
.reservas-item__hora {
    font-weight: 600;
}

.reservas-item__estado {
    font-size: .8rem;
    padding: .1rem .5rem;
    border-radius: 1rem;
    border: 1px solid currentColor;
}

/* Tabla densa en movil: lista de pares concepto-valor. */
.reservas-item__datos {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .15rem .75rem;
    margin: 0;
    font-size: .92rem;
}

.reservas-item__datos dt { font-weight: 500; opacity: .7; }
.reservas-item__datos dd { margin: 0; }

.reservas-item__resumen { margin: .2rem 0 .5rem; }

.reservas-item__acciones {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .6rem;
}

.reservas-item__alerta {
    margin: .4rem 0;
    font-weight: 600;
}

.reservas-codigo {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .08em;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: .3rem;
    background: rgba(0, 0, 0, .06);
}

/* ---------- Cuenta regresiva ---------- */
/* "Tiene 23 h 47 min" se entiende; "vence el 19/08 14:32" se ignora. */

.reservas-cuenta-regresiva {
    margin: .6rem 0;
    padding: .6rem .8rem;
    border-radius: .5rem;
    border: 1px dashed var(--bs-warning, #ffc107);
    font-weight: 600;
}

.reservas-cuenta-regresiva__hasta {
    display: block;
    font-weight: 400;
    font-size: .82rem;
    opacity: .8;
}

.reservas-instrucciones {
    font-size: .9rem;
    margin-top: .4rem;
}

/* ---------- Porteria ---------- */

.reservas-buscador {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.reservas-buscador input { flex: 1 1 10rem; width: auto; }
.reservas-buscador .btn { min-height: 44px; }

.reservas-cobro {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin: .5rem 0;
}

.reservas-cobro input {
    flex: 1 1 8rem;
    min-height: 44px;
    padding: .5rem .75rem;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .25));
    font: inherit;
}

.reservas-registro,
.reservas-historial,
.reservas-reglamento {
    margin: 1.5rem 0;
}

.reservas-registro > summary,
.reservas-historial > summary,
.reservas-reglamento > summary {
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.reservas-reglamento__texto {
    font-size: .9rem;
    padding: .5rem 0;
    max-height: 18rem;
    overflow-y: auto;
}

/* ---------- Accesibilidad ---------- */

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

@media (prefers-reduced-motion: reduce) {
    .reservas-tarjeta__enlace { transition: none; }
    .reservas-tarjeta__enlace:hover { transform: none; }
}

/* ---------- Rejilla mensual (panel y sitio) ---------- */

.reservas-mes {
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .15));
    border-radius: .5rem;
    overflow: hidden;
}

.reservas-mes__cabecera,
.reservas-mes__semana {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.reservas-mes__nombre {
    text-align: center;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    opacity: .7;
    padding: .4rem 0;
    border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, .15));
}

.reservas-mes__celda {
    min-height: 6.5rem;
    padding: .3rem;
    border-top: 1px solid var(--bs-border-color, rgba(0, 0, 0, .1));
    border-left: 1px solid var(--bs-border-color, rgba(0, 0, 0, .1));
    display: flex;
    flex-direction: column;
    gap: .15rem;
    overflow: hidden;
}

.reservas-mes__semana > .reservas-mes__celda:first-child { border-left: 0; }

.reservas-mes__celda--hueco { background: rgba(0, 0, 0, .02); }

.reservas-mes__celda.is-hoy { box-shadow: inset 0 0 0 2px var(--bs-primary, #0d6efd); }
.reservas-mes__celda.is-pasado { opacity: .55; }

.reservas-mes__dia {
    font-size: .8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    opacity: .8;
}

.reservas-mes__evento {
    display: flex;
    gap: .3rem;
    align-items: baseline;
    font-size: .72rem;
    line-height: 1.25;
    padding: .15rem .3rem;
    border-radius: .25rem;
    border-left: 3px solid var(--bs-secondary, #6c757d);
    background: rgba(0, 0, 0, .05);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.reservas-mes__evento:hover,
.reservas-mes__evento:focus-visible { background: rgba(0, 0, 0, .11); }

.reservas-mes__evento--success { border-left-color: var(--bs-success, #198754); }
.reservas-mes__evento--warning { border-left-color: var(--bs-warning, #ffc107); }
.reservas-mes__evento--secondary { border-left-color: var(--bs-secondary, #6c757d); }

.reservas-mes__hora {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    flex: 0 0 auto;
}

.reservas-mes__texto {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reservas-mes__unidad { opacity: .75; }

/* Calendario publico: celdas mas bajas y tactiles */
.reservas-mes--publico .reservas-mes__celda {
    min-height: 3.6rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    gap: .1rem;
}

.reservas-mes--publico .reservas-mes__libre {
    font-size: .68rem;
    opacity: .8;
}

.reservas-mes--publico .reservas-mes__celda.is-nodisponible {
    opacity: .45;
    cursor: not-allowed;
}

a.reservas-mes__celda:hover,
a.reservas-mes__celda:focus-visible { background: rgba(0, 0, 0, .05); }

/* En contenedor estrecho la rejilla se vuelve ilegible: pasa a lista por dia. */
@container reservas (max-width: 26rem) {
    .reservas-mes__cabecera { display: none; }

    .reservas-mes__semana { grid-template-columns: 1fr; }

    .reservas-mes__celda {
        min-height: 0;
        border-left: 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: .4rem;
    }

    .reservas-mes__celda--hueco { display: none; }

    .reservas-mes--publico .reservas-mes__celda { justify-content: flex-start; text-align: left; }
}

/* =========================================================================
   Pantalla de reserva: calendario a la izquierda, ficha de la zona a la
   derecha, horas del dia elegido abajo.

   Los colores de disponibilidad (verde / rojo / gris) son los unicos que este
   componente impone, porque son informacion, no decoracion. Se toman de las
   variables de la plantilla y siempre van acompanados de texto: nadie deberia
   depender del color para entender si un dia esta libre.
   ========================================================================= */

.reservas-columnas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

@container reservas (min-width: 46rem) {
    .reservas-columnas { grid-template-columns: minmax(19rem, 24rem) 1fr; }
}

.reservas-panel {
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .12));
    border-radius: .9rem;
    background: var(--bs-body-bg, #fff);
    padding: 1.1rem 1.15rem 1.25rem;
}

.reservas-panel--horas { margin-top: 1rem; }

/* ---------- Cabecera del calendario ---------- */

.reservas-cal__titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

.reservas-cal__titulo h3 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
    text-align: center;
    flex: 1 1 auto;
}

.reservas-cal__titulo h3 span { font-weight: 400; opacity: .65; }

.reservas-cal__flecha {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
    text-decoration: none;
    color: inherit;
    border-radius: .5rem;
}

.reservas-cal__flecha:hover,
.reservas-cal__flecha:focus-visible { background: rgba(0, 0, 0, .06); }

.reservas-cal__salto {
    display: flex;
    gap: .4rem;
    margin-bottom: .9rem;
}

.reservas-cal__salto select {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 40px;
    padding: .35rem .5rem;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .2));
    background: var(--bs-body-bg, #fff);
    color: inherit;
    font: inherit;
}

.reservas-cal__salto .btn { flex: 0 0 auto; min-height: 40px; }

/* ---------- Rejilla de días ---------- */

.reservas-cal__semana--nombres,
.reservas-cal__dias {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .3rem;
}

.reservas-cal__semana--nombres { margin-bottom: .3rem; }

.reservas-cal__nombre {
    text-align: center;
    font-size: .78rem;
    opacity: .7;
    padding: .2rem 0;
}

.reservas-cal__dia {
    aspect-ratio: 1 / 1;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .55rem;
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    font-variant-numeric: tabular-nums;
    font-size: .95rem;
    transition: transform .1s ease;
}

.reservas-cal__dia--hueco { border: 0; }

/* Verde: hay cupo. Rojo: todo ocupado. Gris: cerrado o ya pasó. */
.reservas-cal__dia--libre {
    background: color-mix(in srgb, var(--bs-success, #198754) 22%, transparent);
    border-color: color-mix(in srgb, var(--bs-success, #198754) 45%, transparent);
    font-weight: 600;
}

.reservas-cal__dia--lleno {
    background: color-mix(in srgb, var(--bs-danger, #dc3545) 18%, transparent);
    border-color: color-mix(in srgb, var(--bs-danger, #dc3545) 40%, transparent);
}

.reservas-cal__dia--cerrado,
.reservas-cal__dia--pasado {
    opacity: .38;
    cursor: not-allowed;
}

a.reservas-cal__dia:hover,
a.reservas-cal__dia:focus-visible { transform: scale(1.06); }

.reservas-cal__dia.is-hoy { text-decoration: underline; text-underline-offset: .25rem; }

.reservas-cal__dia.is-elegido {
    box-shadow: 0 0 0 3px var(--bs-warning, #f0ad4e);
    font-weight: 700;
}

/* Navegador antiguo sin color-mix: se cae a un fondo neutro pero el texto sigue. */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .reservas-cal__dia--libre { background: #d7f0e2; border-color: #8fd0ae; }
    .reservas-cal__dia--lleno { background: #f8d7da; border-color: #e9a2a9; }
}

.reservas-cal__leyenda {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    margin: .9rem 0 0;
    padding: 0;
    font-size: .8rem;
}

.reservas-cal__leyenda li {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.reservas-muestra {
    width: .85rem;
    height: .85rem;
    border-radius: .25rem;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, .15);
}

.reservas-muestra--libre { background: #d7f0e2; }
.reservas-muestra--lleno { background: #f8d7da; }
.reservas-muestra--cerrado { background: rgba(0, 0, 0, .1); }

/* ---------- Ficha de la zona ---------- */

.reservas-ficha__cabecera {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    margin-bottom: .8rem;
}

.reservas-ficha__foto img {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: cover;
    border-radius: .6rem;
    display: block;
}

.reservas-ficha__titulo { margin: 0 0 .35rem; font-size: 1.25rem; }

.reservas-ficha__etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin: 0;
}

.reservas-ficha__subtitulo {
    margin: 1rem 0 .35rem;
    font-size: .95rem;
    font-weight: 600;
}

.reservas-ficha__texto { font-size: .92rem; margin-bottom: .5rem; }
.reservas-ficha__texto--nota { opacity: .85; font-style: italic; }

.reservas-ficha__lista {
    margin: 0;
    padding-left: 1.1rem;
    font-size: .92rem;
}

/* ---------- Horas del día ---------- */

.reservas-horas__titulo {
    font-size: 1.05rem;
    margin: 0 0 .8rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
}

.reservas-horas__titulo span { font-weight: 400; opacity: .7; font-size: .92rem; }

.reservas-duracion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .9rem;
}

.reservas-duracion__rotulo { font-size: .9rem; opacity: .75; }

.reservas-horas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: .5rem;
}

.reservas-hora__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.reservas-hora__label {
    min-height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .1rem;
    padding: .5rem .7rem;
    border-radius: .55rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .2));
    cursor: pointer;
    text-align: center;
}

.reservas-hora__rango { font-weight: 600; font-variant-numeric: tabular-nums; }
.reservas-hora__estado { font-size: .75rem; opacity: .8; }

.reservas-hora--libre .reservas-hora__label {
    background: color-mix(in srgb, var(--bs-success, #198754) 16%, transparent);
    border-color: color-mix(in srgb, var(--bs-success, #198754) 45%, transparent);
}

.reservas-hora--ocupada .reservas-hora__label {
    background: color-mix(in srgb, var(--bs-danger, #dc3545) 14%, transparent);
    border-color: color-mix(in srgb, var(--bs-danger, #dc3545) 40%, transparent);
    cursor: not-allowed;
}

.reservas-hora--pasada .reservas-hora__label {
    opacity: .45;
    border-style: dashed;
    cursor: not-allowed;
}

@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .reservas-hora--libre .reservas-hora__label { background: #e3f5ea; border-color: #8fd0ae; }
    .reservas-hora--ocupada .reservas-hora__label { background: #fbe3e5; border-color: #e9a2a9; }
}

.reservas-hora__input:checked + .reservas-hora__label {
    box-shadow: 0 0 0 3px var(--bs-warning, #f0ad4e);
    font-weight: 700;
}

.reservas-hora__input:focus-visible + .reservas-hora__label {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}

.reservas-enviar__caja {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color, rgba(0, 0, 0, .12));
    display: flex;
    justify-content: center;
}

.reservas-enviar__caja .reservas-enviar {
    min-width: 16rem;
    min-height: 52px;
    font-size: 1.05rem;
}

/* ---------- Ajustes de la 1.3.0 ---------- */

.reservas-cal__hoy {
    margin: -.35rem 0 .75rem;
    text-align: center;
    font-size: .85rem;
}

/* Ocupada y pasada son cosas distintas y deben verse distintas: una la tomo otro
   residente, la otra simplemente ya no existe. */
.reservas-hora--pasada .reservas-hora__label {
    background: rgba(0, 0, 0, .04);
    border-style: dashed;
    opacity: .5;
    cursor: not-allowed;
}

.reservas-hora--pasada .reservas-hora__rango { text-decoration: line-through; }

/* ---------- Barra de navegación del panel ---------- */

.reservas-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    padding: .5rem .65rem;
    margin-bottom: 1rem;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .12));
    border-radius: .6rem;
    background: var(--bs-tertiary-bg, rgba(0, 0, 0, .03));
}

.reservas-nav__marca {
    font-weight: 600;
    margin-right: .5rem;
    white-space: nowrap;
}

.reservas-nav .btn { white-space: nowrap; }

/* ---------- Selector de vista (mes / semana / día) ---------- */

.reservas-vistas {
    display: inline-flex;
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .2));
    border-radius: .5rem;
    overflow: hidden;
}

.reservas-vistas a {
    padding: .45rem .95rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    border-left: 1px solid var(--bs-border-color, rgba(0, 0, 0, .2));
}

.reservas-vistas a:first-child { border-left: 0; }

.reservas-vistas a.is-activa {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-weight: 600;
}

/* ---------- Vista de semana ---------- */

.reservas-semana {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
}

@container reservas (min-width: 55rem) {
    .reservas-semana { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

.reservas-semana__dia {
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .12));
    border-radius: .55rem;
    overflow: hidden;
    min-height: 6rem;
}

.reservas-semana__cabecera {
    padding: .4rem .55rem;
    font-size: .82rem;
    font-weight: 600;
    background: var(--bs-tertiary-bg, rgba(0, 0, 0, .04));
    border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, .1));
}

.reservas-semana__dia.is-hoy .reservas-semana__cabecera {
    background: color-mix(in srgb, var(--bs-primary, #0d6efd) 15%, transparent);
}

.reservas-semana__cuerpo { padding: .35rem; display: grid; gap: .25rem; }

.reservas-semana__vacio {
    font-size: .78rem;
    opacity: .55;
    padding: .35rem;
}

/* ---------- Vista de día ---------- */

.reservas-dia {
    display: grid;
    gap: .5rem;
}

.reservas-dia__fila {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: .75rem;
    align-items: start;
    padding: .6rem .5rem;
    border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, .08));
}

.reservas-dia__hora {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.reservas-dia__zona { font-weight: 600; }
.reservas-dia__meta { font-size: .87rem; opacity: .8; }

/* ---------- Tarjetas del panel: ahora son enlaces ---------- */

.reservas-cifra {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: box-shadow .15s ease, transform .15s ease;
}

.reservas-cifra:hover,
.reservas-cifra:focus-visible {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12);
    transform: translateY(-2px);
    color: inherit;
}

.reservas-cifra__valor { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.reservas-cifra__pie { font-size: .78rem; opacity: .7; }
