/* ============================================
   RCC Booking System — Premium Arabic UI
   Production-Ready, Mobile-First, RTL
   ============================================ */

/* --- Foundation --- */
.rcc-booking {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 16px 80px;
    font-family: "IBM Plex Sans Arabic", "Cairo", "IBM Plex Sans", sans-serif;
    direction: rtl;
    color: #f0f0f0;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
.rcc-booking *, .rcc-booking *::before, .rcc-booking *::after {
    box-sizing: border-box;
    font-family: inherit;
}
.rcc-booking h2, .rcc-booking h3, .rcc-booking h4 { margin: 0; }
.rcc-booking img { max-width: 100%; height: auto; }

/* ============================================
   PROGRESS BAR — Horizontal stepper
   ============================================ */
.booking-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 0 auto 44px;
    padding: 0;
    max-width: 700px;
    position: relative;
    overflow: visible;
}
/* Background connector line spanning full width */
.booking-progress::before {
    content: '';
    position: absolute;
    top: 19px;
    left: 8%;
    right: 8%;
    height: 3px;
    background: #e8e8e8;
    border-radius: 2px;
    z-index: 0;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex: 1;
}
.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    background: #161616;
    color: #555;
    border: 3px solid #e0e0e0;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}
.step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #555;
    transition: all 0.3s;
    text-align: center;
    max-width: 80px;
    line-height: 1.3;
}

/* Active */
.progress-step.active .step-num {
    background: #e63946;
    color: #fff;
    border-color: #e63946;
    box-shadow: 0 4px 20px rgba(230, 57, 70, 0.4);
    transform: scale(1.15);
}
.progress-step.active .step-label {
    color: #e63946;
    font-weight: 800;
}

/* Done */
.progress-step.done .step-num {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}
.progress-step.done .step-label { color: #22c55e; font-weight: 700; }

/* Connector fill for done steps */
.progress-step.done + .progress-step::after,
.progress-step.done + .progress-step.done::after,
.progress-step.done + .progress-step.active::after {
    content: '';
    position: absolute;
    top: 19px;
    right: 50%;
    width: 100%;
    height: 3px;
    background: #22c55e;
    z-index: 0;
}
.progress-step.done + .progress-step.active::after {
    background: linear-gradient(to left, #e63946, #22c55e);
}

/* ============================================
   STEP ANIMATION
   ============================================ */
.booking-step {
    animation: bkSlideIn 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes bkSlideIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.step-title {
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 32px;
    color: #f0f0f0;
    letter-spacing: -0.01em;
}
.text-red { color: #e63946; }
.text-muted { color: #666; text-align: center; padding: 20px 0; font-size: 0.9rem; }

/* ============================================
   SERVICE CARDS — SVG Image Icons
   ============================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.service-card {
    background: #161616;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 30px 18px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    position: relative;
    overflow: hidden;
}
.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(230,57,70,0.04) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}
.service-card:hover::after { opacity: 1; }
.service-card:hover {
    border-color: #e63946;
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(230, 57, 70, 0.1);
}
.service-card.selected {
    border-color: #e63946;
    background: linear-gradient(135deg, rgba(230,57,70,0.03), rgba(230,57,70,0.06));
    box-shadow: 0 8px 28px rgba(230, 57, 70, 0.15);
    transform: translateY(-2px);
}
.service-card.selected::before {
    content: '\2713';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    background: #e63946;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 3;
}
.service-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    position: relative;
    z-index: 1;
}
.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}
.service-card:hover .service-icon img { transform: scale(1.1); }
.service-name {
    font-size: 1rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}
.service-desc {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}
.service-price {
    font-size: 0.82rem;
    color: #e63946;
    font-weight: 700;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

/* ============================================
   BRAND & MODEL GRIDS
   ============================================ */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Brand Cards with Logo */
.brand-card {
    background: #161616;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 20px 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    transition: transform 0.3s;
}
.brand-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #f0f0f0;
    line-height: 1.2;
}
.brand-card:hover {
    border-color: #e63946;
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(230, 57, 70, 0.1);
}
.brand-card:hover .brand-logo { transform: scale(1.1); }
.brand-card.selected {
    border-color: #e63946;
    background: rgba(230, 57, 70, 0.03);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.14);
}
.brand-card.selected::after {
    content: '\2713';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    background: #e63946;
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Model Cards */
.model-card {
    background: #161616;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 700;
    font-size: 0.92rem;
    color: #f0f0f0;
    position: relative;
}
.model-card:hover {
    border-color: #e63946;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.08);
}
.model-card.selected {
    border-color: #e63946;
    background: rgba(230, 57, 70, 0.04);
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.12);
}
.model-card.selected::after {
    content: '\2713';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    background: #e63946;
    color: #fff;
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   CALENDAR — Premium
   ============================================ */
.datetime-wrap {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
    align-items: start;
}
.calendar-section {
    background: #161616;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}
.timeslots-section {
    background: #161616;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 90px;
}
.calendar-section h3, .timeslots-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: #f0f0f0;
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 2px solid #1a1a1a;
}

/* Calendar Nav */
.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.cal-nav button {
    background: #161616;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 800;
    color: #444;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cal-nav button:hover {
    border-color: #e63946;
    color: #e63946;
    background: rgba(230, 57, 70, 0.04);
}
.cal-nav span {
    font-weight: 800;
    font-size: 1.05rem;
    color: #f0f0f0;
}

/* Calendar Grid */
.calendar-grid { user-select: none; }
.cal-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}
.cal-header {
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
    padding: 8px 0;
    color: #555;
    letter-spacing: 0.5px;
}
.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: default;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
    color: #ddd;
}
.cal-day.available {
    cursor: pointer;
    color: #f0f0f0;
    background: #161616;
    border-color: rgba(255,255,255,0.06);
}
.cal-day.available:hover {
    border-color: #e63946;
    background: rgba(230, 57, 70, 0.05);
    transform: scale(1.08);
}
.cal-day.unavailable { color: #ddd; pointer-events: none; }
.cal-day.selected {
    background: #e63946 !important;
    color: #fff !important;
    border-color: #e63946 !important;
    box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35);
    font-weight: 800;
    transform: scale(1.05);
}
.cal-day.today { font-weight: 900; color: #e63946; }
.cal-day.today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #e63946;
    border-radius: 50%;
}
.cal-day.selected.today { color: #fff; }
.cal-day.selected.today::after { background: #161616; }

/* ============================================
   TIME SLOTS
   ============================================ */
.timeslots-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
    padding-left: 4px;
}
.timeslots-grid::-webkit-scrollbar { width: 4px; }
.timeslots-grid::-webkit-scrollbar-track { background: #1a1a1a; border-radius: 4px; }
.timeslots-grid::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.time-slot {
    padding: 14px 16px;
    background: #161616;
    border: 2px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: ltr;
}
.time-slot:hover {
    border-color: #e63946;
    background: rgba(230, 57, 70, 0.03);
    transform: translateX(-3px);
}
.time-slot.selected {
    background: linear-gradient(135deg, #e63946, #c1121f);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
    transform: translateX(-3px);
}
.time-slot.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}
.slot-time { font-weight: 800; font-size: 0.95rem; }
.slot-remaining { font-size: 0.72rem; color: #666; font-weight: 500; }
.time-slot.selected .slot-remaining { color: rgba(255, 255, 255, 0.75); }

/* ============================================
   CUSTOMER FORM
   ============================================ */
.customer-form-wrap { max-width: 680px; margin: 0 auto; }

.booking-summary {
    background: linear-gradient(135deg, rgba(230,57,70,0.04), rgba(230,57,70,0.08));
    border: 1px solid rgba(230, 57, 70, 0.12);
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 28px;
}
.booking-summary h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 14px;
    color: #e63946;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: #777; font-weight: 500; }
.summary-value { font-weight: 700; color: #f0f0f0; }
.summary-value[dir="ltr"] { direction: ltr; }

/* Form Fields */
.customer-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.customer-form .form-group { margin-bottom: 18px; }
.customer-form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ccc;
}
.customer-form input, .customer-form textarea {
    width: 100%;
    padding: 15px 18px;
    background: #1a1a1a;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    font-size: 0.95rem;
    color: #f0f0f0;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}
.customer-form input::placeholder, .customer-form textarea::placeholder {
    color: #555;
}
.customer-form input[type="tel"],
.customer-form input[type="email"] {
    direction: ltr;
    text-align: right;
}
.customer-form input:focus, .customer-form textarea:focus {
    border-color: #e63946;
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.08);
    background: #161616;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #e63946, #c1121f);
    color: #fff;
    border: none;
    padding: 16px 36px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-decoration: none;
}
.btn-primary:hover {
    box-shadow: 0 8px 28px rgba(230, 57, 70, 0.35);
    transform: translateY(-2px);
    color: #fff;
}
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #161616;
    color: #ccc;
    border: 2px solid #e0e0e0;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-decoration: none;
}
.btn-outline:hover { border-color: #e63946; color: #e63946; }

/* Policy Checkbox */
.policy-agree { margin-bottom: 20px !important; }
.policy-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    color: #666;
    line-height: 1.6;
    cursor: pointer;
}
.policy-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    accent-color: #e63946;
    cursor: pointer;
}
.policy-checkbox-label a {
    color: #e63946;
    font-weight: 600;
    text-decoration: underline;
}
.policy-checkbox-label a:hover { color: #c1121f; }

.btn-book {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    margin-top: 4px;
}
.btn-book:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================
   CONFIRMATION
   ============================================ */
.confirmation-wrap {
    text-align: center;
    padding: 48px 24px;
}
.confirm-icon { margin-bottom: 20px; }
.confirm-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.confirm-ref {
    font-size: 1.5rem;
    font-weight: 900;
    color: #e63946;
    margin: 14px 0;
    letter-spacing: 3px;
    direction: ltr;
    display: inline-block;
    background: rgba(230, 57, 70, 0.06);
    padding: 8px 24px;
    border-radius: 10px;
}
.confirm-details {
    max-width: 420px;
    margin: 28px auto 0;
    text-align: right;
    background: #161616;
    border-radius: 14px;
    padding: 22px 26px;
    border: 1px solid rgba(255,255,255,0.06);
}
.confirm-details .summary-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.confirm-actions {
    margin-top: 36px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   BACK BUTTON
   ============================================ */
.booking-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    padding: 10px 24px;
    background: #161616;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: #777;
    transition: all 0.25s;
    font-family: inherit;
}
.booking-back:hover { border-color: #e63946; color: #e63946; }
.booking-back i { font-size: 0.9rem; }

/* ============================================
   LOADING OVERLAY
   ============================================ */
.booking-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 16px;
    backdrop-filter: blur(4px);
}
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.06);
    border-top-color: #e63946;
    border-radius: 50%;
    animation: bkSpin 0.65s linear infinite;
}
@keyframes bkSpin { to { transform: rotate(360deg); } }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .brands-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .rcc-booking { padding: 20px 12px 60px; }

    /* Progress */
    .booking-progress { margin-bottom: 28px; max-width: 100%; }
    .booking-progress::before { left: 6%; right: 6%; top: 16px; }
    .step-num { width: 34px; height: 34px; font-size: 0.75rem; border-width: 2px; }
    .step-label { font-size: 0.6rem; max-width: 60px; }
    .progress-step.done + .progress-step::after,
    .progress-step.done + .progress-step.active::after { top: 16px; }

    /* Titles */
    .step-title { font-size: 1.35rem; margin-bottom: 24px; }

    /* Services */
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .service-card { padding: 22px 14px 18px; border-radius: 12px; }
    .service-icon { width: 44px; height: 44px; margin-bottom: 10px; }
    .service-name { font-size: 0.88rem; }
    .service-desc { display: none; }

    /* Brands / Models */
    .brands-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .brand-logo { width: 42px; height: 42px; }
    .brand-name { font-size: 0.78rem; }
    .models-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .brand-card, .model-card { padding: 14px 8px; font-size: 0.82rem; border-radius: 10px; }

    /* Calendar */
    .datetime-wrap { grid-template-columns: 1fr; gap: 16px; }
    .calendar-section, .timeslots-section {
        padding: 18px 14px;
        border-radius: 14px;
    }
    .timeslots-section { position: static; }
    .timeslots-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: none;
        overflow: visible;
    }
    .time-slot {
        flex-direction: column;
        gap: 3px;
        padding: 12px 10px;
        text-align: center;
    }
    .cal-day { font-size: 0.82rem; }

    /* Form */
    .customer-form .form-row { grid-template-columns: 1fr; }
    .customer-form-wrap { padding: 0 4px; }
    .booking-summary { padding: 16px 18px; }
    .confirm-details { padding: 16px 18px; }
}

@media (max-width: 480px) {
    .services-grid { gap: 8px; }
    .service-card { padding: 18px 10px 14px; }
    .service-icon { width: 38px; height: 38px; }
    .service-name { font-size: 0.82rem; }
    .brands-grid { grid-template-columns: repeat(3, 1fr); }
    .brand-card { padding: 14px 8px 12px; }
    .brand-logo { width: 36px; height: 36px; }
    .brand-name { font-size: 0.72rem; }
    .step-label { display: none; }
    .booking-progress::before { top: 14px; left: 10%; right: 10%; }
    .step-num { width: 30px; height: 30px; font-size: 0.7rem; }
    .progress-step.done + .progress-step::after,
    .progress-step.done + .progress-step.active::after { top: 14px; }
    .timeslots-grid { grid-template-columns: 1fr 1fr; }
    .confirm-actions { flex-direction: column; align-items: center; }
    .confirm-actions .btn { width: 100%; max-width: 260px; }
}
