/* ============================================================
   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; }

/* --- Шаги: дата и время --- */
.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%; }
}
