/**
* Стили публичной части плагина Calendar
* Версия: 4.2 (Динамическая цена по количеству человек)
*/
/* ===== ГЛОБАЛЬНЫЕ СТИЛИ ===== */
* { box-sizing: border-box; }
.calendar-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px;
    font-family: 'Arial', sans-serif;
    background-color: #f9f9f9;
}
/* Контейнер одной даты */
.calendar-date-block {
    margin-bottom: 15px;
    background: transparent;
    width: 100%;
    transition: all 0.3s ease;
}
/* ===== DATE HEADER (Соединенная конструкция) ===== */
.date-header-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 60px;
    position: relative;
}
/* Date Header 1: Дата (Серый #DBDBDB) */
.date-header-1 {
    background-color: #DBDBDB;
    color: #333;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    font-weight: bold;
    border: 2px solid #B0B0B0;
    border-radius: 10px 0 0 10px;
    position: relative;
    z-index: 2;
    margin-right: -2px;
    min-width: 140px;
    width: 140px;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    transition: background 0.2s;
}
.date-header-1:hover {
    background-color: #cfcfcf;
}
.date-text {
    font-size: 18px;
    line-height: 1.2;
    text-transform: capitalize;
}
.date-day {
    font-size: 12px;
    font-weight: normal;
    color: #555;
}
/* Date Header 2: Заголовок (Бежевый #CFB492) */
.date-header-2 {
    background-color: #CFB492;
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: bold;
    border: 2px solid #B09470;
    border-left: none;
    border-radius: 0 10px 10px 0;
    flex: 1;
    z-index: 1;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    transition: background 0.2s;
}
.date-header-2:hover {
    background-color: #bfa381;
}
/* Иконка аккордеона */
.toggle-icon {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 14px;
}
.calendar-date-block.active .toggle-icon {
    transform: rotate(180deg);
}
/* Контент аккордеона (Скрыт по умолчанию) */
.accordion-content {
    display: none;
    padding: 15px 0;
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-top: -2px;
}
/* Активный аккордеон */
.calendar-date-block.active .accordion-content {
    display: block;
}
/* ===== EVENT BLOCK ===== */
.event-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
/* Event Title */
.event-name-cell {
    background-color: #D2B48C;
    color: #333;
    font-weight: bold;
    padding: 15px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 160px;
    min-width: 160px;
    flex-shrink: 0;
    font-size: 14px;
    word-break: break-word;
    line-height: 1.3;
    cursor: default;
}
/* Контейнер сессий */
.sessions-cell {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    min-width: 0;
}
/* Session Card */
.session-card {
    background-color: #E8D5B5;
    border-radius: 6px;
    padding: 8px 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-width: 90px;
    flex: 1 1 0%;
    min-height: 80px;
    border: 1px solid #CFB492;
    transition: transform 0.2s;
}
.session-card:hover {
    transform: translateY(-2px);
}
.session-card.card-booked {
    background-color: #808080;
    border-color: #666;
    color: #fff;
    cursor: not-allowed;
}
/* Текст внутри карточки */
.card-status { font-size: 9px; text-transform: uppercase; font-weight: bold; opacity: 0.8; margin-bottom: 4px; line-height: 1.1; }
.card-time { font-size: 11px; font-weight: bold; margin-bottom: 6px; }
.card-price {
    border: none; padding: 4px 8px; border-radius: 4px; font-weight: bold; cursor: pointer;
    font-size: 12px; width: 100%; display: flex; align-items: center; justify-content: center;
    background: #fff; color: #333;
}
.price-available:hover { background: #DBDBDB; }

/* ===== POP-UP ФОРМА ===== */
.calendar-popup-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 9999; justify-content: center; align-items: center;
    padding: 15px; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.calendar-popup-overlay.active { opacity: 1; visibility: visible; display: flex !important; }
.calendar-popup {
    background: #fff; padding: 25px; border-radius: 12px; width: 100%; max-width: 500px;
    position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.3); transform: scale(0.9); transition: transform 0.3s;
}
.calendar-popup-overlay.active .calendar-popup { transform: scale(1); }

/* КНОПКА ЗАКРЫТИЯ */
.calendar-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #C2A684;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 0;
    line-height: 1;
    transition: background 0.2s;
    z-index: 10;
}
.calendar-popup-close:hover {
    background: #b0926e;
}

.popup-title { margin: 0 0 20px 0; font-size: 20px; color: #333; text-align: center; }
.calendar-booking-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 0; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; color: #555; }
.form-group input {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
    background: #f9f9f9; transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: #CFB492; background: #fff; }

/* НОВОЕ: доплата за людей */
.form-people-extra-price {
    display: none;
    margin-top: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #d63638;
    line-height: 1.3;
}

.calendar-book-button {
    background: linear-gradient(135deg, #C2A684 0%, #b0926e 100%);
    color: #fff; border: none; padding: 14px; border-radius: 8px; font-weight: bold;
    font-size: 16px; cursor: pointer; width: 100%; margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: transform 0.2s;
}
.calendar-book-button:hover { transform: translateY(-1px); }
.calendar-book-button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.calendar-booking-message {
    margin-top: 15px; padding: 10px; border-radius: 6px; text-align: center; font-size: 14px; display: none;
}
.calendar-booking-message.success { display: block; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.calendar-booking-message.error { display: block; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ===== АДАПТАЦИЯ ===== */
@media (max-width: 1024px) {
    .date-header-1 { width: 120px; min-width: 120px; padding: 0 10px; }
    .date-text { font-size: 16px; }
    .event-name-cell { width: 140px; min-width: 140px; font-size: 13px; padding: 10px; }
    .session-card { min-width: 80px; }
}

@media (max-width: 768px) {
    .date-header-1 {
        width: 110px; min-width: 110px; border-radius: 10px 0 0 10px;
    }
    .date-header-2 { border-radius: 0 10px 10px 0; }
    .event-row {
        flex-direction: column; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid #CFB492; margin-bottom: 10px;
    }
    .event-name-cell {
        width: 100%; min-width: auto; border-radius: 0; cursor: pointer; padding: 12px 15px; position: relative;
    }
    .event-name-cell::after {
        content: '▼'; font-size: 12px; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); transition: transform 0.3s;
    }
    .event-row.active .event-name-cell::after { transform: translateY(-50%) rotate(180deg); }
    .sessions-cell {
        display: none; flex-direction: column; padding: 10px; background: #fafafa; border-top: 1px solid #eee;
    }
    .event-row.active .sessions-cell { display: flex; }
    .session-card {
        width: 100%; min-width: auto; flex: 1 1 auto; display: grid !important; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 5px; margin-bottom: 5px;
    }
    .card-status { grid-column: 1 / -1; font-size: 10px; }
    .card-time { grid-column: 1; font-size: 12px; }
    .card-price { grid-column: 2; font-size: 11px; background: #CFB492; color: #fff; }

    .form-row {
        grid-template-columns: 1fr;
    }
}