﻿@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&family=Nunito:wght@600;800;900&display=swap');

body {
    background-image: url('/static/background_blue_before_yellow.png');
    
    /* Растягивает изображение на весь экран, сохраняя пропорции */
    background-size: cover;
    
    /* Центрирует фон по горизонтали и вертикали */
    background-position: center center;
    
    /* Запрещает картинке повторяться (размножаться плиткой) */
    background-repeat: no-repeat;
    
    /* Фиксирует фон на месте, чтобы при скроллинге страницы листался только контент */
    background-attachment: fixed;
    
    /* Запасной цвет фона на случай, если картинка долго грузится */
    background-color: #dff3ff;
    
    /* Обнуляем дефолтные отступы браузера */
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
}

header {
    background-color: #4f94cf; /* Мягкий зеленый цвет из новой палитры */
    color: white;
    padding: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px; /* Настраиваем размер */
    font-weight: 1500; /* Толщина шрифта */
    margin-top: 20px; /* Отступ сверху */
}

.header-logo {
    max-height: 40px;    /* Ограничиваем высоту, чтобы шапка оставалась аккуратной */
    width: auto;         /* Пропорции сохраняются автоматически */
    display: block;
}

.cart-header-button {
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
}

.cart-header-icon {
    width: 25px;
    height: 25px;
    display: block;
    fill: currentColor;
}

.cart-count {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 17px;
    height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 4px;
    border-radius: 999px;
    background: #ffdf63;
    color: #1e5d8a;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

/* Включаем магнитный вертикальный скролл на всю страницу */
html, body {
    height: 100%;
    overflow: hidden; /* Отключаем стандартный глобальный скролл */
}

/* Главный контейнер-слайдер */
.vertical-slider {
    height: calc(100vh - 145px); /* Высота экрана минус высота шапки (~105px) и поиска (~40px) */
    overflow-y: scroll;          /* Разрешаем вертикальный скролл внутри слайдера */
    scroll-snap-type: y mandatory; /* Включаем ЖЕСТКУЮ вертикальную фиксацию */
    scroll-behavior: smooth;     /* Плавный переход */
    -webkit-overflow-scrolling: touch; /* Плавность на iOS (iPhone) */
}

/* Каждый отдельный экран с товаром */
.product-slide {
    width: 100%;
    height: 100%;                /* Растягиваем слайд ровно на высоту контейнера */
    display: flex;
    align-items: center;         /* Центрируем карточку товара по вертикали */
    justify-content: center;     /* Центрируем карточку по горизонтали */
    scroll-snap-align: start;    /* Карточка намертво магнитится к верхнему краю при остановке */
    scroll-snap-stop: always;
}

.empty-results {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    scroll-snap-align: start;
}

.empty-results-box {
    width: min(85vw, 440px);
    padding: 22px 20px;
    border: 2px solid #b7dcf3;
    border-radius: 14px;
    background: rgba(238, 249, 255, 0.94);
    box-shadow: 0 8px 18px rgba(37, 111, 168, 0.22);
    text-align: center;
}

.empty-results-box h2 {
    margin: 0 0 8px;
    color: #333;
    font-size: 1.35rem;
    font-weight: 800;
}

.empty-results-box p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.45;
}



.product-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card {
    height: auto;
    /* На телефоне ~300px, на планшете растягивается до 75% ширины экрана, но не более 600px */
    width: min(75vw, 600px);
    max-width: 600px;
    margin: 0 auto !important;
    display: block;
    background: transparent;
    padding: 5px;
    overflow: hidden;
    text-align: center;
}

/* На маленьких телефонах возвращаем прежний небольшой размер */
@media (max-width: 480px) {
    .product-card {
        width: min(85vw, 300px);
    }
}

/*
 * 2. Само изображение внутри карточки.
 * Мы заставим его занимать всю ширину НОВОЙ, МАЛЕНЬКОЙ карточки.
 */
.product-card img {
    width: 100%; /* Теперь картинка занимает 100% ширины *smaller* контейнера (300px), а не всего экрана. */
    height: 100%; /* Сохраняет стабильную высоту контейнера, чтобы карточка не прыгала при загрузке. */
    display: block; /* Устраняет возможные проблемы с интервалами внизу. */
    border-radius: 20px;
    object-fit: contain; /* Гарантирует, что всё изображение поместится в отведенную область без обрезки. */
}

.product-info {
    font-family: 'Montserrat', sans-serif;
    padding: 15px;
    font-weight: bold;
}

/* Общий контейнер для цен (выстраивает колонки в ряд по центру) */
/* Обновленный контейнер для цен: теперь это белая плашка внутри розовой рамки */
.product-prices {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0 0 0;          /* Отступ только сверху, до названия товара */
    background-color: #ffffff;    /* Белый фон подложки */
    border: 1px solid #b7dcf3;    /* Тонкая мягкая зеленая обводка белой рамки */
    border-radius: 10px;          /* Скругление углов внутренней белой рамки */
    padding: 8px 0;               /* Внутренние отступы сверху и снизу */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02); /* По желанию: едва заметная внутренняя тень */
}

/* Каждая отдельная колонка внутри белой плашки */
.price-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;                      /* Равномерно распределяем место */
    padding: 0 10px;
}

/* Вертикальная серая черта между ценами */
.price-divider {
    width: 1px;
    height: 40px;                 /* Чуть уменьшили высоту, чтобы аккуратно смотрелось в белой рамке */
    background-color: #e0e0e0; 
}

/* Маленькие верхние подписи (1 шт / Упаковка) */
.price-label {
    font-size: 0.5rem;
    text-transform: uppercase; /* Делает буквы заглавными */
    color: #9e9e9e;            /* Мягкий серый цвет */
    font-weight: bold;
    letter-spacing: 0.5px;     /* Слегка растягиваем буквы */
    margin-bottom: 2px;
}

/* Большие синие цифры стоимости */
.price-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;          /* Очень жирный шрифт */
    color: #1e5d8a;            /* Глубокий зеленый акцент */
}


.price {
    color: #1e5d8a;
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0;
}

/* 1. Новая обертка для текста.
 * Мы создаем "вкусный", мягкий пузырь для информации.
 */
.info-bubble {
    border: 2px solid #b7dcf3;       /* Нежная мягкая зеленая обводка. */
    background-color: #eef9ff;     /* Очень мягкий мятный фон. */
    padding: 15px;                /* Увеличили внутренние отступы, чтобы текст не прилипал к краям. */
    border-radius: 12px;           /* Добавляем тонкое скругление углов, чтобы рамка выглядела аккуратно. */
    margin: 0px 0;               /* Отступы снаружи от рамки (сверху и снизу). */
    box-shadow: 0 4px 6px rgba(37, 111, 168, 0.18); /* Легкая зеленая тень для объема. */
}

/*
 * 2. Текст названия внутри рамки.
 */
.info-bubble h3 {
    margin: 0 0 8px 0;            /* Небольшой отступ только снизу. */
    color: #333;                  /* Классический чёрный фон, чтобы продукт было хорошо видно. */
    font-weight: bold;            /* Жирное название. */
}

/*
 * 3. Текст описания внутри рамки.
 */
.info-bubble p {
    margin: 0;                    /* Убираем отступы по умолчанию. */
    color: #64748b;               /* Серый текст описания. */
}

.add-to-cart-button {
    width: 100%;
    min-height: 44px;
    margin-top: 15px;
    border: 1px solid #b7dcf3;
    border-radius: 12px;
    background: #ffffff;
    color: #1e5d8a;
    box-shadow: inset 0 1px 3px rgba(37, 111, 168, 0.05);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
}

.add-to-cart-button.in-cart {
    border-color: #8ed1a1;
    background: #effbf2;
    color: #26756a;
}

.btn-category {
    position: absolute;
    bottom: 10px;   /* Отступ от нижнего края фото */
    right: 10px;    /* Отступ от правого края фото */
    left: auto;
    z-index: 5;
    background-color: #256fa8; /* Глубокий зеленый акцент */
    color: white;
    border: none;
    
    /* 1. Уменьшаем размер плашки */
    padding: 6px 12px;         /* Уменьшили внутренние отступы (сверху/снизу и по бокам) */
    font-size: 0.8rem;         /* Слегка уменьшили размер самого шрифта */
    border-radius: 10px;        /* Аккуратное небольшое скругление */
    font-weight: 600;
    
    /* 2. Магия прижимания к левому краю при общем центрировании */
    display: block;            /* Превращаем в блочный элемент */
    width: fit-content;        /* Ширина теперь строго по размеру текста внутри */    /* Слева отступ 0 (прижали), справа авто (вытолкнули остаток пространства) */
    
    cursor: pointer;
}

/* По умолчанию скрываем меню за пределами экрана */
.menu-overlay {
    position: fixed;
    top: 0;
    right: -100%; /* Сдвинуто вправо */
    width: 100%;
    height: 100%;
    background-color: #4f94cf; /* Мягкий зеленый фон меню */
    color: white;
    transition: 0.3s;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

/* Класс для отображения меню */
.menu-overlay.active {
    right: 0;
}

.cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 45, 68, 0.24);
    backdrop-filter: blur(2px);
}

.cart-panel {
    position: fixed;
    top: 0;
    left: -110%;
    z-index: 10001;
    width: min(420px, 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 16px;
    border-right: 1px solid #b7dcf3;
    background: #eef9ff;
    box-shadow: 10px 0 30px rgba(30, 93, 138, 0.22);
    transition: left 0.3s;
}

.cart-panel.active { left: 0; }

.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: #1e5d8a;
}

.cart-panel-header h2 { margin: 0; font-size: 1.25rem; }

.cart-close {
    border: none;
    background: transparent;
    color: #1e5d8a;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.cart-items {
    display: grid;
    gap: 10px;
    overflow-y: auto;
    padding-right: 2px;
}

.cart-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid #b7dcf3;
    border-radius: 10px;
    background: white;
}

.cart-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
}

.cart-item-title { color: #333; font-size: 0.95rem; font-weight: 800; }
.cart-item-price { margin-top: 5px; color: #1e5d8a; font-size: 0.85rem; font-weight: 800; }

.cart-qty-row { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.cart-qty-row button {
    min-width: 30px;
    min-height: 30px;
    border: 1px solid #b7dcf3;
    border-radius: 8px;
    background: #eef9ff;
    color: #1e5d8a;
    cursor: pointer;
    font-weight: 800;
}
.cart-qty-row input {
    width: 52px;
    min-height: 30px;
    box-sizing: border-box;
    border: 1px solid #b7dcf3;
    border-radius: 8px;
    color: #333;
    background: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    text-align: center;
}
.cart-qty-row .cart-remove { margin-left: auto; padding: 0 9px; color: #b42318; }

.cart-empty {
    margin: auto 0;
    padding: 18px;
    border: 1px dashed #8bc2e4;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    color: #64748b;
    font-weight: 700;
    text-align: center;
}

.cart-total {
    margin-top: auto;
    padding: 14px 4px 10px;
    color: #1e5d8a;
    font-size: 1.05rem;
    font-weight: 900;
    text-align: right;
}

.cart-checkout-button {
    min-height: 46px;
    margin-top: 4px;
    border: none;
    border-radius: 10px;
    background: #4f94cf;
    color: white;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 800;
}

.cart-checkout-button:disabled { opacity: 0.55; cursor: not-allowed; }

.menu-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
}

.menu-links {
    padding: 10px 12px 16px;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

.menu-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.menu-links .menu-tile {
    background: rgba(255,255,255,0.18);
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 8px;
    border-radius: 10px;
    text-align: center;
    line-height: 1.25;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: auto;
}

.menu-links button.menu-tile {
    border: none;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
}

.menu-links a.menu-tile.active-cat {
    background: #ffffff;
    color: #4f94cf;
    border-radius: 10px;
    width: auto;
    font-weight: bold;
}

.preload-menu-tile {
    grid-column: 1 / -1;
    margin-top: 10px;
    background: #eef9ff;
    color: #1e5d8a;
    border: 2px solid #b7dcf3;
    box-shadow: 0 5px 12px rgba(30, 93, 138, 0.18);
}

.preload-menu-tile.loading,
.preload-menu-tile:disabled {
    opacity: 0.78;
    cursor: wait;
}

@media (min-width: 700px) {
    .menu-overlay {
        width: min(420px, 55vw);
        box-shadow: -10px 0 30px rgba(30, 93, 138, 0.18);
    }
}

.burger {
    font-size: 24px;
    cursor: pointer;
}

.fixed-logo {
    position: fixed;
    bottom: 10px; /* Отступ от нижнего края */
    right: 10px;  /* Отступ от правого края */
    width: 70px;  /* Ширина логотипа (подбери под себя) */
    z-index: 9999; /* Чтобы логотип всегда был поверх карточек товаров */
    pointer-events: none; /* Чтобы логотип не мешал нажимать на кнопки под ним */
}

.fixed-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.catalog-scroll-controls {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.catalog-scroll-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(183, 220, 243, 0.75);
    border-radius: 50%;
    background: #b7dcf3;
    color: #dff3ff;
    box-shadow: 0 3px 8px rgba(30, 93, 138, 0.20);
    cursor: pointer;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-scroll-btn:active {
    transform: scale(0.96);
}

/* Контейнер для формы поиска */
.search-container {
    max-width: 300px;
    margin: 20px auto 0 auto; /* Центрируем так же, как карточки товаров */
    padding: 0 10px;
}

/* Сама форма */
.search-form {
    display: flex;
    position: relative;
    align-items: center;
    background-color: #ffffff;
    border: 2px solid #b7dcf3; /* Мягкая зеленая обводка в стиль info-bubble */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(37, 111, 168, 0.18);
}

/* Поле ввода текста */
.search-form input {
    flex: 1;
    border: none;
    padding: 10px 35px 10px 15px; /* Справа делаем отступ больше для крестика сброса */
    font-size: 0.95rem;
    font-family: 'Montserrat', sans-serif;
    outline: none; /* Убираем синюю обводку при фокусе */
    color: #333;
}

/* Кнопка отправки формы (иконка лупы) */
.search-form button {
    background: #4f94cf; /* Зеленый цвет под шапку */
    border: none;
    color: white;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.search-form button:hover {
    background: #1e5d8a;
}

/* Кнопка сброса поиска (крестик) */
.clear-search {
    position: absolute;
    right: 55px; /* Встает аккурат перед кнопкой-лупой */
    color: #9e9e9e;
    text-decoration: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.clear-search:hover {
    color: #256fa8;
}



