:root {
    --black: #1a1a1a;
    --gray-bg: #f4f4f6;
    --accent: #ebf1ff;
    --text-muted: #999;
}

body { font-family: -apple-system, sans-serif; background: #f8f8f8; margin: 0; }

/* Панель ввода */
.booking-bar {
    display: flex; align-items: center; background: #fff; 
    border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    max-width: 800px; margin: 0 auto; padding: 12px 24px;
}
.input-div { display: flex; flex: 1; cursor: pointer; align-items: center; justify-content: center; flex-direction: column; }
.input-div.no-click { cursor: default; }
.input-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.input-value { font-size: 15px; font-weight: 500; }
.divider { width: 1px; height: 30px; background: #eee; margin: 0 20px; }

/* Счетчик гостей */
.guest-counter { display: flex; align-items: center; gap: 15px; }
.guest-counter button { 
    width: 28px; height: 28px; border: 1px solid #ddd; background: #fff; 
    border-radius: 50%; cursor: pointer; font-size: 16px; 
}
#guest-num { font-weight: 600; min-width: 15px; text-align: center; }

/* Модалка */
.overlay { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.25); z-index: 2; align-items: center; justify-content: center; 
}
.calendar-card { 
    background: #fff; border-radius: 24px; padding: 32px; position: relative;
    max-width: 760px; width: 90%; box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Навигация */
.nav-arrows { position: absolute; top: 35px; width: calc(100% - 64px); display: flex; justify-content: space-between; pointer-events: none; }
.nav-arrows button { pointer-events: auto; background: none; border: none; font-size: 20px; cursor: pointer; padding: 0 10px; }

.months-wrapper { display: flex; flex-wrap: wrap; gap: 40px; justify-content: center; }
.month-block { width: 300px; }
.month-title { text-align: center; font-weight: 600; margin-bottom: 20px; }

/* Сетка дат */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.weekday { font-size: 12px; color: var(--text-muted); padding-bottom: 12px; }
.cell { height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; border-radius: 50%; }
.cell.disabled { color: #eee; cursor: not-allowed; }
.cell.selected { background: var(--black) !important; color: #fff; z-index: 2; }
.cell.in-range { background: var(--accent); border-radius: 0; }
.cell:hover:not(.empty):not(.disabled) { background: var(--gray-bg); }

/* Футер */
.calendar-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.presets button { background: var(--gray-bg); border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; margin-right: 8px; }
.btn-primary { background: var(--black); color: #fff; border: none; padding: 12px 24px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.btn-text { background: none; border: none; text-decoration: underline; color: #666; cursor: pointer; font-size: 14px; margin-right: 15px; }

/* Стилизация поля телефона */
.phone-input {
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 500;
    /* width: 100%; */
    background: transparent;
    font-family: inherit;
    text-align: center;
}

.phone-input::placeholder { color: #ccc; }

/* Большая черная кнопка "Забронировать" */
.btn-main-action {
    background: var(--black);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    margin-left: 10px;
}

.btn-main-action:hover { opacity: 0.9; }
.btn-main-action:active { transform: scale(0.97); }

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    /* Заменяем системный фон на внутреннюю тень (белую или любую другую) */
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
    /* Устанавливаем цвет текста, если браузер его меняет */
    -webkit-text-fill-color: #1a1a1a !important;
    /* Плавный переход, чтобы не "моргало" */
    transition: background-color 5000s ease-in-out 0s;
}

/* Адаптивность для мобилок */
@media (max-width: 850px) {
    .booking-bar { flex-direction: column; align-items: stretch; gap: 15px; }
    .divider { display: none; }
    .btn-main-action { margin-left: 0; width: 100%; }
    .months-wrapper {gap: 0;}
    .calendar-card {padding: 8px;}
    .calendar-footer {margin-top: 0; padding: 0;}
    .main-view {max-height: 450px;}
    .month-title {margin-bottom: 0px;}
}

.booking-bar .input-label {
    text-align: center;
    white-space: nowrap;
}

.booking-bar .input-div {
    height: 44px;
    justify-content: space-around;
}

.booking-menu {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: #f8f8f8;
    border-radius: 6px;
    margin: auto;
    width: fit-content;
    height: 36px;
}

.booking-menu::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    /* Сама тень */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.booking-bar,
.booking-places,
.booking-reviews,
.booking-route {
    scroll-margin-top: 40px; 
}

.booking-menu > div {
    padding: 0px;
    margin: 6px;
    cursor: pointer;
    user-select: none;
}

.booking-menu-order,
.booking-menu-places,
.booking-menu-route,
.booking-menu-reviews {
    border-bottom: #000 dashed 1px;
}

.booking-menu-title {
    font-weight: 600;
}

.booking-address {
    text-align: center;
    padding: 3px;
    cursor: pointer;
    font-style: italic;
}

.booking-address span {
    border-bottom: #000 dashed 1px;
}

.booking-reviews {
    margin-top: 20px;
    padding: 6px;
    display: flex;
    text-align: center;
    align-items: center;
    flex-direction: column;
}

.booking-reviews > div {
    /* cursor: pointer; */
}

.booking-route {
    margin-top: 20px;
    padding: 6px;
    display: flex;
    height: 300px;
    align-items: center;
    flex-direction: column;
}

.booking-places {
    margin-top: 20px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.booking-places iframe {
    aspect-ratio: 16 / 9;
    width: 100vw;
    height: auto;
    max-width: 800px;
}

.booking-reviews > span:first-child {
    font-weight: 600;
}
.booking-places > span:first-child {
    font-weight: 600;
}
.booking-route > span:first-child {
    font-weight: 600;
}

.booking-message-shadow {
    position: fixed;
    top: 0;
    background: #55555560;
    display: none;
    z-index: 3;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.booking-message {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0px 0px 0px 1px #aaa;
    display: flex;
    padding: 12px;
    flex-direction: column;
    z-index: 4;
    align-items: center;
    justify-content: center;
}

.booking-message-content {
    padding: 12px;
}

.booking-message button {
    background: var(--black);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

/*Фото*/
.gallery-container {
    display: flex;
    gap: 15px;
    max-width: fit-content;
    margin: auto;
    /* По умолчанию: превью снизу, фото сверху */
    flex-direction: column-reverse; 
}

/* Основное окно просмотра */
.main-view {
    flex: 1; /* Занимает всё свободное место */
    position: relative;
    background: #eee;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3; /* Держим пропорции */
}

.main-view img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Боковая/нижняя панель превью */
.thumbnails-sidebar {
    display: flex;
    gap: 10px;
    overflow: auto;
}

.thumb {
    width: 80px; height: 60px;
    object-fit: cover; border-radius: 6px;
    cursor: pointer; opacity: 0.5; transition: 0.2s;
    flex-shrink: 0; /* Чтобы не сжимались в ряду */
}
.thumb.active { opacity: 1; outline: 2px solid #007bff; }

/* --- АДАПТИВНОСТЬ 800px+ --- */
@media (min-width: 800px) {
    .gallery-container {
        flex-direction: row; /* Превью слева, фото справа */
        height: 500px;
    }
    
    .thumbnails-sidebar {
        flex-direction: column; /* Превьюшки в столбик */
        width: 100px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .thumb { width: 100%; height: auto; aspect-ratio: 4/3; }
}

@media (max-width: 800px) {
    .thumbnails-sidebar {
        display: none;
    }
}


.map-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center;
}
.map-content {
    background: #fff; padding: 10px; border-radius: 15px; width: 90%; max-width: 600px;
}
.map-content iframe { border-radius: 10px; }
.map-content button { background: var(--black);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    margin: 0 calc(50% - 56px);
}


/* Кнопки навигации */
.nav-btn {
    position: absolute; background: rgba(0,0,0,0.5); color: #fff;
    border: none; padding: 15px; cursor: pointer; border-radius: 50%;
    width: 48px;
}
.prev { left: 10px; }
.next { right: 10px; }