:root {
    --primary-color: #2e7d32;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}
.header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    font-size: 18px;
    font-weight: bold;
}
.back-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 14px;
    margin-right: 15px;
}
.container {
    padding: 15px;
    padding-bottom: 80px;
}

/* Сетка для карточек на главной */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Адаптация для десктопа (мониторов) */
@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Блок категории */
.category-block {
    margin-bottom: 25px;
}
.category-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Карточка */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 15px;
}
.card-full {
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* Адаптация для десктопа */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 30px;
    }
}
.card-img {
    height: 120px;
    background-size: cover;
    background-position: center;
    width: 100%;
    aspect-ratio: 16/9;
}

/* Адаптация для десктопа */
@media (min-width: 768px) {
    .card-img {
        height: 180px;
        aspect-ratio: 4/3;
    }
}
.card-img-small {
    width: 100px;
    height: 80px;
    flex-shrink: 0;
}

/* Адаптация для десктопа */
@media (min-width: 768px) {
    .card-img-small {
        width: 140px;
        height: 105px;
    }
}
.card-content {
    padding: 10px;
}
.card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}
.card-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}
.card-price {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 13px;
}

/* Адаптация для десктопа */
@media (min-width: 768px) {
    .card-title {
        font-size: 16px;
    }
    .card-desc {
        font-size: 14px;
    }
    .card-price {
        font-size: 15px;
    }
    .card-content {
        padding: 15px;
    }
}

/* Страница домика */
.page-title {
    font-size: 20px;
    font-weight: bold;
    margin: 15px 0;
}
.gallery {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin-bottom: 20px;
    scroll-snap-type: x mandatory;
}
.gallery img {
    height: 200px;
    border-radius: 10px;
    scroll-snap-align: start;
}
.video-block {
    margin-bottom: 20px;
    background: #000;
    height: 200px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.calendar-placeholder {
    background: #fff;
    border: 2px dashed #ccc;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    padding: 10px;
}

/* Нижнее меню */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}
.nav-item {
    text-align: center;
    font-size: 10px;
    color: #888;
    text-decoration: none;
}
.nav-item.active { color: var(--primary-color); }
.nav-item span { font-size: 20px; display: block; margin-bottom: 2px; }

/* --- Стили календаря --- */
.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 10px 10px 0 0;
    font-weight: bold;
}
.cal-header button {
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #ddd;
    border: 1px solid #ddd;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}
.cal-day-name {
    background: #f9f9f9;
    text-align: center;
    font-size: 11px;
    padding: 5px;
    color: #666;
}
.cal-day {
    background: white;
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    cursor: default;
}
.cal-day.empty { background: transparent; }
.cal-day.past { color: #ccc; }
.cal-day.booked { background: #ffcccc; color: #d00; font-weight: bold; }
.cal-day.reserved { background: #fff3cd; color: #856404; }
.cal-day.free { cursor: pointer; }
.cal-day.free:hover { background: #e8f5e9; }
.cal-day.selected { background: #4CAF50; color: white; border-radius: 50%; }
.cal-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    font-size: 11px;
}
.cal-legend span::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    border-radius: 2px;
}
.leg-free::before { background: white; border: 1px solid #ccc; }
.leg-booked::before { background: #ffcccc; border: 1px solid #d00; }

/* --- ИСПРАВЛЕННЫЕ СТИЛИ КАЛЕНДАРЯ --- */
.cal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 10px 10px 0 0;
    font-weight: bold;
    margin-bottom: 5px;
}
.cal-header button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
}
.cal-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 2px;
    background: #eee;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}
.cal-day-name {
    background: #fff;
    text-align: center;
    font-size: 11px;
    padding: 8px 0;
    color: #888;
    font-weight: bold;
}
.cal-day {
    background: white;
    text-align: center;
    padding: 0; 
    font-size: 13px;
    aspect-ratio: 1; /* Делает ячейки квадратными */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f0f0f0;
    cursor: default;
}
.cal-day.empty { background: transparent; border: none; }
.cal-day.past { color: #ccc; background: #fafafa; }
.cal-day.booked { background: #ffcdd2 !important; color: #d32f2f !important; font-weight: bold; border-color: #ef9a9a; }
.cal-day.reserved { background: #ffe0b2 !important; color: #ef6c00 !important; border-color: #ffcc80; }
.cal-day.free { 
    cursor: pointer; 
    background: #e8f5e9; 
    color: #2e7d32;
    border-color: #c8e6c9;
}
.cal-day.free:hover { background: #c8e6c9; }

.cal-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    font-size: 12px;
}
.cal-legend span::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 5px;
    border-radius: 2px;
    vertical-align: middle;
}
.leg-free::before { background: #e8f5e9; border: 1px solid #c8e6c9; }
.leg-booked::before { background: #ffcdd2; border: 1px solid #ef9a9a; }

/* Стили для статуса "На рассмотрении" */
.cal-day.reserved {
    background: #fff3cd !important; /* Желтый фон */
    color: #856404 !important;      /* Темно-коричневый текст */
    border-color: #ffeeba !important;
    position: relative;
}
.cal-day.reserved::after {
    content: '?';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    color: #856404;
}

/* Обновленная легенда */
.cal-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    font-size: 12px;
}
.leg-reserved::before { background: #fff3cd; border: 1px solid #ffeeba; }

/* === ДОПОЛНЕНИЯ: Цвета календаря и ошибки === */

/* Яркие цвета статусов */
.cal-day.free { background: #81c784; color: white; border: 1px solid #66bb6a; }
.cal-day.reserved { background: #ffb74d; color: #e65100; border: 1px solid #ffa726; }
.cal-day.booked { background: #e57373; color: white; border: 1px solid #ef5350; cursor: not-allowed; }

/* Выходные дни (красный цвет даты) */
.cal-day.weekend { color: #d32f2f; font-weight: bold; }
.cal-day.free.weekend { color: white; } /* Белый текст на зеленом фоне */

/* Выделение диапазона */
.cal-day.in-range { background: #e1bee7 !important; color: #4a148c !important; border: 1px solid #ba68c8; }
.cal-day.start-range, .cal-day.end-range { background: #9c27b0 !important; color: white !important; border-radius: 50%; }

/* Легенда */
.cal-legend span::before { content: ''; width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.leg-free::before { background: #81c784; }
.leg-reserved::before { background: #ffb74d; }
.leg-booked::before { background: #e57373; }

/* Ошибки ввода в форме */
.modal-content input.input-error { 
    border: 2px solid #f44336; 
    background-color: #ffebee; 
}
.error-msg { 
    color: #d32f2f; 
    font-size: 12px; 
    margin-top: -5px; 
    margin-bottom: 10px; 
    display: none; 
}

/* === Стили для панели бронирования (Добавлено) === */
.cal-info {
    margin-top: 15px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    clear: both;
}

.btn-book-action {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    margin-top: 5px;
    transition: background 0.3s;
    text-decoration: none;
}
.btn-book-action:hover {
    background: #9c27b0;
    opacity: 0.9;
}

/* === Стили для ошибок ввода === */
.modal-content input.input-error { 
    border: 2px solid #f44336 !important; 
    background-color: #ffebee; 
}
.error-msg { 
    color: #d32f2f; 
    font-size: 12px; 
    margin-top: -5px; 
    margin-bottom: 10px; 
    display: none; 
}

/* === Стили Модального Окна (исправление отображения) === */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    z-index: 1500 !important;
    display: none; /* По умолчанию скрыто */
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    z-index: 1501;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.modal-content h3 { margin-top: 0; color: var(--primary-color); }
.modal-content input {
    width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; font-size: 16px;
}
.btn-modal-send {
    width: 100%; background: var(--primary-color); color: white; padding: 12px; border: none; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer;
}
.error-msg { color: #d32f2f; font-size: 12px; margin-top: -5px; margin-bottom: 10px; display: none; }
.modal-content input.input-error { border: 2px solid #f44336 !important; background-color: #ffebee; }
