/* ============================================================
   Strong Shield Booking Flow — Dark-mode RTL mobile-first UI
   ============================================================ */

#ssb-modal *,
#ssb-modal *::before,
#ssb-modal *::after { box-sizing: border-box; }

/* ── Overlay ─────────────────────────────────────────── */
.ssb-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    direction: rtl;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.ssb-modal[hidden] { display: none; }

.ssb-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

/* ── Bottom sheet ────────────────────────────────────── */
.ssb-modal__sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #0a0a0a;
    border-radius: 20px 20px 0 0;
    max-height: 95dvh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ssb-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ssb-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header ──────────────────────────────────────────── */
.ssb-modal__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.ssb-modal__logo { display: flex; align-items: center; }

.ssb-modal__service-title {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.ssb-modal__close {
    background: none;
    border: none;
    color: #6a6a7a;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.ssb-modal__close:hover { color: #fff; }

/* ── Stepper ─────────────────────────────────────────── */
.ssb-stepper {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.ssb-step {
    display: flex;
    align-items: center;
    flex: 1;
}
.ssb-step:last-child { flex: 0 0 auto; }

.ssb-step__circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    flex-shrink: 0;
    transition: background 0.3s;
}

.ssb-step--current   .ssb-step__circle { background: #E11900; color: #fff; }
.ssb-step--completed .ssb-step__circle { background: #E11900; color: #fff; }
.ssb-step--upcoming  .ssb-step__circle { background: #242430; color: #5a5a6a; }

.ssb-step__line {
    flex: 1;
    height: 2px;
    min-width: 16px;
    margin: 0 2px;
    border-radius: 1px;
    transition: background 0.3s;
}
.ssb-step__line--done    { background: #E11900; }
.ssb-step__line--pending { background: #242430; }

/* ── Scrollable body ─────────────────────────────────── */
.ssb-modal__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 16px 28px;
}

.ssb-modal__body::-webkit-scrollbar { width: 3px; }
.ssb-modal__body::-webkit-scrollbar-track { background: transparent; }
.ssb-modal__body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Step title ──────────────────────────────────────── */
.ssb-step-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    text-align: right;
    margin: 0 0 18px;
}

/* ── Card list ───────────────────────────────────────── */
.ssb-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

/* ── Car card ────────────────────────────────────────── */
.ssb-card {
    background: #181820;
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ssb-card.is-selected { border-color: #E11900; }

.ssb-card__radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #3a3a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s;
}
.ssb-card.is-selected .ssb-card__radio { border-color: #E11900; }

.ssb-card__radio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E11900;
    display: none;
}
.ssb-card.is-selected .ssb-card__radio-dot { display: block; }

.ssb-card__content { flex: 1; text-align: right; }

.ssb-card__name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px;
}
.ssb-card__detail {
    font-size: 13px;
    color: #6a6a7a;
    margin: 0;
}
.ssb-card__icon { color: #3a3a4a; flex-shrink: 0; }

/* ── Branch card (column layout) ────────────────────── */
.ssb-card--branch {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 14px 16px;
}

.ssb-card--branch .ssb-card__top-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.ssb-card--branch .ssb-card__radio {
    margin-top: 3px;
}

.ssb-card--branch .ssb-card__info {
    flex: 1;
    text-align: right;
}

.ssb-card__city-badge {
    background: #142840;
    color: #60a5fa;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
    align-self: flex-start;
}

.ssb-card__map-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #E11900;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 10px;
    transition: opacity 0.2s;
}
.ssb-card__map-link:hover { opacity: 0.8; text-decoration: underline; }

/* ── Add car button ──────────────────────────────────── */
.ssb-btn-add-car {
    width: 100%;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 15px 16px;
    color: #dddddd;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 4px;
}
.ssb-btn-add-car:hover {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.03);
}

/* ── Add car form ────────────────────────────────────── */
.ssb-add-car-form {
    background: #181820;
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 18px 16px 16px;
    margin-bottom: 12px;
}

.ssb-add-car-form__title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-align: right;
    margin: 0 0 16px;
}

.ssb-field { margin-bottom: 14px; }
.ssb-field:last-child { margin-bottom: 0; }

.ssb-field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #7a7a8a;
    text-align: right;
    margin-bottom: 7px;
}

.ssb-field__input,
.ssb-field__select {
    width: 100%;
    background: #101018;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    text-align: right;
    direction: rtl;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.ssb-field__input:focus,
.ssb-field__select:focus { border-color: #E11900; }

.ssb-field__input::placeholder { color: #3a3a4a; }

.ssb-field__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a6a7a' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 36px;
    cursor: pointer;
}
.ssb-field__select option { background: #181820; color: #fff; }

.ssb-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ── Form action buttons (Save / Cancel) ─────────────── */
.ssb-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.ssb-btn-save {
    flex: 1;
    background: #E11900;
    border: none;
    border-radius: 10px;
    padding: 13px 20px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.ssb-btn-save:hover:not(:disabled) { background: #c91500; }
.ssb-btn-save:disabled { opacity: 0.6; cursor: not-allowed; }

.ssb-btn-cancel {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    padding: 12px 20px;
    color: #7a7a8a;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.ssb-btn-cancel:hover { border-color: rgba(255,255,255,0.28); color: #fff; }

/* ── Navigation buttons (Next / Prev) ────────────────── */
.ssb-nav {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.ssb-btn-next {
    flex: 1;
    background: #E11900;
    border: none;
    border-radius: 14px;
    padding: 16px 20px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}
.ssb-btn-next:hover:not(:disabled) { background: #c91500; }
.ssb-btn-next:disabled {
    background: #7a1410;
    cursor: not-allowed;
}

.ssb-btn-prev {
    flex: 0 0 82px;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    padding: 14px 12px;
    color: #7a7a8a;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-align: center;
}
.ssb-btn-prev:hover { border-color: rgba(255,255,255,0.28); color: #fff; }

/* ── Date & time step ────────────────────────────────── */
.ssb-field-section { margin-bottom: 22px; }

.ssb-date-wrapper {
    position: relative;
}

.ssb-date-wrapper input[type="date"] {
    width: 100%;
    background: #181820;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 16px 14px 46px;
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    text-align: right;
    direction: rtl;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    min-height: 52px;
}
.ssb-date-wrapper input[type="date"]:focus { border-color: #E11900; }

/* Hide native calendar icon, overlay a click target */
.ssb-date-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.ssb-date-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #5a5a6a;
    pointer-events: none;
    display: flex;
}

/* ── Time grid ────────────────────────────────────────── */
.ssb-time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ssb-time-slot {
    background: #181820;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 6px;
    color: #dddddd;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.ssb-time-slot:hover { border-color: rgba(255,255,255,0.25); }
.ssb-time-slot.is-selected {
    background: rgba(225, 25, 0, 0.14);
    border-color: #E11900;
    color: #E11900;
}

/* ── Summary / confirm step ──────────────────────────── */
.ssb-summary-card {
    background: #181820;
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 18px 16px 14px;
    margin-bottom: 14px;
}

.ssb-summary-card__title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-align: right;
    margin: 0 0 14px;
}

.ssb-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.ssb-summary-row:first-of-type { border-top: none; }

.ssb-summary-row__label {
    font-size: 13px;
    color: #6a6a7a;
    font-weight: 500;
    flex-shrink: 0;
    padding-right: 8px;
}

.ssb-summary-row__value {
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
    text-align: left;
}

.ssb-summary-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 6px 0 12px;
}

.ssb-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
}

.ssb-summary-total__label {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.ssb-summary-total__value {
    font-size: 22px;
    font-weight: 800;
    color: #E11900;
    direction: ltr;
}

/* ── Pay note ─────────────────────────────────────────── */
.ssb-pay-note {
    background: #141a28;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    color: #7a8aa8;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* ── Confirm button ──────────────────────────────────── */
.ssb-btn-confirm {
    flex: 1;
    background: #E11900;
    border: none;
    border-radius: 14px;
    padding: 16px 20px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.ssb-btn-confirm:hover:not(:disabled) { background: #c91500; }
.ssb-btn-confirm:disabled { background: #7a1410; cursor: not-allowed; }

/* ── Success screen ──────────────────────────────────── */
.ssb-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 44px 20px 32px;
    text-align: center;
    gap: 14px;
}

.ssb-success__icon {
    width: 72px;
    height: 72px;
    background: rgba(34, 197, 94, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
}

.ssb-success__title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.ssb-success__desc {
    font-size: 14px;
    color: #6a6a7a;
    margin: 0;
    line-height: 1.7;
    max-width: 280px;
}

.ssb-success__close {
    background: #E11900;
    border: none;
    border-radius: 14px;
    padding: 14px 36px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
}

/* ── Loading / spinner ────────────────────────────────── */
.ssb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}

.ssb-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: #E11900;
    border-radius: 50%;
    animation: ssb-spin 0.75s linear infinite;
}

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

/* ── Error message ────────────────────────────────────── */
.ssb-error-msg {
    background: rgba(225,25,0,0.1);
    border: 1px solid rgba(225,25,0,0.3);
    border-radius: 10px;
    padding: 12px 14px;
    color: #ff6060;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    margin-bottom: 14px;
}

/* ── Empty state ──────────────────────────────────────── */
.ssb-empty-cars {
    text-align: center;
    color: #5a5a6a;
    font-size: 14px;
    padding: 16px 0 8px;
}

/* ── Desktop ─────────────────────────────────────────── */
@media (min-width: 600px) {
    .ssb-modal { align-items: center; padding: 20px; }
    .ssb-modal__sheet { border-radius: 20px; max-height: 90vh; }
}
