/* =====================================================================
   فرم رزرو نوبت — استایل
===================================================================== */

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

.booking-modal {
    position: fixed;
    inset: 0;
    max-width: 100vw;
    overscroll-behavior: contain;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.booking-modal.show { opacity: 1; pointer-events: all; }

.booking-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 16, 14, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.booking-box {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 24px;
    padding: 26px 22px 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(30px) scale(0.97);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

.booking-modal.show .booking-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.booking-close {
    position: absolute;
    top: 12px;
    left: 14px;
    background: #f2f6f4;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.25s ease, color 0.25s ease;
    z-index: 2;
}
.booking-close:hover { background: var(--color-primary); color: #fff; }

.booking-header { text-align: center; margin-bottom: 14px; }
.booking-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: #0a2f24;
    margin: 4px 0 4px;
}
.booking-header p {
    font-size: 13px;
    color: #6b7a75;
    line-height: 1.8;
}

/* ---------- نشانگر مراحل ---------- */
.booking-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}
.booking-step-dot {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #b7c4bf;
    font-weight: 700;
}
.booking-step-dot::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e3ece8;
    transition: background 0.25s ease, transform 0.25s ease;
}
.booking-step-dot.active { color: var(--color-primary); }
.booking-step-dot.active::before { background: var(--color-primary-light); transform: scale(1.25); }
.booking-step-dot.done::before { background: var(--color-primary); }
.booking-step-line {
    width: 18px;
    height: 1.5px;
    background: #e3ece8;
}

/* ---------- گام‌ها ---------- */
.booking-step[hidden] { display: none; }

/* ---------- تقویم ---------- */
.booking-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.booking-calendar-nav button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #e3ece8;
    background: #f8faf9;
    color: var(--color-primary);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}
.booking-calendar-nav button:hover:not(:disabled) { background: #eef4f2; }
.booking-calendar-nav button:disabled { opacity: 0.3; cursor: not-allowed; }

#calMonthLabel { font-weight: 800; color: #0a2f24; font-size: 15.5px; }

.booking-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11.5px;
    color: #9aa8a3;
    margin-bottom: 6px;
    font-weight: 700;
}

.booking-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 6px;
}

.cal-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1.5px solid transparent;
    background: #f8faf9;
    color: #1a1a1a;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.cal-day--empty { background: transparent; cursor: default; }
.cal-day--today { border-color: var(--color-primary-light); font-weight: 800; }
.cal-day--disabled {
    background: transparent;
    color: #d3dcd8;
    cursor: not-allowed;
    text-decoration: line-through;
}
.cal-day:not(.cal-day--disabled):not(.cal-day--empty):hover {
    background: #eef4f2;
    transform: translateY(-1px);
}
.cal-day--selected {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 800;
}

.booking-calendar-legend {
    display: flex;
    gap: 14px;
    justify-content: center;
    font-size: 11px;
    color: #9aa8a3;
    margin: 8px 0 14px;
    flex-wrap: wrap;
}
.booking-calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend-dot--today { border: 1.5px solid var(--color-primary-light); }
.legend-dot--disabled { background: #eef1ef; }
.legend-dot--selected { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)); }

/* ---------- ساعت‌ها ---------- */
.booking-slots-wrap { margin-top: 6px; }
.booking-slots-wrap h4 {
    font-size: 13.5px;
    color: #0a2f24;
    margin-bottom: 10px;
    text-align: center;
}
.booking-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.slot-btn {
    padding: 10px 6px;
    border-radius: 10px;
    border: 1.5px solid #e3ece8;
    background: #f8faf9;
    color: #0a2f24;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    direction: ltr;
}
.slot-btn:hover { border-color: var(--color-primary-light); background: #eef4f2; }
.slot-btn--selected {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    border-color: transparent;
}
.booking-slots-empty {
    text-align: center;
    font-size: 12.5px;
    color: #c0392b;
    background: #fdf1ef;
    border-radius: 10px;
    padding: 10px;
}

.booking-next-btn {
    width: 100%;
    margin-top: 14px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    box-shadow: 0 10px 24px rgba(var(--color-primary-rgb), 0.3);
}
.booking-next-btn:hover:not(:disabled) { transform: translateY(-2px); }
.booking-next-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- گام ۲: فرم ---------- */
.summary-chip {
    display: inline-block;
    background: #eef4f2;
    color: var(--color-primary);
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 999px;
    margin: 0 4px 10px;
}
.booking-selected-summary { text-align: center; margin-bottom: 14px; }

#bookingForm { display: flex; flex-direction: column; gap: 10px; }

#bookingForm input,
#bookingForm select,
#bookingForm textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid #e3ece8;
    background: #f8faf9;
    font-family: inherit;
    font-size: 14px;
    color: #1a1a1a;
    text-align: right;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
#bookingForm select { cursor: pointer; }
#bookingForm textarea { resize: vertical; min-height: 70px; }

#bookingForm input:focus,
#bookingForm select:focus,
#bookingForm textarea:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-light-rgb), 0.15);
}

#bookingForm input.invalid { border-color: #e63946; animation: bookingShake 0.4s ease; }

@keyframes bookingShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.booking-error {
    color: #e63946;
    font-size: 12.5px;
    min-height: 16px;
}

.booking-nav-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.booking-nav-buttons .booking-next-btn { margin-top: 0; }
.booking-back-btn {
    flex: 0 0 auto;
    background: #f2f6f4;
    color: #4c625b;
    border: 1.5px solid #e3ece8;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}
.booking-back-btn:hover { background: #eef4f2; }

/* ---------- گام ۳: انتخاب روش ارسال ---------- */
.booking-final-note {
    text-align: center;
    font-size: 13px;
    color: #6b7a75;
    line-height: 1.9;
    margin-bottom: 12px;
}
.booking-summary-box {
    text-align: center;
    background: #f8faf9;
    border: 1.5px dashed #d7e3de;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
}

.booking-channels {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.booking-channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.booking-channel-btn:hover { transform: translateY(-2px); }
.booking-channel-btn.wa    { background: linear-gradient(135deg, #25d366, #128c7e); }
.booking-channel-btn.tg    { background: linear-gradient(135deg, #34aadf, #1c7bb0); }
.booking-channel-btn.bale { background: linear-gradient(135deg, #ffb800, #d98c00); }
.booking-channel-btn.sms  { background: linear-gradient(135deg, #8a7cff, #5b4fd9); }

.booking-note-small {
    text-align: center;
    font-size: 11.5px;
    color: #9aa8a3;
    line-height: 1.8;
}

/* ---------- توست ---------- */
.booking-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0a2f24;
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 13px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    z-index: 100001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 90vw;
    text-align: center;
}
.booking-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 420px) {
    .booking-box { padding: 22px 16px 18px; border-radius: 20px; }
    .booking-slots-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .booking-box, .booking-modal, .cal-day, .slot-btn, .booking-channel-btn { transition: none; }
}
