/**
 * BIONIKA BOOKING WIDGET STYLES
 * Стили в фирменных цветах клиники Bionika
 * Адаптивный дизайн (mobile-first)
 */

/* ========================================
   BOX SIZING FIX
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ========================================
   ПЕРЕМЕННЫЕ (из вашего сайта)
   ======================================== */
:root {
    /* Цвета Bionika */
    --primary-color: #0F766E;
    --primary-dark: #0A4F41;
    --primary-light: #13A38C;
    --secondary-color: #F5F7FA;
    --accent-color: #F4B266;
    --accent-soft: #FFE3C1;

    /* Текст */
    --text-dark: #2C3E50;
    --text-light: #6B7280;
    --text-white: #FFFFFF;

    /* Фон */
    --bg-light: #F5F7FA;
    --bg-white: #FFFFFF;
    --bg-muted: #EEF2F6;

    /* Статусы */
    --success-color: #059669;
    --error-color: #DC2626;
    --warning-color: #F59E0B;

    /* Тени */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(63, 169, 162, 0.15);

    /* Радиус */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Шрифт */
    --font-family: 'Cormorant Garamond', serif;
}

/* ========================================
   БАЗОВЫЕ СТИЛИ
   ======================================== */
.booking-widget {
    font-family: var(--font-family);
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .booking-widget {
        padding: 1.5rem;
        border-radius: 0;
    }
}

/* ========================================
   КНОПКА ВОЗВРАТА НА ГЛАВНУЮ
   ======================================== */
.back-to-home-btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-muted);
    color: var(--text-dark);
    text-decoration: none;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-muted);
    transition: all 0.2s ease;
}

.back-to-home-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}

/* ========================================
   ШАПКА ВИДЖЕТА
   ======================================== */
.booking-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 1.5rem;
}

.booking-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.booking-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Переключатель языка */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-light);
    background: var(--bg-white);
    color: var(--primary-color);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--primary-light);
    color: var(--text-white);
}

.lang-btn.active {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-dark);
}

/* ========================================
   ШАГИ ЗАПИСИ
   ======================================== */
.booking-step {
    margin-bottom: 2rem;
    clear: both;
}

.booking-step.hidden {
    display: none;
}

.step-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: var(--text-white);
    border-radius: 50%;
    font-size: 1.125rem;
    font-weight: 600;
}

/* ========================================
   ШАГ 1: СПИСОК УСЛУГ С ЦЕНАМИ
   ======================================== */
.service-search {
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.search-input {
    width: 90%;
    padding: 0.875rem 1rem;
    font-family: var(--font-family);
    font-size: 1rem;
    border: 2px solid var(--bg-muted);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease;
    display: block;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.services-list {
    display: grid;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Карточка услуги (с ценой!) */
.service-card {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.75rem 1rem;
    padding: 1rem;
    border: 2px solid var(--bg-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-white);
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.service-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.service-card.selected {
    border-color: var(--primary-color);
    background: rgba(15, 118, 110, 0.05);
}

.service-icon {
    grid-row: 1 / 3;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-info {
    grid-column: 2;
}

.service-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.service-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* ЦЕНА - большая и заметная! */
.service-price {
    grid-column: 3;
    grid-row: 1;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.service-duration {
    grid-column: 3;
    grid-row: 2;
    font-size: 0.8125rem;
    color: var(--text-light);
    display: flex;
    align-items: flex-end;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .service-card {
        grid-template-columns: 40px 1fr;
        grid-template-rows: auto auto auto;
    }

    .service-icon {
        grid-row: 1 / 4;
        font-size: 1.75rem;
    }

    .service-info {
        grid-column: 2;
        grid-row: 1;
    }

    .service-price {
        grid-column: 2;
        grid-row: 2;
        font-size: 1.25rem;
        justify-content: flex-start;
    }

    .service-duration {
        grid-column: 2;
        grid-row: 3;
        justify-content: flex-start;
    }
}

/* Заметка к услуге (например, "голодная пауза") */
.service-note {
    grid-column: 1 / 4;
    font-size: 0.8125rem;
    color: var(--warning-color);
    background: var(--accent-soft);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

/* ========================================
   ШАГ 2: КАЛЕНДАРЬ
   ======================================== */
.selected-service-summary {
    background: var(--secondary-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.calendar-widget {
    background: var(--bg-white);
    border: 2px solid var(--bg-muted);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-month-year {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary-color);
    color: var(--text-white);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.weekday {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    padding: 0.5rem 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-white);
}

.calendar-day:hover:not(.disabled):not(.other-month) {
    background: var(--primary-light);
    color: var(--text-white);
}

.calendar-day.selected {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-dark);
    font-weight: 600;
}

.calendar-day.today {
    border-color: var(--accent-color);
}

.calendar-day.disabled {
    color: var(--text-light);
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-day.other-month {
    color: var(--text-light);
    opacity: 0.3;
}

/* ========================================
   ШАГ 3: ВРЕМЕННЫЕ СЛОТЫ
   ======================================== */
.selected-date-summary {
    background: var(--secondary-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.loading-indicator {
    text-align: center;
    padding: 2rem;
}

.loading-indicator.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid var(--bg-muted);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    }
}

.time-slot {
    padding: 0.875rem 0.5rem;
    border: 2px solid var(--bg-muted);
    background: var(--bg-white);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-slot.available:hover {
    border-color: var(--primary-light);
    background: var(--primary-light);
    color: var(--text-white);
}

.time-slot.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--text-white);
}

.time-slot.busy {
    background: var(--bg-muted);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.5;
}

.time-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.available {
    background: var(--primary-color);
}

.legend-dot.busy {
    background: var(--bg-muted);
}

/* ========================================
   ШАГ 4: ФОРМА С ДАННЫМИ
   ======================================== */
.booking-summary {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.details-form {
    max-width: 600px;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-muted);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    font-family: var(--font-family);
    font-size: 1rem;
    border: 2px solid var(--bg-muted);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.375rem;
}

.form-group input:invalid {
    border-color: var(--error-color);
}

/* ========================================
   ШАГ 5: ПОДТВЕРЖДЕНИЕ
   ======================================== */
.final-summary {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.consent-checkbox {
    margin-bottom: 1rem;
}

.consent-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-dark);
    cursor: pointer;
}

.consent-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0.125rem;
    cursor: pointer;
}

/* ========================================
   УСПЕШНАЯ ЗАПИСЬ
   ======================================== */
.success-message {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-message h3 {
    font-size: 1.75rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.success-message p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.success-details {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    text-align: left;
}

/* ========================================
   НАВИГАЦИЯ
   ======================================== */
.booking-navigation {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--bg-muted);
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    font-family: var(--font-family);
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-muted);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--text-light);
    color: var(--text-white);
}

.btn-primary.hidden,
.btn-secondary.hidden {
    display: none;
}

/* ========================================
   КНОПКА ОТКРЫТИЯ ВИДЖЕТА (опционально)
   ======================================== */
.open-booking-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    font-family: var(--font-family);
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 1000;
}

.open-booking-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(63, 169, 162, 0.3);
}

/* ========================================
   ГЛОБАЛЬНЫЙ ИНДИКАТОР ЗАГРУЗКИ
   ======================================== */
.global-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    z-index: 100;
}

.global-loading.hidden {
    display: none;
}

.spinner-large {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border: 6px solid var(--bg-muted);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */
@media (max-width: 640px) {
    .booking-navigation {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .open-booking-btn {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: calc(100% - 2rem);
        text-align: center;
    }
}

/* ========================================
   ГРУЗИНСКИЙ ЯЗЫК - уменьшенные размеры
   ======================================== */
.booking-widget.lang-ka {
    font-size: 0.85em;
}

.booking-widget.lang-ka .booking-header h2 {
    font-size: 1.5rem;
}

.booking-widget.lang-ka .booking-subtitle {
    font-size: 0.85rem;
}

.booking-widget.lang-ka .step-title {
    font-size: 1.15rem;
}

.booking-widget.lang-ka .step-text {
    font-size: 0.9rem;
}

.booking-widget.lang-ka .service-name {
    font-size: 0.9rem;
    line-height: 1.2;
}

.booking-widget.lang-ka .service-description {
    font-size: 0.75rem;
}

.booking-widget.lang-ka .service-price {
    font-size: 1.1rem;
}

.booking-widget.lang-ka .service-duration {
    font-size: 0.75rem;
}

.booking-widget.lang-ka .btn-primary,
.booking-widget.lang-ka .btn-secondary {
    font-size: 0.85rem;
    padding: 0.65rem 1.2rem;
}

.booking-widget.lang-ka label {
    font-size: 0.85rem;
}

.booking-widget.lang-ka .form-hint {
    font-size: 0.7rem;
}

.booking-widget.lang-ka .consent-checkbox label {
    font-size: 0.8rem;
    line-height: 1.4;
}

.booking-widget.lang-ka .success-message h3 {
    font-size: 1.3rem;
}

.booking-widget.lang-ka .success-message p {
    font-size: 0.85rem;
}