/* Offcanvas-like left column */
.reserve-left {
    width: 28rem;
    max-width: 100%;
    background: #fff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1000;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.12);
    overflow-x: hidden;
}

.reserve-header {
    padding: 15px 20px 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    background: #fff;
    flex: 0 0 auto;
}

.reserve-body {
    padding: 16px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
}

.reserve-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 20%, rgba(255, 255, 255, 0) 100%);
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.reserve-map {
    height: 100vh;
    width: 100%;
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, 0.65);
    border-radius: 12px;
    overflow: hidden;
}

.fields-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fields-row .flex-fill {
    flex: 1;
    min-width: 0;
}

.zone-block {
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding-bottom: 12px;
}

.zone-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.zone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.zone-grid .slot-btn {
    width: 100%;
    height: 35px;
    padding: 0 .6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0.5rem;
}

/* disabled style: resaltar en #a9a9a9 */
.slot-btn:disabled,
.slot-placeholder,
.slot-placeholder:disabled {
    background: #a9a9a99c !important;
    color: #fff !important;
    border-color: #a9a9a974 !important;
    opacity: 1 !important;
    cursor: not-allowed;
}

.slot-btn.active {
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
    border-radius: 0.5rem !important;
}

.center-slot {
    outline: 2px solid rgba(13, 110, 253, 0.06);
    border-radius: 0.5rem;
}

/* Mobile layout: reserve-left full viewport, only reserve-body scrolls */
@media (max-width: 991px) {

    html,
    body {
        height: 100%;
    }

    /* usar variable --vh ajustada por JS para evitar issues del browser chrome */
    .reserve-left {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: calc(var(--vh, 1vh) * 100);
        /* fallback a 1vh si no existe --vh */
        max-height: calc(var(--vh, 1vh) * 100);
        overflow: hidden;
        /* impedir scroll del body */
        position: relative;
        background: #fff;
    }

    .reserve-header {
        flex: 0 0 auto;
        z-index: 2;
        padding: 15px 5px 10px 5px !important;
    }

    .reserve-body {
        flex: 1 1 auto;
        min-height: 0;
        /* important for flex children to allow proper scrolling */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0;
        /* footer visible fuera del scroll */
    }

    .reserve-footer {
        flex: 0 0 auto;
        position: relative;
        z-index: 3;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
        background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 20%, rgba(255, 255, 255, 0) 100%);
        border-top: 1px solid rgba(0, 0, 0, 0.04);
    }

    /* asegurarse que el resto de columnas no ocupen espacio */
    .row>.col:not(.col-12) {
        display: none !important;
    }

    .flatpickr-input {
        height: auto !important;
        /* margin-top: 5px; */
    }

    .form-label {
        margin-bottom: 0rem !important;
    }
}

.flatpickr-input {
    height: 38px !important;
    border-radius: 4px !important
}

.map-overlay-info {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    padding: 16px 20px;
    border-radius: 14px;
    width: 280px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.map-subtitle {
    font-size: 0.9rem;
    color: #555;
}

.map-phone {
    margin-top: 6px;
    font-size: 0.9rem;
    color: #004846;
    font-weight: 600;
    text-decoration: none !important;
}

.map-phone:hover {
    text-decoration: underline;
}

.col.p-0 {
    position: relative;
}

.form-check-label {
    line-height: 18px !important;
}

.skeleton-line {
    height: 14px;
    background: #e9ecef;
    border-radius: 6px;
}

.slot-skeleton {
    height: 38px;
    border-radius: 20px;
    background: linear-gradient(90deg,
            #e9ecef 25%,
            #f8f9fa 37%,
            #e9ecef 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.2s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

#nextAvailabilityContainer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 1rem;
}

.reservation-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.reservation-date {
    min-width: 70px;
    border-radius: 12px;
    background: #f4f6f8;
    text-align: center;
    padding: 10px 6px;
}

.reservation-date .day {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: #111;
}

.reservation-date .month {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
    margin-top: 4px;
}

.reservation-info {
    flex: 1;
}

.reservation-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.reservation-meta {
    font-size: 13px;
    color: #6c757d;
}

.confirmation-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.confirmation-logo img {
    max-width: 90px;
    height: auto;
}

.confirmation-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.reservation-processing {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-box {
    background: #fff;
    padding: 28px 32px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
    width: 320px;
}

.rp-box .spinner-border {
    width: 2.4rem;
    height: 2.4rem;
}

.rp-dots::after {
    content: '';
    display: inline-block;
    width: 1em;
    text-align: left;
    animation: dots 1.4s infinite;
}

@keyframes dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}
