/* ============================================================
   assets/css/booking.css — блок «Онлайн-запись»
   Движковый стиль: нейтральная база + CSS-переменные темы.
   Подключается только на страницах с блоком booking_form.
   ============================================================ */

.td-book-section {
    padding: 56px 20px;
    background: var(--color-bg-warm, #f7f7f5);
}
.td-book-section .td-container {
    max-width: 860px;
    margin: 0 auto;
}

.td-book-head { text-align: center; margin-bottom: 28px; }
.td-book-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--color-primary, #ec7404);
    margin-bottom: 10px;
}
.td-book-head .td-title { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; margin: 0 0 8px; }
.td-book-head .td-subtitle { color: var(--color-text-secondary, #666); font-size: 14px; margin: 0; }

/* --- Запись по телефону (когда онлайн-запись выключена) --- */
.td-book-unavail {
    background: #fff;
    border: 1px solid var(--color-border, #e8e4df);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
}
.td-book-phone {
    display: inline-block;
    font-size: 24px;
    font-weight: 800;
    color: var(--color-primary, #ec7404);
    text-decoration: none;
    margin-bottom: 8px;
}
.td-book-schedule, .td-book-address {
    color: var(--color-text-secondary, #666);
    font-size: 14px;
    margin: 4px 0 0;
}

/* --- Форма --- */
.td-book-form {
    background: #fff;
    border: 1px solid var(--color-border, #e8e4df);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--color-card-shadow, 0 2px 8px rgba(0,0,0,.04));
    position: relative;
}
.td-book-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}
.td-book-field-wide { grid-column: 1 / -1; }
.td-book-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--color-text-secondary, #666);
    margin-bottom: 6px;
}
.td-book-field input,
.td-book-field select,
.td-book-field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--color-text, #1a1a1a);
    box-sizing: border-box;
}
.td-book-field input:focus,
.td-book-field select:focus,
.td-book-field textarea:focus {
    outline: none;
    border-color: var(--color-primary, #ec7404);
    box-shadow: 0 0 0 3px rgba(236, 116, 4, .12);
}
.td-book-field textarea { resize: vertical; min-height: 56px; }

/* --- Пикер услуг (v1.2.4): цветные отделы + цены, шрифт компактнее --- */

/* Палитра отделов: 8 цветов, назначаются по порядку (svc-c0…svc-c7) */
.td-book-svc { position: relative; }
.td-book-svc-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.td-book-svc-btn svg { flex: 0 0 auto; color: var(--color-text-muted, #999); transition: transform .18s; }
.td-book-svc.open .td-book-svc-btn svg { transform: rotate(180deg); }
.td-book-svc.open .td-book-svc-btn,
.td-book-svc-btn:focus-visible { outline: none; border-color: var(--color-primary, #ec7404); box-shadow: 0 0 0 3px rgba(236,116,4,.12); }
.td-book-svc-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.td-book-svc-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1200;
    background: #fff;
    border: 1px solid var(--color-border, #e8e4df);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(2, 8, 23, .16);
    padding: 6px;
    max-height: 340px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.td-book-svc.open .td-book-svc-panel { display: block; }

/* Секция отдела: цветная полоса слева + имя отдела в его цвете */
.td-book-svc-dept { position: relative; padding: 6px 4px 4px 12px; }
.td-book-svc-dept::before {
    content: '';
    position: absolute;
    left: 2px; top: 10px; bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: var(--svc-color, #94a3b8);
}
.td-book-svc-dept.svc-c0 { --svc-color: #2563eb; }
.td-book-svc-dept.svc-c1 { --svc-color: #059669; }
.td-book-svc-dept.svc-c2 { --svc-color: #d97706; }
.td-book-svc-dept.svc-c3 { --svc-color: #7c3aed; }
.td-book-svc-dept.svc-c4 { --svc-color: #db2777; }
.td-book-svc-dept.svc-c5 { --svc-color: #0891b2; }
.td-book-svc-dept.svc-c6 { --svc-color: #4d7c0f; }
.td-book-svc-dept.svc-c7 { --svc-color: #dc2626; }

.td-book-svc-dept-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 6px 6px;
    flex-wrap: wrap;
}
.td-book-svc-dept-name {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--svc-color, #64748b);
}
.td-book-svc-dept-sched {
    font-size: 11px;
    color: var(--color-text-muted, #999);
    white-space: nowrap;
}

/* Строка услуги: название слева, длительность и цена справа.
   Шрифт мельче, чем раньше было в select (15px → 13.5px). */
.td-book-svc-item {
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background .12s;
}
.td-book-svc-item:hover { background: #f1f5f9; }
.td-book-svc-item.selected { background: color-mix(in srgb, var(--svc-color, #2563eb) 12%, #fff); }
.td-book-svc-item.selected .td-book-svc-item-title { color: var(--svc-color, #2563eb); font-weight: 700; }
.td-book-svc-item-title { font-size: 13.5px; font-weight: 600; color: var(--color-text, #1a1a1a); line-height: 1.35; }
.td-book-svc-item-meta { display: inline-flex; align-items: baseline; gap: 10px; flex: 0 0 auto; }
.td-book-svc-item-meta .svc-dur { font-size: 11.5px; color: var(--color-text-muted, #999); white-space: nowrap; }
.td-book-svc-item-meta .svc-price { font-size: 13px; font-weight: 800; color: var(--color-primary, #ec7404); white-space: nowrap; }

/* --- Шаги: дата и время --- */
.td-book-step { margin-bottom: 20px; }
.td-book-step-title {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--color-text, #1a1a1a);
}
.td-book-dates {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.td-book-date {
    flex: 0 0 auto;
    min-width: 76px;
    padding: 9px 10px;
    text-align: center;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, background .15s, transform .15s;
    font-family: inherit;
    line-height: 1.25;
}
.td-book-date:hover { border-color: var(--color-primary, #ec7404); transform: translateY(-1px); }
.td-book-date .d-dow { display: block; font-size: 11px; color: var(--color-text-muted, #999); text-transform: capitalize; }
.td-book-date .d-day { display: block; font-size: 17px; font-weight: 800; }
.td-book-date .d-mon { display: block; font-size: 11px; color: var(--color-text-muted, #999); text-transform: capitalize; }
.td-book-date.selected {
    background: var(--color-primary, #ec7404);
    border-color: var(--color-primary, #ec7404);
    color: #fff;
}
.td-book-date.selected .d-dow,
.td-book-date.selected .d-mon { color: rgba(255,255,255,.85); }
.td-book-date:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.td-book-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}
.td-book-times-hint { color: var(--color-text-muted, #999); font-size: 13px; align-self: center; }
.td-book-times .td-book-loading { color: var(--color-text-muted, #999); font-size: 13px; align-self: center; }
.td-book-time {
    padding: 9px 14px;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-family: inherit;
}
.td-book-time:hover { border-color: var(--color-primary, #ec7404); }
.td-book-time.selected {
    background: var(--color-dark, #011846);
    border-color: var(--color-dark, #011846);
    color: #fff;
}
.td-book-times-empty { color: var(--color-text-muted, #999); font-size: 13px; }

/* --- Кнопка и сообщения --- */
.td-book-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.td-book-submit {
    padding: 13px 34px;
    border: none;
    border-radius: 12px;
    background: var(--color-primary, #ec7404);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    font-family: inherit;
}
.td-book-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.td-book-submit:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }

.td-book-msg { font-size: 14px; font-weight: 600; flex: 1 1 auto; }
.td-book-msg.ok { color: #1e8e3e; }
.td-book-msg.err { color: #c5221f; }

.td-book-agree {
    color: var(--color-text-muted, #999);
    font-size: 12px;
    margin: 14px 0 0;
}

/* --- Экран успеха --- */
.td-book-success {
    text-align: center;
    padding: 34px 20px;
}
.td-book-success .td-book-check {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e6f4ea;
    color: #1e8e3e;
    font-size: 32px;
    line-height: 64px;
    font-weight: 800;
}
.td-book-success h3 { font-size: 20px; margin: 0 0 8px; }
.td-book-success p { color: var(--color-text-secondary, #666); font-size: 14px; margin: 0 0 6px; }
.td-book-success .td-book-sum {
    display: inline-block;
    background: var(--color-bg-warm, #faf8f5);
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 700;
    margin-top: 10px;
}

/* --- Адаптив --- */
@media (max-width: 640px) {
    .td-book-section { padding: 40px 16px; }
    .td-book-form { padding: 16px; border-radius: 14px; }
    .td-book-grid { grid-template-columns: 1fr; }
    .td-book-footer { flex-direction: column; align-items: stretch; text-align: center; }
    .td-book-submit { width: 100%; }
}
