/* ===== ШРИФТ ===== */

body {
    font-family: 'Isadora', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Предотвращаем горизонтальную прокрутку */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}



/* ===== ЗАГОЛОВКИ ===== */

.custom-font {
    font-family: 'Isadora', sans-serif;
    font-weight: normal;
}


/* ===== ФОРМА ===== */

.form-box {
    max-width: 520px;
    margin: 24px auto;
    padding: 20px 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.intro-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* строка формы */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-label {
    font-size: 1rem;
    white-space: nowrap;
}


/* ===== SELECT ===== */

.choice-box {
    width: 240px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 1rem;
}


/* ===== TOGGLE Да / Нет ===== */

.toggle-group {
    display: flex;
    gap: 8px;
}

.toggle-group input {
    display: none;
}

.toggle-btn {
    padding: 8px 18px;
    border-radius: 12px;
    border: 1px solid #ccc;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
    background: #f8f8f8;
}

.toggle-group input:checked+.toggle-btn {
    background: #8CB890;
    color: #fff;
    border-color: #8CB890;
}


/* ===== КНОПКА ===== */

.submit-btn {
    align-self: center;
    margin-top: 10px;
    padding: 10px 30px;
    border-radius: 14px;
    border: none;
    background: #8CB890;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.submit-btn:hover {
    background: #7aa67d;
}

/* ===== ТОСТ-УВЕДОМЛЕНИЕ (Шутка) ===== */

.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #8CB890;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-family: 'Isadora', sans-serif;
    font-size: 1.1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 20000;
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.toast-container.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== FORCE ISADORA FOR FORMS ===== */

.form-box * {
    font-family: 'Isadora', sans-serif !important;
}

.label-text {
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
}

/* ===== КНОПКА ПОСТРОЕНИЯ МАРШРУТА ===== */

.route-button-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.route-btn {
    padding: 10px 24px;
    border-radius: 14px;
    border: 2px solid #8CB890;
    background: #8CB890;
    color: #fff;
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.route-btn:hover {
    background: #7aa67d;
    border-color: #7aa67d;
    color: #fff;
}

/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ КАРТЫ ===== */

.map-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.map-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.map-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.map-modal-close {
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.map-modal-close:hover {
    color: #333;
}

.map-modal-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Поле ввода адреса */
.address-input-container {
    margin-bottom: 16px;
}

.address-label {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #333;
    font-weight: normal;
}

.address-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.address-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    outline: none;
}

.address-input:focus {
    border-color: #8CB890;
}

.address-input::placeholder {
    color: #999;
}

.search-address-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: #8CB890;
    color: #fff;
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.search-address-btn:hover:not(:disabled) {
    background: #7aa67d;
}

.search-address-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.yandex-map {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.map-instructions {
    text-align: center;
    padding: 12px;
    background-color: #f8f8f8;
    border-radius: 8px;
}

.map-instructions p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ АЛЛЕРГИИ ===== */

.allergy-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.allergy-modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

.allergy-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.allergy-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    text-align: center;
}

.allergy-modal-body {
    padding: 24px 24px 24px 24px;
}

.allergy-input-container {
    margin-bottom: 0;
}

.allergy-label {
    display: block;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #333;
    font-weight: normal;
}

.allergens-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.allergens-textarea:focus {
    border-color: #8CB890;
}

.allergens-textarea::placeholder {
    color: #999;
}

.allergy-buttons {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 24px;
}

.allergy-cancel-btn,
.allergy-submit-btn {
    flex: 1;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #8CB890;
    background: #8CB890;
    color: #fff;
}

.allergy-cancel-btn:hover,
.allergy-submit-btn:hover {
    background: #7aa67d;
    border-color: #7aa67d;
}

/* ===== КНОПКА ВЫБОРА НАПИТКОВ ===== */

.drinks-select-btn {
    position: relative;
    z-index: 100;
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid #8CB890;
    background: #8CB890;
    color: #fff;
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.drinks-select-btn:hover {
    background: #7aa67d;
    border-color: #7aa67d;
}

/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ НАПИТКОВ ===== */

.drinks-modal {
    display: none;
    position: fixed;
    z-index: 10002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.drinks-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

.drinks-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.drinks-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.drinks-modal-close {
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.drinks-modal-close:hover {
    color: #333;
}

.drinks-modal-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    /* Предотвращаем горизонтальный скролл */
}

.drinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

/* Адаптивная сетка напитков: больше колонок на широких экранах */
@media (min-width: 600px) {
    .drinks-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 18px;
    }
}

@media (min-width: 800px) {
    .drinks-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 20px;
    }
}

.drink-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
    min-width: 0;
    /* Позволяет гриду сжимать элементы */
}

.drink-box:hover {
    border-color: #8CB890;
    transform: translateY(-4px);
    /* Увеличиваем подъём для лучшего эффекта */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    z-index: 10;
    /* Поднимаем элемент выше при hover */
}

.drink-box.selected {
    border-color: #8CB890;
    background: #f0f7f1;
    box-shadow: 0 4px 12px rgba(140, 184, 144, 0.3);
}

.drink-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
    z-index: 1;
}

.drink-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    /* Квадратная область по умолчанию */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f8f8;
    pointer-events: none;
}

.drink-image-container.no-image {
    background: linear-gradient(135deg, #f8f8f8 0%, #e0e0e0 100%);
}

.drink-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    /* Показываем изображение целиком, без обрезки */
    transition: transform 0.3s ease;
    pointer-events: none;
}

.drink-box:hover .drink-image {
    transform: translate(-50%, -50%) scale(1.05);
}

.drink-checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #8CB890;
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.drink-box.selected .drink-checkmark {
    display: flex;
}

.drink-label {
    margin: 0;
    padding: 10px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    text-align: center;
    width: 100%;
    user-select: none;
    font-weight: normal;
    transition: color 0.3s ease;
    pointer-events: none;
    /* Позволяет кликам проходить через label к родителю */
}

.drink-box.selected .drink-label {
    color: #8CB890;
    font-weight: bold;
}

.drinks-buttons {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.drinks-cancel-btn,
.drinks-submit-btn {
    flex: 1;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #8CB890;
    background: #8CB890;
    color: #fff;
}

.drinks-cancel-btn:hover,
.drinks-submit-btn:hover {
    background: #7aa67d;
    border-color: #7aa67d;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {

    /* Форма */
    .form-box {
        max-width: 100%;
        margin: 16px auto;
        padding: 16px 20px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .form-label {
        width: 100%;
    }

    .choice-box {
        width: 100%;
    }

    .toggle-group {
        width: 100%;
        justify-content: space-between;
    }

    .toggle-btn {
        flex: 1;
        text-align: center;
    }

    .submit-btn {
        width: 100%;
        padding: 12px 24px;
    }

    .route-btn {
        width: 100%;
        padding: 12px 24px;
    }

    /* Заголовки */
    .custom-font {
        font-size: 1.5rem;
    }

    h1.custom-font {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    /* Контент */
    .content-inner {
        padding: 16px;
    }

    /* Модальное окно карты */
    .map-modal-content {
        width: 100%;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }

    .yandex-map {
        height: 350px;
    }

    .map-modal-header {
        padding: 16px;
    }

    .map-modal-header h2 {
        font-size: 1.2rem;
    }

    .map-modal-body {
        padding: 16px;
    }

    .address-input-wrapper {
        flex-direction: column;
    }

    .search-address-btn {
        width: 100%;
    }

    .address-input {
        font-size: 16px;
        /* Предотвращает зум на iOS */
    }

    /* Модальное окно аллергии */
    .allergy-modal-content {
        width: 95%;
        margin: 15% auto;
    }

    .allergy-buttons {
        flex-direction: column;
        margin-bottom: 24px;
    }

    .allergy-cancel-btn,
    .allergy-submit-btn {
        width: 100%;
        margin-bottom: 24px;
    }

    .allergens-textarea {
        font-size: 16px;
        /* Предотвращает зум на iOS */
    }

    /* Модальное окно напитков */
    .drinks-modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 90vh;
    }

    .drinks-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 12px;
        max-height: 300px;
        padding: 4px;
    }

    .drink-label {
        font-size: 0.8rem;
        padding: 8px 4px;
    }

    .drinks-buttons {
        flex-direction: column;
    }

    .drinks-cancel-btn,
    .drinks-submit-btn {
        width: 100%;
    }

    .drinks-select-btn {
        width: 100%;
        margin-top: 8px;
    }

    /* Заголовки секций */
    h1.custom-font[align="center"] {
        font-size: 1.3rem;
        margin: 16px 0;
    }

    p.custom-font[style*="text-align:center"] {
        font-size: 0.95rem;
        margin: 8px 0;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    .form-box {
        padding: 12px 16px;
    }

    .content-inner {
        padding: 12px;
    }

    h1.custom-font {
        font-size: 1.3rem;
    }

    .custom-font {
        font-size: 1.1rem;
    }

    .yandex-map {
        height: 300px;
    }

    .map-modal-header h2 {
        font-size: 1rem;
    }

    .map-modal-close {
        font-size: 28px;
    }

    /* Заголовки секций */
    h1.custom-font[align="center"] {
        font-size: 1.1rem;
        margin: 12px 0;
    }

    p.custom-font[style*="text-align:center"] {
        font-size: 0.85rem;
        margin: 6px 0;
    }

    /* Модальное окно аллергии */
    .allergy-modal-content {
        width: 95%;
        margin: 20% auto;
    }

    .allergy-modal-header h2 {
        font-size: 1.2rem;
    }

    /* Модальное окно напитков */
    .drinks-modal-content {
        width: 95%;
        margin: 15% auto;
    }

    .drinks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 4px;
    }

    .drink-label {
        font-size: 0.75rem;
        padding: 6px 4px;
    }

    .drink-checkmark {
        width: 20px;
        height: 20px;
        font-size: 12px;
        top: 6px;
        right: 6px;
    }

    .drinks-modal-header h2 {
        font-size: 1.2rem;
    }
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    border: 2px solid #8CB890;
    background: #8CB890;
    color: #fff;
    font-family: 'Isadora', sans-serif;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    opacity: 0;
    /* прозрачная по умолчанию */
    pointer-events: none;
    /* не кликабельна */
    transition: all 0.3s ease;
    /* плавный переход */
}

.scroll-top-btn.visible {
    opacity: 1;
    /* становится видимой */
    pointer-events: auto;
    /* кликабельна */
}

.scroll-top-btn:hover {
    background: #7aa67d;
    border-color: #7aa67d;
    transform: translateY(-2px);
}

.intro-card {
    max-width: 720px;
    margin: 40px auto;
    padding: 28px 24px;

    background: rgba(255, 255, 255, 0.88);
    border-radius: 20px;

    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* Чуть воздуха между абзацами внутри */
.intro-card h1,
.intro-card h2 {
    margin-bottom: 20px;
}

/* Мобилка */
@media (max-width: 768px) {
    .intro-card {
        padding: 22px 18px;
        margin: 24px 16px;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(140, 184, 144, 0.3);
    }
}

/* ===== МОДАЛЬНОЕ ОКНО ПОДТВЕРЖДЕНИЯ ===== */

.confirm-modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.confirm-modal-content {
    position: relative;
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-modal-body h2 {
    margin-bottom: 30px;
    font-size: 1.4rem;
    color: #333;
    line-height: 1.4;
}

.confirm-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.confirm-close-btn {
    padding: 12px 28px;
    border-radius: 14px;
    border: 2px solid #8CB890;
    background: #8CB890;
    color: #fff;
    font-family: 'Isadora', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.confirm-close-btn:hover {
    background: #7aa67d;
    border-color: #7aa67d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(140, 184, 144, 0.3);
}

.confirm-btn-2 {
    background: #fff;
    color: #8CB890;
}

.confirm-btn-2:hover {
    background: #f0f7f1;
    color: #7aa67d;
}

@media (max-width: 480px) {
    .confirm-buttons {
        flex-direction: column;
    }

    .confirm-modal-content {
        margin: 30% auto;
        padding: 24px;
    }
}