/* ========== 完整的预约弹窗优化 ========== */
.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 15px; /* 安全内边距 */
    box-sizing: border-box;
}

.booking-modal.active {
    opacity: 1;
    visibility: visible;
}

.booking-container {
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    position: relative;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
}

.booking-modal.active .booking-container {
    transform: translateY(0);
    opacity: 1;
}

.booking-header {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    padding: 18px 15px 12px;
    text-align: center;
    position: relative;
}

.booking-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    padding: 0 5px;
}

.booking-subtitle {
    font-size: 14px;
    opacity: 0.9;
    padding: 0 5px;
}

.close-booking {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-booking:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.booking-body {
    padding: 20px 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.booking-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f5;
}

.booking-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    font-weight: 700;
    margin-bottom: 12px;
    color: #444;
    position: relative;
}

.section-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 35px;
    height: 2.5px;
    background: #e83e8c;
    border-radius: 3px;
}

.section-title i {
    margin-right: 10px;
    color: #e83e8c;
}

.booking-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.booking-col {
    flex: 1;
    min-width: calc(50% - 12px);
}

.booking-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.booking-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e8;
    border-radius: 12px;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.3s;
}

.booking-input:focus {
    border-color: #6a11cb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    background: white;
}

.booking-select {
    position: relative;
}

.booking-select:after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    font-size: 14px;
}

/* 时间选择器样式增强 */
input[type="datetime-local"] {
    appearance: none;
    position: relative;
    padding-right: 35px;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 10px;
    cursor: pointer;
}

/* 服务选项样式 */
.service-option {
    display: block;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e0e0e8;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.service-option:hover {
    border-color: #c0c0d0;
    background: #f0f5ff;
}

.service-option.selected {
    border-color: #6a11cb;
    background: #f0f5ff;
    box-shadow: 0 0 0 1px #6a11cb;
}

.service-name {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.service-price {
    color: #ef4444;
    font-weight: 700;
}

.service-duration {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.service-radio {
    display: none;
}

/* 弹窗底部按钮区域 */
.booking-footer {
    padding: 12px 15px;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-cancel {
    padding: 12px 25px;
    background: #f8f9fa;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 120px;
}

.btn-cancel:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e0;
}

.btn-book {
    padding: 12px 25px;
    background: linear-gradient(135deg, #7c3aed, #5a67d8);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    gap: 8px;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.btn-book:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-book:after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0)
    );
    transform: rotate(15deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.btn-book:hover:after {
    opacity: 1;
    top: -30%;
    left: -30%;
}

.btn-book:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

/* 添加按钮加载状态 */
.btn-book.loading {
    position: relative;
    color: transparent;
}

.btn-book.loading:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* 禁用状态 */
.btn-book:disabled {
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-book:disabled:hover:after {
    opacity: 0;
}

/* 响应式调整 - 确保始终左右排列 */
@media (max-width: 576px) {
    .booking-modal {
        padding: 10px;
    }
    
    .booking-container {
        max-width: 100%;
        max-height: 85vh;
    }
    
    .booking-header {
        padding: 15px 10px 10px;
    }
    
    .booking-body {
        padding: 15px 10px;
        max-height: 65vh;
    }
    
    /* 确保在小屏幕上仍然是左右排列 */
    .booking-footer {
        flex-direction: row; /* 强制保持行排列 */
        align-items: center;
        justify-content: space-between;
    }
    
    .booking-col {
        min-width: 100%;
    }
    
    .btn-cancel, 
    .btn-book {
        padding: 12px 15px;
        font-size: 14px;
        flex: 1; /* 保持弹性宽度 */
        min-width: auto; /* 移除最小宽度限制 */
        width: auto; /* 宽度自适应 */
    }
}

/* 针对超小屏幕的额外优化 */
@media (max-width: 400px) {
    .btn-cancel, 
    .btn-book {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* 确保在超小屏幕上按钮内容不会换行 */
    .btn-book i {
        margin-right: 4px;
    }
}

/* 添加按钮加载状态 */
.btn-book.loading {
    position: relative;
    color: transparent;
}

.btn-book.loading:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* 禁用状态 */
.btn-book:disabled {
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-book:disabled:hover:after {
    opacity: 0;
}