:root {
    --bg-0: #0f0f10;          /* глубокий чёрный */
    --bg-1: #1a1a1d;          /* панели */
    --bg-2: #232327;          /* карточки */
    --line: #34343a;          /* границы */
    --accent: #ff7a18;        /* оранжевый */
    --accent-2: #ff9d4d;      /* светло-оранжевый */
    --accent-deep: #e85d04;   /* насыщенный */
    --text: #f2f2f3;
    --text-dim: #a9a9b2;
}

html {
    font-size: 15px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

/* --- Раскладка: sticky footer через flex --- */
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background:
        linear-gradient(rgba(10,10,11,0.86), rgba(10,10,11,0.92)),
        url('/img/bg.jpg') center center / cover no-repeat fixed;
}

.page-container {
    flex: 1 0 auto;   /* растягивает контент, прижимая футер вниз */
    padding-top: 1.25rem;
    padding-bottom: 2rem;
}

main { animation: fadeIn 0.4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px);} to {opacity:1; transform:none;} }

/* --- Навбар --- */
.site-navbar {
    background: rgba(20,20,22,0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 0;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
    color: var(--accent) !important;
}
.site-navbar .nav-link {
    color: var(--text) !important;
    font-weight: 500;
}
.site-navbar .nav-link:hover { color: var(--accent) !important; }
.navbar-toggler {
    border-color: var(--line);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ff7a18' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- Поиск в шапке --- */
.header-search {
    position: relative;
    max-width: 520px;
}
.header-search .form-control {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 999px;
    padding: 0.5rem 2.6rem 0.5rem 1rem;
}
.header-search .form-control::placeholder { color: var(--text-dim); }
.header-search .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.15rem rgba(255,122,24,0.25);
    background: var(--bg-2);
    color: var(--text);
}
.header-search-btn {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

/* --- Корзина в шапке --- */
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-total { font-weight: 700; color: var(--accent); }
.cart-ico { font-size: 1.15rem; }
.cart-badge {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    font-size: 0.72rem;
    line-height: 20px;
    text-align: center;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
}
.cart-badge.bump { animation: pop 0.4s ease; }
@keyframes pop { 0%{transform:scale(1);} 50%{transform:scale(1.35);} 100%{transform:scale(1);} }

/* --- Круглая иконка профиля --- */
.profile-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #111 !important; font-weight: 800; font-size: 1rem;
    text-decoration: none; margin-left: 10px;
    box-shadow: 0 4px 14px rgba(255,122,24,0.45);
    transition: transform 0.2s ease;
}
.profile-avatar:hover { transform: scale(1.1); color:#111 !important; }

/* --- Заголовки --- */
h1, h2, h3 { color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* --- Секции каталога: отдельные рамки --- */
.panel {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem 1.15rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.category-panel .cat-link {
    display: block;
    color: var(--text);
    padding: 4px 0;
}
.category-panel .cat-title { font-weight: 700; color: var(--accent); margin-top: 8px; }
.category-panel .cat-sub { color: var(--text-dim); padding-left: 12px; }
.category-panel .cat-sub:hover { color: var(--accent); }

/* --- Сетка товаров --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

/* --- Карточка товара --- */
.product-card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 10px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(255,122,24,0.18);
}

.product-thumb-wrap { position: relative; }
.product-thumb {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #2a2a2f, #202024);
}
.product-thumb img {
    width: 100%; height: 100%;
    object-fit: contain;      /* показываем всю картинку без обрезки/зума */
    object-position: center;
    display: block;
    transform: none;          /* не двигаем картинку при наведении */
    padding: 6px;
}
/* Placeholder, когда картинки нет (декоративный — не перехватывает клики) */
.product-thumb .placeholder-ico {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; color: var(--accent);
    opacity: 0.7;
    pointer-events: none;   /* не мешать нажатию кнопок поверх миниатюры */
}

/* Круглая кнопка "+" на картинке */
.add-fab {
    position: absolute;
    right: 8px; bottom: 8px;
    z-index: 3;               /* поверх миниатюры/плейсхолдера */
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #111;
    font-size: 1.4rem; font-weight: 700;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, background 0.15s ease;
}
.add-fab:hover { transform: scale(1.1); background: var(--accent-2); }
.add-fab:active { transform: scale(0.92); }

/* Счётчик +/- на карточке товара — растянут на всю ширину картинки снизу */
.qty-control {
    position: absolute;
    left: 8px; right: 8px; bottom: 8px;
    z-index: 3;               /* поверх миниатюры/плейсхолдера */
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: rgba(15,15,16,0.9);
    border-radius: 999px;
    padding: 4px;
    backdrop-filter: blur(4px);
}
.qty-control.active { display: flex; }
.qty-control.active ~ .add-fab { display: none; }
.qty-btn {
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: var(--accent); color: #111;
    font-size: 1.1rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.12s ease;
}
.qty-btn:active { transform: scale(0.9); }
.qty-val { min-width: 22px; text-align: center; font-weight: 700; color: var(--text); }

/* Инфо о товаре */
.product-info { padding: 10px 4px 4px; }
.product-price {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
}
.product-price .old {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-decoration: line-through;
    margin-left: 6px;
    font-weight: 500;
}
.product-category { color: var(--text-dim); font-size: 0.85rem; margin-top: 2px; }
.product-pack { color: var(--text-dim); font-size: 0.82rem; }
.product-name-link { color: var(--text); }

.out-of-stock-badge {
    position: absolute; left: 8px; top: 8px;
    background: rgba(0,0,0,0.7); color: var(--accent-2);
    font-size: 0.72rem; padding: 2px 8px; border-radius: 999px;
}

/* Нет в наличии: полупрозрачная карточка, уходит в конец списка. */
.product-card--oos {
    order: 1;              /* в grid/flex товары без наличия идут после обычных */
    opacity: 0.5;
    filter: grayscale(0.35);
}
.product-card--oos:hover { opacity: 0.75; transform: none; box-shadow: none; }

/* --- Кнопки --- */
.btn-primary, .btn-success {
    background: var(--accent); border: none; color: #111; font-weight: 700;
}
.btn-primary:hover, .btn-success:hover { background: var(--accent-2); color:#111; }
.btn-outline-primary { border-color: var(--accent); color: var(--accent); }
.btn-outline-primary:hover { background: var(--accent); color:#111; }
.btn-link { color: var(--accent); }

/* --- Таблицы/формы --- */
.table { color: var(--text); }
.table > :not(caption) > * > * { background: transparent; color: var(--text); border-color: var(--line); }
.form-control, .form-select, textarea {
    background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
}
.form-control:focus {
    background: var(--bg-2); color: var(--text);
    border-color: var(--accent); box-shadow: 0 0 0 0.15rem rgba(255,122,24,0.25);
}
.form-control[readonly] { background: #17171a; }
.alert-info { background: rgba(255,122,24,0.12); border-color: var(--accent); color: var(--accent-2); }
.alert-secondary { background: var(--bg-1); border-color: var(--line); color: var(--text-dim); }

/* --- Карточка авторизации/профиля --- */
.auth-card {
    max-width: 460px;
    margin: 2vh auto;
    padding: clamp(16px, 3vw, 30px);
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 16px 46px rgba(0,0,0,0.5);
    animation: fadeIn 0.4s ease both;
    position: relative;
}
.auth-card-wide { max-width: 700px; }
.auth-card .form-label { margin-bottom: 2px; font-size: 0.9rem; font-weight: 600; }
.auth-card .mb-2 { margin-bottom: 0.5rem !important; }
.auth-card .mb-3 { margin-bottom: 0.75rem !important; }

/* Кнопка закрытия меню профиля */
.card-close {
    position: absolute;
    right: 14px; top: 12px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text);
    font-size: 1.1rem; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: all 0.15s ease;
}
.card-close:hover { border-color: var(--accent); color: var(--accent); }

@media (max-height: 780px) {
    .auth-card { margin: 1vh auto; padding: 16px 20px; }
    .auth-card h1 { font-size: 1.2rem; margin-bottom: 0.5rem !important; }
    .auth-card .form-control { padding: 0.32rem 0.6rem; }
    .auth-card .mb-2 { margin-bottom: 0.35rem !important; }
    .auth-card .mb-3 { margin-bottom: 0.5rem !important; }
}

/* --- Footer (всегда внизу) --- */
.site-footer {
    flex-shrink: 0;
    background: rgba(20,20,22,0.96);
    border-top: 1px solid var(--line);
    color: var(--text-dim);
    padding: 16px 0;
    text-align: center;
}

/* --- Тосты --- */
#toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 1080;
    display: flex; flex-direction: column; gap: 10px;
}
.app-toast {
    background: var(--accent); color: #111;
    padding: 12px 18px; border-radius: 12px; font-weight: 700;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
}
@keyframes toastIn { from {opacity:0; transform:translateX(40px);} to {opacity:1; transform:none;} }
@keyframes toastOut { from {opacity:1;} to {opacity:0; transform:translateX(40px);} }

/* Пагинация */
.pagination .page-link { background: var(--bg-2); border-color: var(--line); color: var(--text); }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #111; }

/* --- Красивая кнопка "назад" --- */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    cursor: pointer;
}
.btn-back:hover { border-color: var(--accent); color: var(--accent); transform: translateX(-3px); }
.btn-back svg { width: 18px; height: 18px; }

/* --- Кнопка "Удалить все" (урна) --- */
.btn-clear-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}
.btn-clear-all:hover { border-color: #e5484d; color: #ff6b6b; }
.btn-clear-all svg { flex-shrink: 0; }

/* --- Корзина: центрированный контейнер ограниченной ширины --- */
.cart-wrap { max-width: 720px; margin: 0 auto; }

/* --- Список товаров в корзине --- */
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 10px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.cart-thumb {
    width: 72px; height: 72px;
    border-radius: 12px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2a2a2f, #202024);
    flex-shrink: 0;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .placeholder-ico { font-size: 1.8rem; color: var(--accent); }

.cart-info { min-width: 0; }
.cart-name { color: var(--text); font-weight: 600; display: block; }
.cart-name:hover { color: var(--accent); }
.cart-sub { color: var(--text-dim); font-size: 0.88rem; margin-top: 2px; }
.cart-price { color: var(--accent); font-weight: 700; }

.cart-qty { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-qty .qty-control {
    position: static;
    display: flex;
    background: var(--bg-1);
    border: 1px solid var(--line);
}
.cart-line-total { font-weight: 800; color: var(--text); }

.cart-summary {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 1.15rem;
}
.cart-grand-total { color: var(--accent); font-weight: 800; font-size: 1.4rem; }

@media (max-width: 560px) {
    .cart-row { grid-template-columns: 60px 1fr; }
    .cart-qty { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ============================================================
   Витрина: hero + карточки главных категорий
   ============================================================ */
.hero-panel {
    background: linear-gradient(135deg, rgba(255,122,24,0.16), rgba(20,20,22,0.6));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: clamp(24px, 5vw, 48px);
    text-align: center;
    box-shadow: 0 10px 34px rgba(0,0,0,0.4);
}
.hero-title { color: var(--accent); font-weight: 800; font-size: clamp(1.5rem, 4vw, 2.4rem); margin-bottom: 0.5rem; }
.hero-lead { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 1.25rem; }

.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.1rem;
}
.category-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 14px 34px rgba(255,122,24,0.2);
    color: var(--text);
}
.category-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #2a2a2f, #202024);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.category-card-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: none; }
.category-card-fallback {
    position: absolute; inset: 0;
    display: none;
    align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800; color: var(--accent);
}
.category-card-media.no-img .category-card-fallback { display: flex; }
.category-card-delivery {
    position: absolute; left: 10px; bottom: 10px;
    background: rgba(15,15,16,0.82);
    color: var(--accent-2);
    font-size: 0.8rem; font-weight: 600;
    padding: 3px 10px; border-radius: 999px;
    backdrop-filter: blur(4px);
}
.category-card-body { padding: 14px 16px; flex: 1 0 auto; }
.category-card-title { color: var(--text); font-size: 1.2rem; margin: 0 0 4px; }
.category-card-desc { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 8px; }
.category-card-count { color: var(--accent); font-size: 0.82rem; font-weight: 600; }

/* ============================================================
   Страница подкатегорий
   ============================================================ */
.delivery-chip, .subcat-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--bg-2);
    color: var(--text); text-decoration: none; font-weight: 600;
    transition: all 0.16s ease;
}
.delivery-chip { color: var(--accent-2); }
.subcat-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.subcat-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.subcat-chip-all { color: var(--accent); border-style: dashed; }

/* ============================================================
   Каталог: заголовок + панель фильтра
   ============================================================ */
.catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn-filter-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0.45rem 1rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--bg-2);
    color: var(--text); font-weight: 600; cursor: pointer;
    transition: all 0.16s ease;
}
.btn-filter-toggle:hover { border-color: var(--accent); color: var(--accent); }
@media (min-width: 992px) { .btn-filter-toggle { display: none; } }

.filter-panel .filter-title { color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.filter-price { display: flex; align-items: center; gap: 8px; }
.filter-price .form-control { text-align: center; }
.filter-dash { color: var(--text-dim); }
.filter-delivery { display: flex; flex-direction: column; gap: 6px; }
.delivery-radio {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 10px;
    cursor: pointer; color: var(--text);
    border: 1px solid transparent; transition: all 0.14s ease;
}
.delivery-radio:hover { background: var(--bg-2); }
.delivery-radio input { accent-color: var(--accent); }
.filter-actions { margin-top: 14px; }

/* На больших экранах фильтр всегда виден (перекрываем Bootstrap collapse). */
@media (min-width: 992px) {
    .filter-panel.show-lg { display: block !important; }
    .filter-panel.show-lg.collapse:not(.show) { height: auto; }
}

/* ============================================================
   Карта доставки (регистрация)
   ============================================================ */
.delivery-map {
    width: 100%; height: 300px;
    border-radius: 14px; overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-2);
}
.map-hint { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 8px; }
.map-disabled {
    display: flex; align-items: center; justify-content: center;
    height: 100%; padding: 16px; text-align: center;
    color: var(--text-dim); font-size: 0.9rem;
}
.delivery-here-btn { margin-top: 10px; }
.delivery-here-btn.picked { background: #2fbf71; }

/* Метка/чип времени доставки на карточке товара */
.product-delivery {
    color: var(--text-dim); font-size: 0.8rem; margin-top: 2px;
    display: inline-flex; align-items: center; gap: 4px;
}

/* ============================================================
   Админ-панель
   ============================================================ */
.admin-nav {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}
.admin-nav-link {
    padding: 8px 16px; border-radius: 999px;
    color: var(--text); text-decoration: none; font-weight: 600;
    border: 1px solid var(--line); background: var(--bg-2);
    transition: all 0.15s ease;
}
.admin-nav-link:hover { border-color: var(--accent); color: var(--accent); }
.admin-nav-link.active { background: var(--accent); color: #111; border-color: var(--accent); }
.admin-nav-exit { margin-left: auto; color: var(--text-dim); }

.admin-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem;
}
.admin-card {
    display: block; text-decoration: none; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
    padding: 22px; transition: all 0.2s ease;
}
.admin-card:hover { transform: translateY(-4px); border-color: var(--accent); color: var(--text); box-shadow: 0 12px 30px rgba(255,122,24,0.18); }
.admin-card-ico { font-size: 2rem; }
.admin-card-title { font-weight: 800; font-size: 1.1rem; margin-top: 6px; }
.admin-card-desc { color: var(--text-dim); font-size: 0.9rem; }

.admin-table th { color: var(--text-dim); font-weight: 600; border-color: var(--line); }
.admin-table td { border-color: var(--line); }
.admin-thumb {
    width: 44px; height: 44px; border-radius: 10px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2a2a2f, #202024); color: var(--accent);
}
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }

.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    background: rgba(255,122,24,0.15); color: var(--accent-2); font-size: 0.82rem; font-weight: 600;
}
.badge-on { color: #2fbf71; font-weight: 700; }
.badge-off { color: var(--text-dim); font-weight: 700; }

.admin-filter { display: flex; align-items: center; }

.import-sample {
    background: var(--bg-0); border: 1px solid var(--line); border-radius: 10px;
    padding: 12px; color: var(--text-dim); font-size: 0.82rem; overflow-x: auto; max-height: 320px;
}
.product-chars { color: var(--text-dim); padding-left: 18px; }
.product-chars li { margin-bottom: 2px; }

.subcat-admin-list { list-style: none; margin: 0; padding: 0; }
.subcat-admin-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--line);
}
.subcat-admin-list li:last-child { border-bottom: none; }

/* ============================================================
   Кнопка "Назад" (глобальная навигация)
   ============================================================ */
.nav-back {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
    padding: 0.45rem 1.1rem 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text);
    font-weight: 600; font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, background 0.2s ease, padding 0.2s ease;
}
.nav-back svg {
    width: 18px; height: 18px;
    transition: transform 0.25s ease;
}
.nav-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateX(-4px);
    background: rgba(255,122,24,0.08);
}
.nav-back:hover svg { transform: translateX(-3px); }
.nav-back:active { transform: translateX(-1px) scale(0.97); }

/* ============================================================
   Ассоциативный поиск (выпадающие подсказки)
   ============================================================ */
.search-suggestions {
    position: absolute;
    top: calc(100% + 6px); left: 0; right: 0;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0,0,0,0.5);
    overflow: hidden;
    z-index: 1090;
    display: none;
    max-height: 70vh; overflow-y: auto;
}
.search-suggestions.open { display: block; animation: suggestIn 0.16s ease; }
@keyframes suggestIn { from { opacity: 0; transform: translateY(-6px);} to { opacity: 1; transform: none; } }

.suggest-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    text-decoration: none; color: var(--text);
    border-bottom: 1px solid var(--line);
    transition: background 0.12s ease;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.active { background: var(--bg-2); color: var(--text); }
.suggest-thumb {
    width: 40px; height: 40px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2a2a2f, #202024); color: var(--accent);
}
.suggest-thumb img { width: 100%; height: 100%; object-fit: cover; }
.suggest-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.suggest-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-meta { color: var(--text-dim); font-size: 0.8rem; }
.suggest-price { color: var(--accent); font-weight: 700; white-space: nowrap; }
.suggest-empty { padding: 14px; color: var(--text-dim); text-align: center; }

/* ============================================================
   Страница товара: кнопка/счётчик и пищевая ценность
   ============================================================ */
.pd-cart { display: inline-flex; align-items: center; }
.pd-qty.qty-control {
    position: static;
    display: none;
    background: var(--bg-1);
    border: 1px solid var(--line);
    gap: 10px;
    padding: 5px;
}
.pd-qty.qty-control.active { display: inline-flex; }
.pd-qty .qty-val { min-width: 28px; font-size: 1.05rem; }
.pd-qty .qty-btn { width: 34px; height: 34px; }

.nutrition { border-top: 1px solid var(--line); padding-top: 14px; }
.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}
.nutrition-item {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: center;
}
.nutrition-label { color: var(--text-dim); font-size: 0.82rem; }
.nutrition-value { color: var(--text); font-weight: 800; font-size: 1.25rem; margin-top: 2px; }

/* ============================================================
   Плавающая кнопка "Перейти в корзину"
   ============================================================ */
.cart-fab {
    position: fixed;
    right: 20px; bottom: 20px;
    z-index: 1070;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--accent);
    color: #111 !important;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(255,122,24,0.45);
    opacity: 0; transform: translateY(20px) scale(0.95);
    transition: opacity 0.22s ease, transform 0.22s ease, background 0.15s ease;
}
.cart-fab.show { opacity: 1; transform: translateY(0) scale(1); }
.cart-fab:hover { background: var(--accent-2); color: #111 !important; transform: translateY(-2px) scale(1.03); }
.cart-fab:active { transform: scale(0.97); }
.cart-fab-ico { font-size: 1.25rem; }
.cart-fab-count {
    min-width: 24px; height: 24px; padding: 0 7px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #111; color: #fff;
    border-radius: 999px; font-size: 0.82rem; font-weight: 700;
}
@media (max-width: 560px) {
    .cart-fab { right: 14px; bottom: 14px; padding: 11px 16px; }
    .cart-fab-text { display: none; }
}

/* ============================================================
   Метки кашрута и доступности (Этап 1)
   ============================================================ */
.kosher-badge {
    position: absolute; left: 8px; top: 8px;
    z-index: 2;
    font-size: 0.7rem; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
    color: #fff;
    pointer-events: none;
}
.kosher-badge.kosher-meat  { background: #c0392b; }   /* мясное — красный */
.kosher-badge.kosher-dairy { background: #2d6cdf; }   /* молочное — синий */
.kosher-badge.kosher-parve { background: #2fa84f; }   /* парве — зелёный */
.kosher-badge--inline {
    position: static; font-size: 0.78rem; pointer-events: auto;
}

.availability-badge {
    position: absolute; right: 8px; top: 8px;
    z-index: 2;
    background: rgba(0,0,0,0.72); color: var(--accent-2);
    font-size: 0.7rem; font-weight: 600;
    padding: 2px 8px; border-radius: 999px;
    pointer-events: none;
}
.availability-badge--inline {
    position: static;
    background: var(--bg-2); border: 1px solid var(--line);
    color: var(--text-dim); font-size: 0.78rem; pointer-events: auto;
}

.allergen-note {
    display: inline-block;
    background: rgba(255,122,24,0.12);
    border: 1px solid var(--accent);
    color: var(--accent-2);
    font-size: 0.85rem; font-weight: 600;
    padding: 4px 10px; border-radius: 10px;
}

/* ============================================================
   Этап 3: футер-ссылки, история заказов, инфо-страницы
   ============================================================ */
.footer-links {
    display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;
    margin-bottom: 8px;
}
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { color: var(--text-dim); font-size: 0.85rem; }

.status-chip, .status-badge {
    display: inline-block; padding: 2px 12px; border-radius: 999px;
    background: rgba(255,122,24,0.14); color: var(--accent-2);
    font-size: 0.82rem; font-weight: 600;
}

.order-history-lines { list-style: none; margin: 0; padding: 0; }
.order-history-lines li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 0; border-bottom: 1px dashed var(--line); color: var(--text);
}
.order-history-lines li:last-child { border-bottom: none; }

.info-page { max-width: 760px; margin: 0 auto; }
.info-page ul { color: var(--text); }
.info-page a { color: var(--accent); }
