/* =========================================================
   Cleaning Services by WebXPro.pk — Booking Popup Styles v1.2
   Premium UI: wider modal, improved form, icons, mobile-first
   ========================================================= */

/* ── Overlay ──────────────────────────────────────────── */
.cs-booking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: csOverlayIn .25s ease;
}

@keyframes csOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Close animation (added by JS) */
.cs-booking-overlay.cs-closing {
    animation: csOverlayOut .22s ease forwards;
}
.cs-booking-overlay.cs-closing .cs-booking-modal {
    animation: csModalOut .22s cubic-bezier(.4,0,1,1) forwards;
}

@keyframes csOverlayOut {
    to { opacity: 0; }
}
@keyframes csModalOut {
    to { transform: translateY(20px) scale(.96); opacity: 0; }
}

body.cs-modal-open { overflow: hidden; }

/* ── Modal box ────────────────────────────────────────── */
.cs-booking-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 700px;          /* slightly wider than before */
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow:
        0 40px 100px rgba(0, 0, 0, .25),
        0 0 0 1px rgba(0,0,0,.05);
    animation: csModalIn .35s cubic-bezier(.34,1.4,.64,1);
    font-family: var(--cs-font, 'Jost', sans-serif);
}

@keyframes csModalIn {
    from { transform: translateY(32px) scale(.94); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

/* Scrollbar */
.cs-booking-modal::-webkit-scrollbar { width: 4px; }
.cs-booking-modal::-webkit-scrollbar-track { background: transparent; }
.cs-booking-modal::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }

/* ── Header ───────────────────────────────────────────── */
.cs-booking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 32px 20px;
    border-bottom: 1px solid #f1f3f5;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.cs-booking-title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    font-family: var(--cs-font, 'Jost', sans-serif);
    letter-spacing: -.02em;
}

/* Close button — always visible, black background, white X */
.cs-booking-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #111827;   /* always dark */
    color: #ffffff;         /* always white X */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s, transform .22s;
    flex-shrink: 0;
    line-height: 1;
    opacity: 1 !important;  /* never hidden */
    visibility: visible !important;
}
.cs-booking-close:hover {
    background: #000000;
    transform: rotate(90deg);
}
.cs-booking-close svg { display: block; }

/* ── Steps bar ────────────────────────────────────────── */
.cs-steps-bar {
    display: flex;
    align-items: center;
    padding: 24px 32px 0;
    gap: 0;
}

.cs-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.cs-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .28s ease;
    font-family: var(--cs-font, 'Jost', sans-serif);
}

.cs-step-label {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 600;
    white-space: nowrap;
    transition: color .25s ease;
    font-family: var(--cs-font, 'Jost', sans-serif);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.cs-step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin-bottom: 22px;
    transition: background .28s ease;
    min-width: 12px;
}

/* Active step */
.cs-step-item.active .cs-step-num {
    border-color: var(--cs-primary, #0163d2);
    background: var(--cs-primary, #0163d2);
    color: #fff;
    box-shadow: 0 4px 14px rgba(1,99,210,.35);
}
.cs-step-item.active .cs-step-label { color: var(--cs-primary, #0163d2); font-weight: 700; }

/* Completed step */
.cs-step-item.completed .cs-step-num {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
}
.cs-step-item.completed .cs-step-num::before { content: '✓'; }
.cs-step-item.completed .cs-step-label { color: #10b981; }

/* Filled connector */
.cs-step-item.completed + .cs-step-line { background: #10b981; }

/* ── Booking step pane ────────────────────────────────── */
.cs-booking-step {
    padding: 26px 32px 8px;
}

/* ── Form elements ────────────────────────────────────── */
.cs-form-group { margin-bottom: 22px; }

.cs-form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    font-family: var(--cs-font, 'Jost', sans-serif);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.cs-form-label.cs-required::after { content: ' *'; color: #ef4444; }

.cs-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
}

/* Service display box */
.cs-service-display {
    background: linear-gradient(135deg, rgba(1,99,210,.07) 0%, rgba(1,99,210,.03) 100%);
    border: 1.5px solid rgba(1,99,210,.2);
    border-radius: 12px;
    padding: 16px 20px;
}
.cs-service-display-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hide the document/file icon */
.cs-service-icon { display: none !important; }

#cs-selected-service-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    font-family: var(--cs-font, 'Jost', sans-serif);
}

/* ── Native select ────────────────────────────────────── */
.cs-select-wrapper { position: relative; }
.cs-form-select {
    width: 100%;
    padding: 0 44px 0 16px;
    height: 48px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--cs-font, 'Jost', sans-serif);
    color: #374151;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    line-height: 48px;
}
.cs-form-select:focus {
    border-color: var(--cs-primary, #0163d2);
    box-shadow: 0 0 0 3px rgba(1,99,210,.12);
}
.cs-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
    display: flex;
    align-items: center;
}

/* ── Select2 overrides (when select2 is active) ───────── */
.cs-select2-container .select2-container {
    width: 100% !important;
}
.select2-container--default .select2-selection--single {
    height: 48px;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 10px !important;
    background: #fff;
    display: flex;
    align-items: center;
    transition: border-color .2s, box-shadow .2s;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--cs-primary, #0163d2) !important;
    box-shadow: 0 0 0 3px rgba(1,99,210,.12) !important;
    outline: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px;
    color: #374151;
    font-family: var(--cs-font, 'Jost', sans-serif);
    font-size: 14px;
    padding: 0 40px 0 16px !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 10px;
}
.select2-dropdown {
    border: 1.5px solid #e5e7eb !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.12) !important;
    font-family: var(--cs-font, 'Jost', sans-serif);
    font-size: 14px;
    overflow: hidden;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--cs-primary, #0163d2) !important;
}
.select2-search--dropdown .select2-search__field {
    border: 1.5px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 8px 12px;
    font-family: var(--cs-font, 'Jost', sans-serif);
    font-size: 13px;
    outline: none;
}
.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--cs-primary, #0163d2) !important;
    box-shadow: 0 0 0 3px rgba(1,99,210,.1) !important;
}

/* ── Input / Textarea ─────────────────────────────────── */
.cs-input-icon-wrap { position: relative; }

.cs-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    line-height: 1;
}

/* For textarea: align icon to top */
.cs-input-icon--top {
    top: 15px;
    transform: none;
}

.cs-form-input,
.cs-form-textarea {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--cs-font, 'Jost', sans-serif);
    color: #374151;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    display: block;
}

/* Equal input height for all single-line fields */
.cs-form-input {
    padding: 0 16px;
    height: 48px;
    line-height: 48px;
}
.cs-form-textarea {
    padding: 13px 16px;
    height: auto;
    min-height: 90px;
    line-height: 1.6;
    resize: vertical;
}

/* Inputs with icons — left padding for icon space */
.cs-form-input.cs-input-with-icon   { padding-left: 44px; }
.cs-form-textarea.cs-input-with-icon { padding-left: 44px; }

/* Focus state */
.cs-form-input:focus,
.cs-form-textarea:focus {
    border-color: var(--cs-primary, #0163d2);
    box-shadow: 0 0 0 3px rgba(1,99,210,.12);
}

.cs-form-input::placeholder,
.cs-form-textarea::placeholder {
    color: #c4c9d4;
    font-size: 13.5px;
    font-family: var(--cs-font, 'Jost', sans-serif);
}

/* ── Date input — professional styling ──────────────────── */
input[type="date"].cs-form-input {
    cursor: pointer;
    color-scheme: light;
    padding-right: 12px;
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;
}
input[type="date"].cs-form-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .6;
    filter: invert(25%) sepia(100%) saturate(1200%) hue-rotate(195deg) brightness(90%);
    width: 18px;
    height: 18px;
    padding: 0;
    margin-right: 2px;
    transition: opacity .2s;
}
input[type="date"].cs-form-input:hover::-webkit-calendar-picker-indicator { opacity: 1; }
input[type="date"].cs-form-input:focus::-webkit-calendar-picker-indicator { opacity: 1; }

/* Field error */
.cs-field-error {
    display: block;
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
    font-family: var(--cs-font, 'Jost', sans-serif);
    font-weight: 500;
}

/* ── Time slots grid ─────────────────────────────────── */
.cs-time-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 580px) {
    .cs-time-slots-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 400px) {
    .cs-time-slots-grid { grid-template-columns: repeat(2, 1fr); }
}

.cs-time-slot {
    position: relative;
    cursor: pointer;
}

.cs-time-slot input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.cs-slot-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
    transition: all .22s ease;
    text-align: center;
    font-family: var(--cs-font, 'Jost', sans-serif);
    line-height: 1.3;
    min-height: 44px;
    user-select: none;
}

.cs-time-slot:hover .cs-slot-label {
    border-color: var(--cs-primary, #0163d2);
    color: var(--cs-primary, #0163d2);
    background: rgba(1,99,210,.04);
}

.cs-time-slot.selected .cs-slot-label,
.cs-time-slot input:checked ~ .cs-slot-label {
    border-color: var(--cs-primary, #0163d2);
    background: var(--cs-primary, #0163d2);
    color: #fff;
    box-shadow: 0 4px 12px rgba(1,99,210,.28);
}

/* ── Navigation ───────────────────────────────────────── */
.cs-booking-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px 28px;
    gap: 12px;
}

.cs-btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--cs-font, 'Jost', sans-serif);
    cursor: pointer;
    border: none;
    transition: all .22s ease;
    line-height: 1;
    white-space: nowrap;
}

.cs-btn-prev {
    background: #f3f4f6;
    color: #374151;
}
.cs-btn-prev:hover { background: #e5e7eb; color: #111827; }

.cs-btn-next,
.cs-btn-submit {
    background: var(--cs-primary, #0163d2);
    color: #fff;
    box-shadow: 0 5px 16px rgba(1,99,210,.3);
    margin-left: auto;
}
.cs-btn-next:hover,
.cs-btn-submit:hover {
    background: var(--cs-primary-hover, #004fb0);
    box-shadow: 0 7px 22px rgba(1,99,210,.4);
    transform: translateY(-1px);
}

.cs-btn-submit.cs-loading {
    opacity: .75;
    pointer-events: none;
}

/* ── Success screen ───────────────────────────────────── */
.cs-booking-success {
    padding: 48px 32px;
    text-align: center;
}

.cs-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 28px rgba(16,185,129,.3);
    animation: csSuccessBounce .5s cubic-bezier(.34,1.4,.64,1) forwards;
}

@keyframes csSuccessBounce {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.cs-success-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px;
    font-family: var(--cs-font, 'Jost', sans-serif);
}

.cs-success-msg {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.65;
    margin: 0 0 8px;
    font-family: var(--cs-font, 'Jost', sans-serif);
}

.cs-booking-id-box {
    display: inline-block;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 10px 20px;
    margin: 14px 0 24px;
    font-size: 13.5px;
    font-family: var(--cs-font, 'Jost', sans-serif);
}
.cs-booking-id-box strong { color: var(--cs-primary, #0163d2); font-weight: 700; }

.cs-btn-close-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 32px;
    background: var(--cs-primary, #0163d2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--cs-font, 'Jost', sans-serif);
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(1,99,210,.28);
}
.cs-btn-close-success:hover {
    background: var(--cs-primary-hover, #004fb0);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(1,99,210,.36);
}

/* ── Scroll animations ───────────────────────────────── */
.cs-animate-ready {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .5s ease, transform .5s ease;
}
.cs-animate-ready.cs-animate-in {
    opacity: 1;
    transform: translateY(0);
}

.cs-services-grid .cs-animate-ready:nth-child(1) { transition-delay: .00s; }
.cs-services-grid .cs-animate-ready:nth-child(2) { transition-delay: .08s; }
.cs-services-grid .cs-animate-ready:nth-child(3) { transition-delay: .16s; }
.cs-services-grid .cs-animate-ready:nth-child(4) { transition-delay: .24s; }
.cs-services-grid .cs-animate-ready:nth-child(5) { transition-delay: .32s; }
.cs-services-grid .cs-animate-ready:nth-child(6) { transition-delay: .40s; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 720px) {
    .cs-booking-modal {
        border-radius: 18px;
        max-height: 95vh;
    }
    .cs-booking-header  { padding: 18px 22px 16px; }
    .cs-steps-bar       { padding: 18px 22px 0; }
    .cs-booking-step    { padding: 20px 22px 6px; }
    .cs-booking-nav     { padding: 14px 22px 24px; }
    .cs-booking-success { padding: 36px 22px 32px; }
}

@media (max-width: 440px) {
    .cs-booking-header { padding: 16px 18px 14px; }
    .cs-booking-step   { padding: 16px 18px 4px; }
    .cs-booking-nav    { padding: 12px 18px 20px; }
    .cs-step-label     { display: none; }
    .cs-step-num       { width: 30px; height: 30px; font-size: 11px; }
    .cs-step-line      { min-width: 8px; }
    .cs-btn-nav        { padding: 11px 18px; font-size: 13px; }
}
