/* Custom Booking Modal Styling */
.bm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 43, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bm-modal {
    background: #FFFFFF;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bm-overlay.active .bm-modal {
    transform: translateY(0) scale(1);
}

.bm-header {
    background: #2C2B2A;
    color: #FFFFFF;
    padding: 1.3rem 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.bm-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #FFFFFF;
    letter-spacing: -0.3px;
}

.bm-close {
    background: transparent;
    border: none;
    color: #AFAAA3;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    margin: -4px -8px;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-close:hover {
    color: #FFFFFF;
    transform: scale(1.1);
}

/* Progress Indicator */
.bm-progress {
    display: flex;
    background: #EBEAE6;
    height: 4px;
    flex-shrink: 0;
}

.bm-progress-bar {
    background: #C69F7A;
    height: 100%;
    width: 25%;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bm-body {
    padding: 1.8rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* Steps */
.bm-step {
    display: none;
}

.bm-step.active {
    display: block;
    animation: bmFadeIn 0.25s ease-out;
}

@keyframes bmFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.bm-step-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: #373533;
}

/* Service Selection Cards in Modal */
.bm-services-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.bm-service-option {
    border: 2px solid #E3E0D8;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    cursor: pointer;
    position: relative;
    transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #FFFFFF;
    -webkit-tap-highlight-color: transparent;
}

/* Radio circle icon on the left */
.bm-radio-circle {
    width: 22px;
    height: 22px;
    border: 2px solid #C69F7A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: #FFFFFF;
}

.bm-radio-circle::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #C69F7A;
    border-radius: 50%;
    display: none;
}

.bm-service-option:hover {
    border-color: #C69F7A;
    background: #FDFBF8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(198, 159, 122, 0.15);
}

/* HIGH-CONTRAST SELECTED STATE */
.bm-service-option.selected {
    border: 2px solid #C69F7A;
    background: #F9F3EC !important;
    box-shadow: 0 6px 20px rgba(198, 159, 122, 0.3) !important;
    transform: translateY(-2px);
}

.bm-service-option.selected .bm-radio-circle {
    background: #C69F7A;
    border-color: #C69F7A;
}

.bm-service-option.selected .bm-radio-circle::after {
    display: block;
    background: #FFFFFF;
}

.bm-service-info {
    flex: 1;
    min-width: 0;
}

.bm-service-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.02rem;
    color: #373533;
    transition: color 0.2s;
    word-break: break-word;
}

.bm-service-option.selected .bm-service-info h4 {
    color: #A8815E;
    font-weight: 700;
}

.bm-service-info p {
    margin: 0;
    font-size: 0.86rem;
    color: #7E7A75;
    line-height: 1.35;
}

.bm-service-price {
    text-align: right;
    font-weight: 700;
    color: #C69F7A;
    font-size: 1.15rem;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.bm-service-option.selected .bm-service-price {
    color: #A8815E;
    font-size: 1.2rem;
}

/* Date & Time Picker Calendar Widget */
.bm-calendar-widget {
    background: #FAF9F6;
    border: 1.5px solid #EBEAE6;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
}

.bm-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.bm-cal-nav-btn {
    border: 1.5px solid #D1CEC6;
    border-radius: 8px;
    background: #FFFFFF;
    color: #373533;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.bm-cal-nav-btn:hover {
    border-color: #C69F7A;
    color: #C69F7A;
    background: #FDF9F4;
}

.bm-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #7E7A75;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

.bm-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.bm-cal-day-btn {
    width: 100%;
    min-height: 38px;
    border: 1.5px solid #E8E5DF;
    border-radius: 8px;
    background: #FFFFFF;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    color: #373533;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.bm-cal-day-btn:hover:not(.disabled) {
    border-color: #C69F7A;
    background: rgba(198, 159, 122, 0.12);
    color: #A8815E;
}

.bm-cal-day-btn.selected {
    background: #C69F7A !important;
    color: #FFFFFF !important;
    border-color: #C69F7A !important;
    box-shadow: 0 4px 12px rgba(198, 159, 122, 0.4);
    font-weight: 700;
}

.bm-cal-day-btn.disabled {
    background: #EFECE6;
    color: #BAB6AE;
    border-color: transparent;
    cursor: not-allowed;
    opacity: 0.45;
    text-decoration: line-through;
}

.bm-cal-day-empty {
    width: 100%;
    min-height: 38px;
}

.bm-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 0.6rem;
    margin-top: 0.6rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 2px;
}

.bm-slot-btn {
    padding: 0.75rem 0.5rem;
    min-height: 44px;
    border: 1.5px solid #EBEAE6;
    border-radius: 10px;
    background: #FFFFFF;
    color: #373533;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-slot-btn:hover {
    border-color: #C69F7A;
    background: rgba(198, 159, 122, 0.1);
}

.bm-slot-btn.selected {
    background: #C69F7A;
    color: #FFFFFF;
    border-color: #C69F7A;
    box-shadow: 0 4px 12px rgba(198, 159, 122, 0.35);
}

/* Client info inputs in step 3 */
.bm-step .form-group {
    margin-bottom: 1rem;
}
.bm-step .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}
.bm-step input, .bm-step textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid #D1CEC6;
    border-radius: 10px;
    font-size: 1rem;
    color: #373533;
    outline: none;
    transition: border-color 0.2s;
}
.bm-step input:focus, .bm-step textarea:focus {
    border-color: #C69F7A;
    box-shadow: 0 0 0 3px rgba(198, 159, 122, 0.2);
}

/* Summary Box */
.bm-summary-card {
    background: #F4F3F0;
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #D1CEC6;
}

.bm-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.bm-summary-item:last-child {
    margin-bottom: 0;
    padding-top: 0.6rem;
    border-top: 1px dashed #D1CEC6;
    font-weight: 700;
    font-size: 1.05rem;
}

/* Step 4: Payment Methods Box */
.bm-payment-method-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.bm-payment-option {
    display: block;
    border: 2px solid #EBEAE6;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.bm-payment-option:hover:not(.disabled) {
    border-color: #C69F7A;
    background: #FDFBF8;
    transform: translateY(-1px);
}

.bm-payment-option.selected {
    border-color: #C69F7A;
    background: #FAF6F0;
    box-shadow: 0 4px 15px rgba(198, 159, 122, 0.15);
}

.bm-payment-option.disabled {
    border-color: #ECEAE5;
    background: #F8F7F5;
    opacity: 0.75;
    cursor: not-allowed;
}

.bm-payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.bm-payment-header strong {
    font-size: 0.96rem;
    color: #373533;
}

.bm-badge {
    background: #C69F7A;
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bm-badge-disabled {
    background: #AFAAA3;
    color: #FFFFFF;
}

.bm-payment-desc {
    font-size: 0.84rem;
    color: #7E7A75;
    margin-bottom: 0;
    line-height: 1.4;
}

.bm-payment-option.disabled .bm-payment-desc {
    margin-bottom: 0.6rem;
}

.bm-payment-badges {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: #FFFFFF;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid #EBEAE6;
    width: fit-content;
}

.bm-payment-badges img {
    object-fit: contain;
    filter: grayscale(10%);
}

/* Terms Consent Checkbox */
.bm-terms-consent-box {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #EBEAE6;
}

.bm-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #373533;
    user-select: none;
}

.bm-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #C69F7A;
    cursor: pointer;
    flex-shrink: 0;
}

.bm-checkbox-text a {
    color: #C69F7A;
    text-decoration: underline;
    font-weight: 500;
}

.bm-checkbox-text a:hover {
    color: #A8815E;
}

/* Footer Buttons */
.bm-footer {
    padding: 1.2rem 1.8rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid #EBEAE6;
    background: #FFFFFF;
    flex-shrink: 0;
}

.bm-footer .btn {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE RESPONSIVENESS (SMARTPHONES & TABLETS)
   ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .bm-overlay {
        align-items: flex-end; /* Modern bottom sheet approach on mobile */
    }

    .bm-modal {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .bm-overlay.active .bm-modal {
        transform: translateY(0);
    }

    .bm-header {
        padding: 1.1rem 1.3rem;
    }

    .bm-title {
        font-size: 1.1rem;
    }

    .bm-body {
        padding: 1.2rem 1.1rem;
    }

    .bm-step-title {
        font-size: 1.08rem;
        margin-bottom: 1rem;
    }

    .bm-service-option {
        padding: 0.9rem 1rem;
        gap: 0.75rem;
    }

    .bm-service-info h4 {
        font-size: 0.96rem;
    }

    .bm-service-info p {
        font-size: 0.82rem;
    }

    .bm-service-price {
        font-size: 1.05rem;
    }

    .bm-slots-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        max-height: 200px;
    }

    .bm-slot-btn {
        padding: 0.7rem 0.3rem;
        font-size: 0.9rem;
    }

    .bm-footer {
        padding: 1rem 1.1rem calc(1rem + env(safe-area-inset-bottom));
        gap: 0.75rem;
    }

    .bm-footer .btn {
        flex: 1;
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    .bm-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bm-service-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .bm-service-price {
        align-self: flex-end;
        margin-left: 0;
    }
}
