.wcb-booking-widget {
    max-width: 560px;
    margin: 0 0 24px;
    --wcb-accent: var(--wp--preset--color--primary, #3788d8);
    --wcb-border: var(--wp--preset--color--contrast-2, #e2e2e2);
    --wcb-muted-bg: var(--wp--preset--color--base-2, #f7f8fa);
    --wcb-radius: 6px;
}

.wcb-booking-widget .wcb-step {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--wcb-border);
}

.wcb-booking-widget select,
.wcb-booking-widget input[type="text"],
.wcb-booking-widget input[type="email"],
.wcb-booking-widget input[type="number"],
.wcb-booking-widget input[type="tel"],
.wcb-booking-widget input[type="date"],
.wcb-booking-widget textarea {
    width: 100%;
    max-width: 400px;
    display: block;
    margin-top: 4px;
}

.wcb-booking-widget .wcb-quantity {
    max-width: 100px;
}

.wcb-branch-field > label,
.wcb-employee-field > label,
.wcb-options-field > label,
.wcb-rental-date-field > label,
.wcb-rental-date-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.wcb-rental-date-field {
    margin-bottom: 16px;
}

.wcb-rental-price-preview {
    font-weight: 600;
    margin: 8px 0;
}

.wcb-required {
    color: #c0392b;
}

/* نص مقروء لقارئ الشاشة فقط -- يُستخدَم لنص حالة الخطوة النصي ولتسمية أزرار تقويم
   السابق/التالي، بدل تكرار نمط "clip" هذا في كل موضع على حدة */
.wcb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* الاتجاه محدَّد نصًا لا صنفًا (Prev/Next وأزرار التقويم ثابتة دائمًا)؛ فقط الأيقونة
   البصرية داخلها تُعكَس أفقيًا في RTL، بنفس أسلوب شاشة التقويم الإدارية */
[dir="rtl"] .wcb-dir-icon {
    display: inline-block;
    transform: scaleX(-1);
}

/* ---------------- Step progress (Wizard/Sidebar/Card only) ---------------- */

.wcb-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.wcb-progress:empty {
    display: none;
}

.wcb-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wcb-border);
    flex: none;
}

.wcb-progress-dot.wcb-progress-done,
.wcb-progress-dot.wcb-progress-active {
    background: var(--wcb-accent);
}

.wcb-progress-dot.wcb-progress-active {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wcb-accent) 20%, transparent);
}

.wcb-progress-line {
    flex: 1 1 auto;
    height: 1px;
    background: var(--wcb-border);
}

/* ---------------- Step navigation (Back) ---------------- */

.wcb-step-nav {
    margin-bottom: 16px;
}

.wcb-details-error,
.wcb-rental-dates-error {
    color: #c0392b;
    font-weight: 600;
}

/* ---------------- Chip/pill selectors: branch, employee, pricing options ---------------- */

.wcb-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcb-chip {
    padding: 6px 14px;
    border: 1px solid var(--wcb-accent);
    border-radius: 999px;
    background: #fff;
    color: var(--wcb-accent);
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
}

.wcb-chip.wcb-chip-selected {
    background: var(--wcb-accent);
    color: #fff;
}

.wcb-chip:disabled,
.wcb-chip[hidden] {
    opacity: 0.3;
    cursor: default;
}

/* ---------------- Date picker: bubbles ---------------- */

.wcb-week-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.wcb-week-toolbar button {
    background: #fff;
    border: 1px solid var(--wcb-border);
    border-radius: var(--wcb-radius);
    padding: 4px 10px;
    cursor: pointer;
}

.wcb-week-toolbar button:hover:not(:disabled) {
    border-color: var(--wcb-accent);
    color: var(--wcb-accent);
}

.wcb-week-toolbar button:disabled {
    opacity: 0.4;
    cursor: default;
}

.wcb-day-bubbles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wcb-day-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 1px solid var(--wcb-accent);
    border-radius: 50%;
    background: #fff;
    color: var(--wcb-accent);
    cursor: pointer;
}

.wcb-day-bubble .wcb-bubble-dow {
    font-size: 10px;
    text-transform: uppercase;
}

.wcb-day-bubble .wcb-bubble-day {
    font-size: 16px;
    font-weight: 600;
}

.wcb-day-bubble:disabled {
    opacity: 0.3;
    cursor: default;
}

.wcb-day-bubble.wcb-day-bubble-selected {
    background: var(--wcb-accent);
    color: #fff;
}

/* ---------------- Date picker: calendar ---------------- */

.wcb-slot-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wcb-slot-calendar-toolbar button {
    background: #fff;
    border: 1px solid var(--wcb-border);
    border-radius: var(--wcb-radius);
    padding: 4px 10px;
    cursor: pointer;
}

.wcb-slot-calendar-toolbar button:hover:not(:disabled) {
    border-color: var(--wcb-accent);
    color: var(--wcb-accent);
}

.wcb-slot-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* الوضع "تقويم" يظهر كبيرًا جدًا افتراضيًا لأنه يمتد بعرض الودجت بالكامل؛ نُصغّره إلى 60% تقريبًا */
.wcb-date-picker[data-mode="calendar"] .wcb-slot-calendar-toolbar,
.wcb-date-picker[data-mode="calendar"] .wcb-slot-calendar-grid {
    max-width: 60%;
    margin-inline: auto;
}

.wcb-cal-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    padding: 4px 0;
}

.wcb-date-picker[data-mode="calendar"] .wcb-cal-day-header {
    font-size: 10px;
}

.wcb-cal-day {
    aspect-ratio: 1;
    border: 1px solid var(--wcb-border);
    background: #fff;
    cursor: pointer;
    border-radius: 3px;
}

.wcb-date-picker[data-mode="calendar"] .wcb-cal-day {
    font-size: 12px;
}

.wcb-cal-day:disabled {
    color: #ccc;
    cursor: default;
}

.wcb-cal-day.wcb-cal-other-month {
    color: #ccc;
}

.wcb-cal-day.wcb-cal-day-selected {
    background: var(--wcb-accent);
    color: #fff;
    border-color: var(--wcb-accent);
}

/* تقويم مدى الإيجار الواحد: طرفا المدى (استلام/إرجاع) بلون الحالة الأساسي كأي يوم مُختار،
   والأيام الواقعة بينهما بخلفية أفتح فقط لإعطاء إحساس "شريط مدى" متصل دون تكرار لون التمييز
   القوي على كل يوم بينهما -- wcb-cal-day-range-hover نفس الفكرة أثناء التحويم فقط، قبل تثبيت
   الإرجاع فعليًا بالنقر. */
.wcb-cal-day.wcb-cal-day-in-range,
.wcb-cal-day.wcb-cal-day-range-hover {
    background: rgba(55, 136, 216, 0.15);
    border-radius: 0;
}

.wcb-cal-day.wcb-cal-day-range-start {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

.wcb-cal-day.wcb-cal-day-range-end {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
}

.wcb-rental-range-labels {
    display: flex;
    gap: 24px;
    margin-bottom: 10px;
}

.wcb-rental-range-labels .wcb-rental-date-field-label {
    margin-bottom: 0;
}

/* ---------------- Slots ---------------- */

.wcb-slots {
    margin-top: 10px;
}

.wcb-slot-group + .wcb-slot-group {
    margin-top: 14px;
}

.wcb-slot-group-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.wcb-slot-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcb-slot {
    padding: 6px 12px;
    border: 1px solid var(--wcb-accent);
    background: #fff;
    color: var(--wcb-accent);
    border-radius: 3px;
    cursor: pointer;
}

.wcb-slot.wcb-slot-selected {
    background: var(--wcb-accent);
    color: #fff;
}

/* ---------------- Buttons (Confirm Booking / Back / result actions) ---------------- */

.wcb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--wcb-radius);
    border: 1px solid var(--wcb-border);
    background: #fff;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wcb-btn:hover {
    border-color: var(--wcb-accent);
    color: var(--wcb-accent);
}

.wcb-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.wcb-btn-primary {
    background: var(--wcb-accent);
    border-color: var(--wcb-accent);
    color: #fff;
}

.wcb-btn-primary:hover {
    filter: brightness(0.92);
    color: #fff;
}

/* ---------------- Waiting list (no slots on selected date) ---------------- */

.wcb-waitlist-form {
    margin-top: 10px;
    padding: 12px 16px;
    background: var(--wcb-muted-bg);
    border: 1px solid var(--wcb-border);
    /* حافة بادئة مُميَّزة بلون العلامة التجارية (خاصية منطقية، تنعكس تلقائيًا في RTL) حتى يقرأ
       هذا النموذج كبديل فعلي متاح، لا كامتداد بصري لرسالة "لا مواعيد متاحة" الفارغة أعلاه */
    border-inline-start: 3px solid var(--wcb-accent);
    border-radius: var(--wcb-radius);
}

.wcb-waitlist-form label {
    display: block;
    font-weight: 600;
    margin: 8px 0 4px;
}

.wcb-waitlist-form input {
    max-width: 260px;
}

.wcb-waitlist-result {
    color: #c0392b;
    font-size: 13px;
}

/* ---------------- Result ---------------- */

.wcb-added-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f0f9f1;
    border: 1px solid #1a7f37;
    border-radius: var(--wcb-radius);
    color: #1a7f37;
    font-weight: 600;
}

.wcb-added-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a7f37;
    color: #fff;
    font-size: 12px;
    flex: none;
}

.wcb-result .wcb-error {
    color: #c0392b;
    font-weight: 600;
}

.wcb-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* ---------------- Summary panel ---------------- */

.wcb-summary {
    display: none;
    background: var(--wcb-muted-bg);
    border: 1px solid var(--wcb-border);
    border-radius: var(--wcb-radius);
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.wcb-summary h4 {
    margin: 0 0 8px;
}

.wcb-summary-total {
    font-size: 20px;
    font-weight: 700;
}

.wcb-summary-deposit-note {
    line-height: 1.6;
}

/* "المستحق الآن" هو الرقم الأهم قرارًا للعميل عند هذه النقطة (سيُدفَع فورًا)، فيحصل على
   وزنًا بصريًا أكبر من "المتبقي عند الموعد" بدل تساويهما بصريًا كما سابقًا (كان الفرق الوحيد
   وسم <strong> على الرقم فقط) -- القيمتان ومصدر حسابهما (calcDepositDue) بلا أي تغيير */
.wcb-due-now {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.wcb-due-later {
    display: block;
    font-size: 12.5px;
    color: #666;
}

/* يُلصَق أسفل عرض السعر الأصلي في صفحة المنتج مباشرة (انظر updatePriceRuleNotice في
   wcb-public.js) -- يُضاف للـ DOM فقط عند وجود قاعدة تسعير مطابقة فعليًا ويُزال تمامًا حين
   تنتفي المطابقة، فلا حاجة لإخفائه بـ display هنا. */
.wcb-price-change-notice {
    display: block;
    background: var(--wcb-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--wcb-radius);
    margin-top: 6px;
}

/* ---------------- My Account bookings table ---------------- */

/* غلاف تمرير أفقي للجدول فقط على الشاشات الضيقة (لا الصفحة كاملة) -- نفس تقنية
   .wcb-table-scroll المُستخدَمة في admin/css/wcb-admin.css، منقولة إلى هذه الورقة المنفصلة */
.wcb-table-scroll {
    overflow-x: auto;
}

.wcb-my-bookings-feedback {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 10px;
    min-height: 1.4em;
}

.wcb-my-bookings-feedback.wcb-feedback-success {
    color: #1a7f37;
}

.wcb-my-bookings-feedback.wcb-feedback-error {
    color: #c0392b;
}

/* حالة "مسلَّحة" لزر الإلغاء بعد الضغطة الأولى -- نفس نمط .wcb-armed الإداري (لون/نص)
   منقول محليًا هنا لأن wcb-public.js وwcb-admin.js ملفان منفصلان بلا وحدة مشتركة بينهما */
.wcb-my-cancel.wcb-armed {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.wcb-my-bookings-table th,
.wcb-my-bookings-table td {
    padding: 8px 10px;
}

.wcb-balance-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.wcb-balance-badge.wcb-balance-due {
    background: #fdecea;
    color: #c0392b;
}

.wcb-balance-badge.wcb-balance-paid {
    background: #eafaf0;
    color: #1a7f37;
}

.wcb-my-week-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0;
}

.wcb-my-no-actions {
    color: #888;
}

.wcb-my-reschedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--wcb-border, #e2e2e2);
}

.wcb-my-reschedule-cancel {
    padding: 4px 12px;
    border: 1px solid var(--wcb-border, #e2e2e2);
    border-radius: var(--wcb-radius, 6px);
    background: #fff;
    cursor: pointer;
}

.wcb-my-reschedule-cancel:hover {
    border-color: var(--wcb-accent, #3788d8);
    color: var(--wcb-accent, #3788d8);
}

/* =========================================================
   Templates
   ========================================================= */

/* Wizard (default): vertical steps, no special layout beyond the base styles above. */

/* Single Page: no step borders/spacing since everything is visible together, tighter layout. */
.wcb-template-single_page .wcb-step {
    border-bottom: none;
    padding-bottom: 4px;
    margin-bottom: 12px;
}

/* Sidebar Summary: two-column layout with a sticky price/summary card. */
.wcb-template-sidebar {
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

.wcb-template-sidebar .wcb-summary {
    display: block;
    position: sticky;
    top: 20px;
}

/* Card Carousel: each step rendered as an elevated card, one visible at a time. */
.wcb-template-card .wcb-step {
    border: 1px solid var(--wcb-border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid var(--wcb-border);
}

.wcb-template-card .wcb-step h3 {
    margin-top: 0;
    color: var(--wcb-accent);
}

/* نقطة الانكسار الوحيدة في هذه الورقة، بنفس القيمة (782px) المُستخدَمة أصلًا في شاشتَي
   الإعدادات والحجوزات الإداريتين -- توحيدًا لقيمة الانكسار عبر الإضافة كلها بدل ابتكار قيمة
   جديدة خاصة بهذه الشاشة فقط */
@media (max-width: 782px) {
    /* عمود الملخّص الثابت (300px) لا يتّسع على شاشة ضيقة؛ يتحول إلى عمود واحد ويفقد
       "sticky" التي لا معنى لها خارج تخطيط جانبي أصلًا */
    .wcb-template-sidebar {
        grid-template-columns: 1fr;
    }

    .wcb-template-sidebar .wcb-summary {
        position: static;
    }

    /* وضع "تقويم" مُصغَّر عمدًا إلى 60% على الشاشات الواسعة (انظر التعليق أعلاه)؛ على شاشة
       ضيقة أصلًا لا داعي لتصغيره أكثر، فيمتد ليملأ العرض المتاح كوضع "فقاعات" تمامًا */
    .wcb-date-picker[data-mode="calendar"] .wcb-slot-calendar-toolbar,
    .wcb-date-picker[data-mode="calendar"] .wcb-slot-calendar-grid {
        max-width: 100%;
    }

    .wcb-template-card .wcb-step {
        padding: 14px;
    }
}

@media (prefers-color-scheme: dark) {
    .wcb-summary,
    .wcb-template-card .wcb-step {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .wcb-chip {
        background: transparent;
    }

    .wcb-slot-group-title {
        color: #aaa;
    }
}
