/* Floating Button Styles */
.reserva-btn-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(0deg, #e8d4d4 0%, #d8c7c7 26%, #93bec7 100%);
    color: #2c3e50;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reserva-btn-float:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.reserva-icon {
    font-style: normal;
    font-size: 1.2rem;
}

/* Popup Overlay */
.reserva-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.reserva-overlay.active {
    display: flex;
    opacity: 1;
}

/* Popup Content */
.reserva-popup {
    background: linear-gradient(0deg, #e8d4d4 0%, #d8c7c7 26%, #93bec7 100%);
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.4s ease;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

.reserva-popup * {
    box-sizing: border-box;
}

.reserva-overlay.active .reserva-popup {
    transform: translateY(0);
}

/* Botón de cierre mejorado */
.reserva-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 20;
}

.reserva-close:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #000;
    transform: scale(1.05);
}

.reserva-header h2 {
    margin: 0 0 8px 0;
    color: #1a1a1a;
    font-size: 1.35rem;
    font-weight: 700;
    padding-right: 30px;
    /* Evitar superposición con el botón de cierre */
    line-height: 1.2;
}

.reserva-header p {
    color: #444;
    font-size: 0.85rem;
    margin-bottom: 16px;
    margin-top: 0;
}

.reserva-notice {
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 15px;
    border-radius: 10px;
    border-left: 4px solid #628e96;
    margin-bottom: 16px !important;
    font-size: 0.85rem !important;
}

/* Form Styles */
.reserva-field {
    margin-bottom: 14px;
}

.reserva-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

#reserva-form .reserva-field input,
#reserva-form .reserva-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #333;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

#reserva-form .reserva-field input::placeholder {
    color: #999;
}

#reserva-form .reserva-field input:focus,
#reserva-form .reserva-field select:focus {
    border-color: #628e96;
    box-shadow: 0 0 0 3px rgba(98, 142, 150, 0.2);
}

/* Opciones de Centro en Tarjetas (Radio Buttons) */
.reserva-centros-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

#reserva-form .reserva-centro-card {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background-color: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

#reserva-form .reserva-centro-card:hover {
    background-color: #ffffff !important;
    border-color: #628e96;
    transform: translateX(2px);
}

#reserva-form .reserva-centro-card:has(input:checked) {
    background-color: #ffffff !important;
    border-color: #12323d;
    box-shadow: 0 0 0 2px rgba(18, 50, 61, 0.15);
}

#reserva-form .reserva-centro-card input[type="radio"] {
    margin-right: 10px;
    margin-bottom: 0;
    width: auto;
    accent-color: #12323d;
    cursor: pointer;
}

.reserva-centro-title {
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
}

.reserva-submit {
    width: 100%;
    padding: 12px;
    background: #112233;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 6px;
    box-shadow: 0 4px 12px rgba(17, 34, 51, 0.2);
}

.reserva-submit:hover {
    background: #1d3b57;
    transform: translateY(-1px);
}

.reserva-submit:active {
    transform: translateY(0);
}

#reserva-message {
    margin-top: 15px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.reserva-success {
    color: #1e4620;
    background: rgba(232, 245, 233, 0.95);
    padding: 10px;
    border-radius: 8px;
    margin: 0;
}

.reserva-error {
    color: #721c24;
    background: rgba(248, 215, 218, 0.95);
    padding: 10px;
    border-radius: 8px;
    margin: 0;
}

/* Custom Scrollbar for the Popup */
.reserva-popup::-webkit-scrollbar {
    width: 6px;
}

.reserva-popup::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.reserva-popup::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
}

.reserva-popup::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Ensure Flatpickr is above the popup */
.flatpickr-calendar {
    z-index: 99999 !important;
}

/* Mobile Responsiveness */
@media screen and (max-width: 480px) {
    .reserva-overlay {
        padding: 12px;
    }

    .reserva-popup {
        padding: 20px 16px;
        border-radius: 16px;
        max-height: 92vh;
    }

    .reserva-header h2 {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .reserva-header p {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }

    .reserva-field {
        margin-bottom: 10px;
    }

    .reserva-field label {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }

    .reserva-field input,
    .reserva-field select {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .reserva-submit {
        padding: 10px;
        font-size: 0.9rem;
        margin-top: 4px;
    }
}