/* ---------- Подключение локальных шрифтов ---------- */

@font-face {
    font-family: 'Futura Medium';
    src: url('fonts/futuramediumc.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Angst Medium';
    src: url('fonts/ANGSM___.TTF') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


/* ---------- Шрифт для цен (KONSTRUKT) ---------- */

@font-face {
    font-family: 'KONSTRUKT';
    src: url('fonts/KONSTRUKT-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


/* ---------- Переменные ---------- */

:root {
    --chakra-fontWeights-bold: 700;
}


/* ---------- Прелоадер ---------- */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 153, 127, 0.1);
    border-top: 4px solid #00997F;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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


/* ---------- Общие сбросы ---------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background-color: #0a0a0a;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    /* убрали все отступы */
    position: relative;
    font-family: 'Angst Medium', 'Playfair Display', Georgia, serif;
}


/* ---------- Фоновое изображение ---------- */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('images/background.jpg') center / cover no-repeat fixed;
    image-rendering: auto;
    filter: brightness(0.8) saturate(0.9) contrast(1.05);
    z-index: -1;
}


/* Боковая полоса */

.side-bar {
    position: fixed;
    left: 0;
    top: 0;
    width: 12px;
    height: 100vh;
    background: #00997F;
    box-shadow: 2px 0 12px rgba(0, 153, 127, 0.3);
    z-index: 10;
}


/* ---------- Шапка (на всю ширину, sticky) ---------- */

header {
    width: 100%;
    position: sticky;
    top: 0;
    /* прижат к верху */
    z-index: 100;
    background: transparent;
    transition: background 0.3s ease;
    border-bottom: 2px solid rgba(0, 153, 127, 0.4);
    padding: 20px 20px;
}

header.scrolled {
    background: rgba(10, 10, 10, 0.65);
}


/* Внутренний контейнер */

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    overflow: hidden;
    /* чтобы ничего не вылезало */
}

.logo-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.logo {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}


/* ---------- Навигация (категории) ---------- */

.category-nav {
    flex: 0 0 auto;
    max-width: 100%;
}

.category-nav ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-nav-link {
    color: #ffffff;
    text-decoration: none;
    position: relative;
    padding-bottom: 8px;
    cursor: pointer;
    transition: color 0.3s;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    /* чтобы не переносились внутри ссылки */
}

.category-nav-link:hover {
    color: #00997F;
}

.category-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 61 9' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M3 3.81361C9.7623 3.03481 20.4656 2.8665 29.1919 3.09227C38.7466 3.33947 48.5328 4.51229 58 6' stroke='%2300997F' stroke-width='6' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center/contain no-repeat;
}


/* ---------- Основной контейнер для контента ---------- */

.app {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px 20px 40px;
    position: relative;
    z-index: 1;
}


/* ---------- Заголовок раздела ---------- */

.menu-header {
    text-align: center;
    padding: 10px 0 0;
    margin-bottom: 40px;
}

.section-title {
    font-family: 'Futura Medium', sans-serif;
    font-size: 6rem;
    font-weight: 400;
    color: #B8FBD8;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    letter-spacing: 2px;
    margin: 0;
}


/* ---------- Разделитель после "МЕНЮ" ---------- */

.menu-header::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(to right, transparent, #00997F, transparent);
    opacity: 0.5;
    margin: 30px auto 0;
    width: 100%;
}


/* ---------- Список категорий ---------- */

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.category-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #00997F, transparent);
    opacity: 0.5;
    margin: 0 0 10px;
}

.category {
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    border-left: none;
    border-radius: 0;
    box-shadow: none;
}


/* ---------- Сетка блюд (адаптивная) ---------- */

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}


/* Карточка-заголовок категории – с переносом названия */

.item-card-header {
    display: block;
    padding: 0 0 10px 0;
    width: 100%;
    transition: transform 0.25s;
}

.item-card-header:hover {
    transform: translateY(-4px);
}

.item-card-header .category-name {
    font-family: 'Futura Medium', sans-serif;
    font-size: 4.5rem;
    color: #B8FBD8;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 2px;
    line-height: 1.1;
    text-align: left;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
}


/* Обычные карточки блюд */

.item-card {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s;
}

.item-card:hover {
    transform: translateY(-6px);
}

.item-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 24px;
    background: #2a2a2a;
}

.item-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 16px;
    border-radius: 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 2;
}


/* ---------- ЦЕНЫ (шрифт KONSTRUKT) ---------- */

.item-price-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-family: 'KONSTRUKT', sans-serif;
    font-weight: 400;
    font-size: 3.8rem;
    line-height: 1.1;
    color: #ffffff;
    z-index: 2;
}

.item-body {
    padding: 12px 4px 4px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-name {
    font-family: 'Angst Medium', 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    line-height: 1.3;
}

.item-desc {
    font-family: 'Angst Medium', 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #bbbbbb;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-constructor {
    margin-top: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #00997F;
    border-radius: 30px;
    color: #00997F;
    font-family: 'Angst Medium', 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-start;
    background: rgba(0, 153, 127, 0.08);
}

.btn-constructor:hover {
    background: #00997F;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 153, 127, 0.4);
}

.empty-state {
    text-align: center;
    color: #aaaaaa;
    padding: 30px 0;
    font-size: 1rem;
}


/* ---------- Модалка конструктора (публичная) ---------- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1e1e1e;
    border: 1px solid rgba(0, 153, 127, 0.3);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    padding: 30px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    font-family: 'Futura Medium', sans-serif;
    color: #00997F;
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
}

.constructor-options {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 10px 0 20px;
}

.option-group {
    border: 1px solid rgba(0, 153, 127, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
}

.option-group h4 {
    font-family: 'Angst Medium', 'Playfair Display', Georgia, serif;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.option-group .options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-group .options-list input {
    display: none;
}

.option-group .options-list label {
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-family: 'Angst Medium', 'Playfair Display', Georgia, serif;
    font-size: 0.9rem;
    color: #dddddd;
    transition: all 0.2s;
    user-select: none;
}

.option-group .options-list label:hover {
    background: rgba(0, 153, 127, 0.2);
}

.option-group .options-list input[type="radio"]:checked+label,
.option-group .options-list input[type="checkbox"]:checked+label {
    background: #00997F;
    color: #ffffff;
    border-color: #00997F;
}

.constructor-total {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    text-align: right;
    color: #ffffff;
    padding: 10px 0;
    border-top: 2px dashed rgba(0, 153, 127, 0.3);
    margin-top: 10px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: #00997F;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    background: #007a66;
}

.btn-outline {
    background: transparent;
    border: 2px solid #00997F;
    color: #00997F;
}

.btn-outline:hover {
    background: #00997F;
    color: #fff;
}


/* ---------- Адаптивность ---------- */

@media (max-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 900px) {
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .app {
        padding-left: 20px;
    }
    .side-bar {
        width: 8px;
    }
    .category-nav ul {
        gap: 20px;
    }
    .category-nav-link {
        font-size: 0.8rem;
    }
    .logo {
        height: 100px;
    }
    .item-card-header .category-name {
        font-size: 3.5rem;
    }
    .item-price-overlay {
        font-size: 2.5rem;
    }
    header {
        padding: 15px 15px;
    }
}

@media (max-width: 600px) {
    .items-grid {
        grid-template-columns: 1fr 1fr;
        /* 2 колонки */
        gap: 16px;
    }
    .item-card-header .category-name {
        font-size: 2.4rem;
    }
    .item-card-header {
        padding-bottom: 6px;
    }
    .logo {
        height: 80px;
    }
    .category-nav ul {
        gap: 12px;
        justify-content: center;
    }
    .category-nav-link {
        font-size: 0.7rem;
        white-space: normal;
        /* разрешаем перенос на мобилках */
    }
    .section-title {
        font-size: 2.8rem;
    }
    .item-price-overlay {
        font-size: 2rem;
    }
    .app {
        padding-left: 10px;
        padding-right: 10px;
    }
    .side-bar {
        width: 5px;
    }
    .menu-header {
        padding: 6px 0 0;
        margin-bottom: 30px;
    }
    .menu-header::after {
        margin-top: 20px;
    }
    header {
        padding: 10px 10px;
    }
    .header-inner {
        gap: 10px;
        justify-content: center;
        /* чтобы лого и категории не разбегались */
    }
}

@media (max-width: 480px) {
    .items-grid {
        grid-template-columns: 1fr 1fr;
        /* 2 колонки, даже на очень узких */
    }
}

@media (max-width: 400px) {
    .items-grid {
        grid-template-columns: 1fr;
        /* 1 колонка только для очень маленьких экранов */
    }
    .category-nav ul {
        gap: 8px;
    }
    .category-nav-link {
        font-size: 0.65rem;
    }
}


/* ---------- Для больших экранов (1920+) ---------- */

@media (min-width: 1920px) {
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    .item-card-header .category-name {
        font-size: 5.5rem;
    }
    .item-price-overlay {
        font-size: 3.8rem;
    }
}