/* =========================================================
   Brand CSS — Кооператив: фирменный стиль
   Основано на брендбуке: цвета #F5F0D2 (теплый беж) и #062014 (тёмно-зелёный),
   шрифты Fira Sans Condensed (+ Pobeda для акцентов).
   ========================================================= */

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
    /* Цвета из брендбука */
    --brand-ink: #062014;    /* основной тёмно-зелёный (текст/фоны тёмные) */
    --brand-sand: #F5F0D2;   /* тёплый беж (светлый фон) */

    /* Производные оттенки */
    --brand-ink-80: rgba(6,32,20,.8);
    --brand-ink-60: rgba(6,32,20,.6);
    --brand-ink-40: rgba(6,32,20,.4);
    --brand-ink-20: rgba(6,32,20,.2);

    /* Акцент и состояния (подобраны в рамках гаммы) */
    --accent: #1f5a3a;          /* зелёная кнопка/акцент */
    --accent-2: #2a7b4e;        /* второй тон для градиента */
    --accent-hover: #246847;    /* hover */
    --danger: #a33a2f;          /* ошибки/удаление */
    --warning: #d4a53b;         /* бейджи/метки */

    /* Бэкграунды приложения */
    --app-bg-gradient:
      radial-gradient(1200px 600px at 20% -10%, rgba(245,240,210,.85) 0%, rgba(245,240,210,.65) 30%, rgba(6,32,20,.85) 100%),
      linear-gradient(135deg, #0b2e1e 0%, #062014 100%);
    --panel-bg: #ffffff;
    --panel-alt: #faf7ef;

    /* Текст и разделители */
    --text-primary: var(--brand-ink);
    --text-secondary: rgba(6,32,20,.75);
    --text-muted: rgba(6,32,20,.6);
    --divider: rgba(6,32,20,.08);

    /* Тени и радиусы */
    --shadow-1: 0 2px 10px rgba(6,32,20,.08);
    --shadow-2: 0 4px 16px rgba(6,32,20,.12);
    --shadow-3: 0 8px 24px rgba(6,32,20,.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;

    /* Типографика (шрифты из брендбука) */
    --font-base: "Fira Sans Condensed", "Fira Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    --font-accent: "Pobeda", "Fira Sans Condensed", "Fira Sans", Arial, sans-serif;

    /* Прочее */
    --focus-ring: 0 0 0 3px rgba(42,123,78,.28);
}

/* ---------- Modern CSS Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: var(--font-base);
    background: var(--app-bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Общие стили экранов ---------- */
.screen { display: none; flex-direction: column; min-height: 100vh; background: var(--panel-alt); }
.screen.active { display: flex; }

/* ---------- Шапка приложения ---------- */
.app-header {
    background: linear-gradient(180deg, rgba(245,240,210,.92) 0%, rgba(245,240,210,.86) 60%, rgba(245,240,210,.78) 100%);
    backdrop-filter: saturate(1.1) blur(6px);
    color: var(--brand-ink);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;    /* главное изменение */
    align-items: stretch;      /* вкладки займут всю ширину */
    justify-content: flex-start;
    box-shadow: var(--shadow-1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--divider);
}
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.header-title {
    font-family: var(--font-accent);
    letter-spacing: .3px;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--brand-ink);
}
.header-actions { display: flex; gap: 12px; align-items: center; }
.header-spacer { width: 40px; }

.back-btn {
    background: rgba(6,32,20,.08);
    border: 1px solid rgba(6,32,20,.16);
    color: var(--brand-ink);
    font-size: 1.2rem;
    padding: 6px 12px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: transform .15s ease, background-color .2s ease, border-color .2s ease;
}
.back-btn:hover { transform: translateY(-1px); background: rgba(6,32,20,.12); border-color: rgba(6,32,20,.22); }

.cart-icon, .profile-icon {
    position: relative;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px;
    color: var(--brand-ink);
    transition: transform .15s ease;
}
.profile-icon:hover, .cart-icon:hover { transform: scale(1.06); }

.cart-badge {
    position: absolute; top: -6px; right: -6px;
    background: var(--warning);
    color: #fff;
    border-radius: 999px;
    min-width: 20px; height: 20px;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 6px rgba(212,165,59,.45);
}

/* ---------- Кнопка в профиле и универсальная primary ---------- */
.primary-btn {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    width: 100%;
    margin-bottom: 15px;
    box-shadow: 0 4px 14px rgba(31,90,58,.25);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(31,90,58,.3); filter: brightness(1.02); }
.primary-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Вкладки в шапке ---------- */
.top-tabs {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 0 6px;
}
.tab-btn {
    flex: 0 0 auto;
    background: rgba(6,32,20,.06);
    border: 1px solid rgba(6,32,20,.18);
    color: var(--brand-ink);
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap; overflow: visible;
    font-size: clamp(11px, 3vw, 13px);
}
.tab-btn.active {
    background: rgba(6,32,20,.12);
    border-color: rgba(6,32,20,.28);
}

/* ---------- Сетка категорий ---------- */
.categories-grid {
    flex: 1;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow-y: auto;
    align-items: stretch;
    grid-auto-rows: auto;
    align-content: start;
}
.category-card {
    background: var(--panel-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex; flex-direction: column; justify-content: space-between; height: 100%;
    min-height: 120px;
    border: 1px solid var(--divider);
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.category-card h3 {
    font-size: 1.08rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    min-height: 2.4em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-family: var(--font-accent);
}
.category-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 5px;}
.delivery-date { font-size: 0.8rem; color: var(--text-muted); margin-top: 10px; min-height: 1.4em; }


/* Специальное выравнивание плиток категорий только на экране "Стол заказов" */
#main-screen #categories-grid-main .category-card {
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
	padding-top: 6px;      /* уменьшить общий верхний отступ плашки */
    padding-left: 8px;     /* сильнее прижать к левому краю */

    aspect-ratio: 4 / 3;}

#main-screen #categories-grid-main .category-card h3 {
    color: #000000;
	/* добавляем ↓ */
    font-size: 0.9rem;        /* чуть мельче */
    margin-top: 0;            /* прижать к верхнему краю */
    padding-top: 0;           /* прижать к верхнему краю */
    text-align: left;         /* прижать к левому */
	min-height: unset;     /* убрать "воздушность" по вертикали */
    line-height: 1.1;      /* плотнее строки */
    text-align: left;
}
.category-card.category-card--with-bg {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

.category-card.category-card--with-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        var(--category-bg-image) center/cover no-repeat;
    pointer-events: none;
    z-index: 0;
}

.category-card.category-card--with-bg > * {
    position: relative;
    z-index: 1;
}

.category-card.category-card--with-bg h3,
.category-card.category-card--with-bg p,
.category-card.category-card--with-bg .delivery-date {
    color: #ffffff;
}

/* ---------- Контейнер товаров ---------- */
.products-container {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: stretch;
    grid-auto-rows: auto;
    align-content: start;
}
.product-card {
    background: var(--panel-bg);
    border-radius: var(--radius-md);
    padding: 15px;
    box-shadow: var(--shadow-1);
    display: flex; flex-direction: column; height: 100%;
    min-height: 320px;
    border: 1px solid var(--divider);
}
.product-card { height: auto; }

.product-image {
    width: 100%; height: 120px;
    border-radius: 10px; overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    background: #f3efe4;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }

.new-item-badge {
    position: absolute;
    bottom: 4px; left: 4px;
    background: rgba(212,165,59,.95);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    display: flex; align-items: center; gap: 4px;
    z-index: 1; white-space: nowrap; overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

.product-info { flex: 1; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.product-name {
    font-size: 0.98rem; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); line-height: 1.3;
    min-height: 2.6em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    font-family: var(--font-accent);
}
.product-farmer { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; font-style: italic; min-height: 1.2em; }
.product-price { font-size: 0.9rem; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.product-weight { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.product-delivery { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.product-actions { margin-top: auto; padding-top: 8px; }

.add-to-cart-btn {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white; border: none; padding: 10px 15px; border-radius: 10px; font-weight: 700; cursor: pointer; transition: all 0.2s; width: 100%; font-size: 0.92rem;
    box-shadow: 0 4px 12px rgba(31,90,58,.25);
}
.add-to-cart-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(31,90,58,.3); }

/* Количество */
.quantity-controls { display: flex; align-items: center; justify-content: center; gap: 10px; background: #f7f3e9; padding: 8px 12px; border-radius: 20px; border: 1px solid var(--divider); }
.qty-btn { background: var(--accent); color: white; border: none; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.qty-btn:hover { filter: brightness(1.05); }
.qty-display { font-weight: 700; min-width: 22px; text-align: center; font-size: 0.92rem; color: var(--text-primary); }

/* ---------- Корзина ---------- */
.cart-container { flex: 1; padding: 20px; overflow-y: auto; }
.empty-cart { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-cart p { font-size: 1.1rem; margin-bottom: 20px; }
.empty-cart button {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white; border: none; padding: 12px 24px; border-radius: var(--radius-md); font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 12px rgba(31,90,58,.25);
}

.cart-items { margin-bottom: 20px; }
.cart-item { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--panel-bg); border-radius: var(--radius-md); margin-bottom: 10px; box-shadow: var(--shadow-1); border: 1px solid var(--divider); }
.cart-item-image { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #f3efe4; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 0.95rem; margin-bottom: 4px; color: var(--text-primary); font-family: var(--font-accent); }
.cart-item-info p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.cart-item-price { font-weight: 700; color: var(--accent); font-size: 0.95rem; }
.cart-item-controls { display: flex; align-items: center; gap: 10px; }

.cart-summary { background: var(--panel-bg); padding: 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-1); border: 1px solid var(--divider); }
.total-price { font-size: 1.2rem; font-weight: 800; text-align: center; margin-bottom: 15px; color: var(--text-primary); font-family: var(--font-accent); }
.checkout-btn {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%); color: white; border: none; padding: 15px; border-radius: var(--radius-md); font-weight: 700; width: 100%; margin-bottom: 10px; cursor: pointer; font-size: 1.05rem;
    box-shadow: 0 6px 18px rgba(31,90,58,.28);
}
.clear-cart-btn { background: var(--danger); color: white; border: none; padding: 12px; border-radius: var(--radius-md); font-weight: 700; width: 100%; cursor: pointer; }

/* ---------- Профиль и авторизация ---------- */
.profile-container { flex: 1; padding: 20px; overflow-y: auto; }
.auth-section, .profile-info {
    background: var(--panel-bg); padding: 24px; border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
    text-align: center; max-width: 420px; margin: 0 auto; border: 1px solid var(--divider);
}
.auth-section h3, .profile-info h3 {
    color: var(--brand-ink); margin-bottom: 15px; font-size: 1.35rem;
    font-family: var(--font-accent);
}
.phone-input, .code-input { display: flex; gap: 10px; margin: 20px 0; }
.phone-input input, .code-input input { flex: 1; padding: 12px 15px; border: 2px solid rgba(6,32,20,.15); border-radius: 10px; font-size: 1rem; background: #fffaf0; }
.phone-input button, .code-input button { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%); color: white; border: none; padding: 12px 20px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.code-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--divider); }
.user-info { text-align: left; margin: 20px 0; }
.user-info p { margin: 10px 0; padding: 8px; background: var(--panel-alt); border-radius: 8px; }
.logout-btn { background: var(--danger); color: white; border: none; padding: 12px 24px; border-radius: var(--radius-md); cursor: pointer; font-weight: 700; width: 100%; margin-top: 15px; }

/* ---------- Экран «Мои заказы» ---------- */
.orders-container { flex: 1; padding: 20px; overflow-y: auto; }
.empty-orders { text-align: center; color: var(--text-muted); padding: 30px; }
.order-card { background: #fff; border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-1); margin-bottom: 12px; border: 1px solid var(--divider); }
.order-row { display: flex; align-items: center; justify-content: space-between; }
.order-date { font-weight: 800; color: var(--text-primary); font-family: var(--font-accent); }
.delivery-date-mini { font-size: 0.9rem; color: var(--text-muted); }
.order-amount { font-weight: 800; color: var(--accent); }
.order-sub { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.order-open-btn {
    border: none; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-weight: 700;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%); color: #fff; box-shadow: 0 4px 12px rgba(31,90,58,.25);
}
.order-item-line { padding: 6px 0; border-bottom: 1px dashed var(--divider); }

/* ---------- Нижняя навигация ---------- */
.bottom-nav {
    background: #ffffffcc;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    padding: 6px 10px;
    display: flex; justify-content: space-around;
    box-shadow: 0 -2px 14px rgba(6,32,20,.08);
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 999;
    transition: transform .25s ease, opacity .25s ease;
    gap: 8px;
    border-top: 1px solid var(--divider);
}
.bottom-nav.hidden { transform: translateY(100%); opacity: 0.6; pointer-events: none; }
.nav-btn {
    background: none; border: 1px solid rgba(6,32,20,.18);
    font-size: clamp(11px, 3vw, 13px);
    padding: 6px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1 1 0; min-width: 0;
    color: var(--brand-ink);
    background-color: rgba(6,32,20,.06);
}
.nav-btn.active {
    background: rgba(6,32,20,.12);
    color: var(--brand-ink);
    transform: translateY(-1px);
    border-color: rgba(6,32,20,.28);
}
/* Чтобы контент не прятался за нижней панелью */
.screen-padding-bottom { padding-bottom: 88px; }

/* ---------- Поисковая панель ---------- */
.search-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 52px; /* над нижней навигацией */
    z-index: 1100;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease-out, opacity .22s ease-out;
}
.search-panel-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 16px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--panel-bg);
    border-radius: 18px 18px 0 0;
    box-shadow: var(--shadow-2);
    border-top: 1px solid var(--divider);
}
.search-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.search-input {
    flex: 1 1 auto;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(6,32,20,.16);
    font-size: 15px;
    outline: none;
    background: #fff;
}
.search-input:focus {
    border-color: var(--brand-main);
    box-shadow: var(--focus-ring);
}
.search-clear-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: rgba(6,32,20,.06);
    color: var(--brand-ink);
    white-space: nowrap;
}
.search-meta-row {
    max-width: 640px;
    margin: 4px auto 0;
    padding: 0 16px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: flex-start;
}
.search-results-count {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(6,32,20,.06);
}
.search-empty {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}



/* ---------- Search overlay suspend (keep state, hide overlay) ---------- */
body.search-suspended .search-panel,
body.search-suspended .search-panel.open,
body.search-suspended .search-panel.suspended {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ---------- Модальное окно (универсальные части) ---------- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(6,32,20,0.92); display: none; align-items: center; justify-content: center; z-index: 6000; }
.modal-image-container { position: relative; max-width: 90%; max-height: 90%; }
.modal-image-container img { max-width: 100%; max-height: 80vh; border-radius: 10px; box-shadow: var(--shadow-3); }
#close-modal { position: absolute; top: -40px; right: 0; background: rgba(245,240,210,0.2); border: none; color: #fff; font-size: 2rem; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }

/* ---------- Уведомления ---------- */
.notification {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: white; padding: 15px 25px; border-radius: 25px;
    box-shadow: 0 4px 15px rgba(31,90,58,0.3); opacity: 0; transition: opacity 0.3s; z-index: 3001; pointer-events: none;
    white-space: nowrap;              /* не переносить текст */
    max-width: calc(100% - 40px);     /* чтобы влезало в экран с отступами */
    overflow: hidden;                 /* обрезаем лишнее */
    text-overflow: ellipsis;          /* троеточие, если не помещается */
}

.notification.visible { opacity: 1; }

/* На совсем узких экранах позволим перенос */
@media (max-width: 360px) {
  .notification {
    white-space: normal;
    text-overflow: clip;
  }
}

/* ---------- Start welcome notification (30s) ---------- */
.start-notif {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20050; /* выше pickup-banner и шапки */
    transform: translateY(-115%);
    opacity: 0;
    transition: transform .38s ease, opacity .28s ease;
    pointer-events: none; /* навигация под ним работает */
}
.start-notif.visible {
    transform: translateY(0);
    opacity: 1;
}
.start-notif.hiding {
    transform: translateY(-115%);
    opacity: 0;
}

.start-notif .start-notif-inner {
    pointer-events: auto; /* кликабельны только кнопки/контент */
    width: 100%;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    border-bottom: 1px solid rgba(6,32,20,.10);
    box-shadow: 0 10px 24px rgba(6,32,20,.18);
    padding-top: calc(env(safe-area-inset-top, 0px));
}

.start-notif .start-notif-content {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 14px 12px;
    min-height: 88px; /* чуть больше, чем верхняя панель вкладок */
}

.start-notif .start-notif-image {
    width: 74px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(6,32,20,.06);
    border: 1px solid rgba(6,32,20,.10);
    box-shadow: 0 6px 16px rgba(6,32,20,.12);
}
.start-notif .start-notif-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.start-notif .start-notif-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.start-notif .start-notif-title {
    font-family: var(--font-accent);
    font-weight: 800;
    font-size: 1.02rem;
    line-height: 1.15;
    color: var(--brand-ink);
}
.start-notif .start-notif-title span {
    font-family: var(--font-base);
    font-weight: 600;
    color: rgba(6,32,20,.78);
}

.start-notif .start-notif-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.start-notif .start-notif-btn {
    border: 1px solid rgba(6,32,20,.14);
    border-radius: 12px;
    padding: 9px 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease, background-color .14s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.start-notif .start-notif-btn:active { transform: translateY(1px); }

.start-notif .start-notif-btn.yes {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    border-color: rgba(0,0,0,.0);
    box-shadow: 0 8px 18px rgba(31,90,58,.22);
}
.start-notif .start-notif-btn.yes:hover { filter: brightness(1.03); box-shadow: 0 10px 22px rgba(31,90,58,.28); }

.start-notif .start-notif-btn.no {
    background: rgba(6,32,20,.06);
    color: var(--brand-ink);
}
.start-notif .start-notif-btn.no:hover { background: rgba(6,32,20,.09); }

@media (min-width: 760px) {
    .start-notif .start-notif-content {
        grid-template-columns: 92px 1fr;
        padding: 14px 18px 14px;
        min-height: 96px;
    }
    .start-notif .start-notif-image {
        width: 92px;
        height: 72px;
        border-radius: 16px;
    }
    .start-notif .start-notif-title { font-size: 1.08rem; }
}

/* ---------- Спиннер загрузки ---------- */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(6,32,20,0.88); display: flex; justify-content: center; align-items: center; z-index: 9999; }
.spinner-container { text-align: center; color: #fff; font-size: 16px; font-weight: bold; }
.spinner { border: 4px solid rgba(245,240,210,0.35); border-top: 4px solid #fff; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin-bottom: 15px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ---------- Прокручиваемые зоны ---------- */
.scrollable { overflow-y: auto; }

/* ---------- Ряд статусов с вопросиками ---------- */
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.status-row > span:first-child { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.status-hint { cursor: pointer; margin-left: 6px; font-size: 14px; color: var(--accent-2); font-weight: 800; }

/* ---------- Адаптивность ---------- */
@media (min-width: 768px) {
    .categories-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; padding: 25px; }
    .products-container { grid-template-columns: repeat(auto-fit, minmax(250px, 340px)); gap: 20px; padding: 25px; justify-content: center; }
    .product-card { padding: 20px; }
    .product-image { height: 150px; }
    .app-header .header-title { font-size: 1.55rem; }
    .nav-btn { font-size: 0.9rem; padding: 10px 12px; }
}
@media (max-width: 480px) {
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
    .products-container { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
    .category-card { padding: 15px; min-height: 100px; }
    .product-card { padding: 12px; min-height: 280px; }
    .product-name { font-size: 0.92rem; min-height: 2.8em; }
    .app-header .header-title { font-size: 1.25rem; }
    .cart-item { flex-direction: column; text-align: center; gap: 12px; }
    .phone-input, .code-input { flex-direction: column; }
    .auth-section, .profile-info { padding: 16px; margin: 10px; }
    .nav-btn { font-size: 0.85rem; padding: 8px 10px; }
}

/* =========================================================
   STORIES — фирменные фоны для слайдов
   Используйте классы ниже на .story-slide (templates/_screens_stories.html)
   ========================================================= */

/* Светлая тема (беж на фоне) */
.story-theme-beige {
    background: var(--brand-sand);
    color: var(--brand-ink);
}

/* Тёмная тема (глубокий зелёный) */
.story-theme-green {
    background: var(--brand-ink);
    color: var(--brand-sand);
}

/* Градиентная тема с фирменными цветами */
.story-theme-gradient {
    background:
      radial-gradient(800px 400px at 15% -10%, rgba(245,240,210,.9) 0%, rgba(245,240,210,.55) 35%, rgba(6,32,20,1) 100%),
      linear-gradient(135deg, #0f3a25, #062014);
    color: var(--brand-sand);
}

/* Текст/кнопки на любом из фонов */
.story-theme-beige .story-body,
.story-theme-green .story-body,
.story-theme-gradient .story-body { color: inherit; }
.story-theme-beige .stories-join-btn,
.story-theme-green .stories-join-btn,
.story-theme-gradient .stories-join-btn {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    box-shadow: 0 6px 18px rgba(31,90,58,.35);
}

/* Декоративный «зерновой» узор (пшеница), тонкий водяной знак */
.story-bg-wheat {
    /* SVG как data URI, цвета под фирменную гамму */
    background-image:
      radial-gradient(1000px 500px at 85% 110%, rgba(245,240,210,.25), transparent 60%),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 800 800'><g fill='none' stroke='%23A1885E' stroke-opacity='.22' stroke-width='1.2'><path d='M120 700c90-160 120-240 80-360M160 720c100-170 140-250 100-380M200 740c110-180 160-260 120-400'/><path d='M420 680c60-110 80-170 55-260M450 700c65-118 90-180 62-280M480 720c70-126 100-190 68-300'/></g></svg>");
    background-repeat: no-repeat, no-repeat;
    background-size: cover, 800px 800px;
    background-position: center, right -120px bottom -80px;
}

/* Прогресс-бары и кнопки в оверлее сториз */
#stories-overlay .stories-skip {
    background: rgba(245,240,210,.15);
    border: 1px solid rgba(245,240,210,.28);
    color: #fff;
}
#stories-progress .stories-bar { background: rgba(245,240,210,.25); }
#stories-progress .stories-bar > div { background: #fff; }

/* Эффект паузы остаётся */
#stories-overlay.paused .story-slide[data-index] {
    filter: brightness(0.8);
}

/* =========================================================
   Приватные исправления исходной вёрстки (структура сохраняется)
   ========================================================= */

/* Переключение сеток на главном экране (как было) */
#categories-grid-main, #new-products-container, #farmers-grid { display: none; }
#main-screen.catalog-view #categories-grid-main { display: grid; }
#main-screen.new-view #new-products-container { display: grid; }
#main-screen.farmers-view #farmers-grid { display: grid; }

/* Корзина в виде карточек 2 колонки */
#cart-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 340px));
    gap: 12px;
    justify-content: center;
    align-items: stretch;
}
#cart-items .cart-item {
    background: var(--panel-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--divider);
}
#cart-items .product-image {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #f3efe4;
}
#cart-items .product-image img { width: 100%; height: 100%; object-fit: cover; }
#cart-items .cart-item-info h4 { font-size: 0.95rem; margin-bottom: 4px; color: var(--text-primary); font-family: var(--font-accent); }

/* на очень узких экранах корзину можно сложить в одну колонку */
@media (max-width: 400px) {
    #cart-items { grid-template-columns: 1fr; }
}
/* --- Кнопки анкеты --- */
.anketa-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.anketa-buttons .primary-btn,
.anketa-buttons .logout-btn {
    flex: 1;           /* кнопки одинаковой ширины */
    margin: 0;         /* убираем авто-отступы */
    width: auto;       /* убираем width:100% */
}
/* Футер модалки фильтра: кнопки в ряд */
#filter-modal .checkout-btn,
#filter-modal .clear-cart-btn {
  width: auto;
  margin-bottom: 0;
}
.top-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap; overflow: visible;
    padding: 8px 0;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.top-tabs {
    flex-wrap: wrap;
}
.filter-icon-btn {
    padding: 8px 12px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 14px;
    height: 14px;
}

.filter-icon span {
    display: block;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
}

.filter-icon span:nth-child(1) {
    width: 100%;
}

.filter-icon span:nth-child(2) {
    width: 75%;
}

.filter-icon span:nth-child(3) {
    width: 50%;
}
.tab-btn.filter-icon-btn {
    padding: 6px 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   Existing Orders (modal table) — аккуратная таблица в SweetAlert2
   ========================================================= */
.eo-popup .swal2-html-container { width: 100%; }

.eo-modal { text-align: left; line-height: 1.45; }
.eo-title { font-weight: 700; margin-bottom: 10px; }

.eo-empty { padding: 12px; color: var(--text-muted); text-align: center; }

.eo-table-wrap { margin-top: 6px; max-height: 50vh; overflow: auto; }
.eo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: #fff;
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.eo-table th, .eo-table td {
    border: 1px solid rgba(6,32,20,.08);
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
    color: var(--text-primary);
}
.eo-table thead th {
    background: var(--panel-alt);
    font-weight: 800;
    position: sticky;
    top: 0;
    z-index: 1;
}
.eo-table tbody tr:nth-child(odd) { background: rgba(6,32,20,.02); }

.eo-hint { margin-top: 10px; font-size: .9rem; color: var(--accent-2); }
/* ===== Дополнения для экрана "Мои заказы" ===== */

/* Второй хедер с переключателями "По дате ..." */
#orders-view-toggle {
    border-top: 1px solid var(--divider);
    padding-top: 6px;
}
#orders-view-toggle .tab-btn {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    padding: 8px 12px;
}
#orders-view-toggle .tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-2);
}

/* Карточки заказов — добавим чуть больше воздуха */
.order-card {
    padding: 12px 14px;
}
.order-row .order-date {
    font-size: 0.95rem;
}
.order-sub {
    font-size: 0.9rem;
}

/* Таблицы в модалках заказов (по аналогии с корзиной "Уже есть заказы") */
.eo-table th,
.eo-table td {
    font-size: 0.9rem;
}
.eo-title {
    margin-top: 6px;
    margin-bottom: 6px;
    font-family: var(--font-accent);
}
.orders-loading {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}/* ===== Редактирование сегодняшнего заказа ===== */
.order-edit-item {
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 12px;
  margin-bottom: 12px;
}

.oe-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.oe-title { font-weight: 800; font-family: var(--font-accent); color: var(--text-primary); }
.oe-remove {
  border: none; background: var(--danger); color:#fff; border-radius: 8px; padding:6px 10px; cursor: pointer; font-weight:700;
}
.oe-grid { display:grid; grid-template-columns: 1fr auto; gap: 8px; align-items:center; }
.oe-price { color: var(--text-muted); }
.oe-qty { display:flex; align-items:center; gap: 8px; }
.oe-btn {
  width: 34px; height: 34px; border-radius: 50%; border:none; cursor:pointer; font-weight:800; color:#fff;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
}
.oe-qty-num { min-width: 28px; text-align: center; font-weight: 800; }
.oe-sum { text-align: right; font-weight: 700; color: var(--accent); }


/* Плашка признака доставки в редакторе заказа (read-only) */
.order-edit-date-header { margin-bottom: 8px; }
.order-delivery-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--text-muted);
  white-space: nowrap;
}
.order-delivery-pill.on {
  color: #1f7a3d;
  border-color: rgba(39, 174, 96, 0.35);
  background: rgba(39, 174, 96, 0.08);
}
.order-delivery-pill.off {
  color: var(--text-muted);
  background: rgba(0,0,0,0.03);
}

/* Кнопки в плашке заказа */
.order-actions { display:flex; gap:8px; }
.order-edit-btn, .order-open-btn {
  border: none; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-weight: 700;
}
.order-edit-btn {
  background: #fff; border:1px solid var(--accent-2); color: var(--accent-2);
}
.order-open-btn {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%); color:#fff; box-shadow: 0 4px 12px rgba(31,90,58,.25);
}

/* =========================================================
   ДОБАВЛЕНО: Подсветка фокуса и активного состояния вкладок/фильтра,
   а также поддержка экрана «Даты выдачи»
   (добавлено без удаления исходных стилей)
   ========================================================= */

/* Фокус кольцом (как в «Мои заказы») для вкладок и кнопки фильтра */
.top-tabs .tab-btn:focus-visible,
#filter-btn.tab-btn:focus-visible,
#orders-view-toggle .tab-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Активная главная вкладка и активный фильтр — зелёные */
.top-tabs .tab-btn.active,
#filter-btn.tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-2);
}

/* Экран «Даты выдачи»: по умолчанию скрыт, показываем в режиме .dates-view */
#dates-grid { display: none; }
#main-screen.dates-view #dates-grid { display: grid; }

/* --- Правки корзины для выравнивания карточек --- */
#cart-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: stretch; /* выравнивание по высоте */
}
#cart-items .cart-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* чтобы низ карточек был на одном уровне */
}
#cart-items .cart-item-controls {
    margin-top: auto; /* всегда прижимается вниз */
}
#cart-items .already-orders-btn {
    margin-bottom: 8px; /* кнопка над блоком -1+ */
}

/* === Cart layout fix: button above controls and cards bottom-aligned === */
#cart-items { align-items: stretch; }
#cart-items .cart-item { display:flex; flex-direction:column; }
#cart-items .cart-item-controls { margin-top:auto; }
#cart-items .already-orders-btn { margin-top: 8px; margin-bottom: 8px; }


/* ===== ДОБАВЛЕНО: карточки позиций в модалке "Посмотреть" (По дате создания) ===== */
.oc-list { display: flex; flex-direction: column; gap: 10px; }
.oc-item-card {
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 12px 14px;
}
.oc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.oc-title { font-weight: 800; font-family: var(--font-accent); color: var(--text-primary); line-height: 1.25; }
.oc-body { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; color: var(--text-muted); font-size: 0.95rem; }
.oc-line b { color: var(--text-primary); }
.oc-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.oc-date { font-size: 0.9rem; color: var(--text-secondary); }


/* ===== Badges stack on product image (Хит над Новинкой) ===== */
.product-badges {
    position: absolute;
    left: 4px;
    bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}
.product-badges .new-item-badge { position: static; }
.hit-item-badge {
    background: rgba(255,87,34,.95);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    white-space: nowrap; overflow: visible;
}


/* Сезонный бейдж */
.season-item-badge {
    position: absolute;
    bottom: 4px; right: 4px;
    background: rgba(42,123,78,.95);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    display: flex; align-items: center; gap: 4px;
    z-index: 1; white-space: nowrap; overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}



/* === Corner badges layout (robust, no overlaps) === */
.product-image { position: relative; }
.product-badges { position: absolute; inset: 0; pointer-events: none; }

/* Ensure each badge is pinned to its corner explicitly */
.new-item-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: auto !important;
  top: auto !important;
  max-width: calc(50% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; overflow: visible;
  z-index: 2;
}
.hit-item-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  right: auto !important;
  bottom: auto !important;
  max-width: calc(70% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; overflow: visible;
  z-index: 2;
}
.season-item-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  left: auto !important;
  top: auto !important;
  max-width: calc(50% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; overflow: visible;
  z-index: 2;
}



/* === Structured badges: bottom-left stack (Хит над Новинкой), Season bottom-right === */
.product-image { position: relative; }
.product-badges { position: absolute; inset: 0; pointer-events: none; }

.badges-left-bottom {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  pointer-events: none;

  right: 88px;
  max-width: calc(100% - 92px);
}

/* Inside left-bottom stack, badges are static to stack vertically */
.badges-left-bottom .new-item-badge,
.badges-left-bottom .hit-item-badge {
  position: static !important;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; overflow: visible;
  pointer-events: auto;
  z-index: 2;
}

/* Keep existing visual styles for badges (colors etc.) if already defined */
.season-item-badge {
  position: absolute !important;
  bottom: 4px;
  right: 4px;
  left: auto !important;
  top: auto !important;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap; overflow: visible;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  pointer-events: auto;
}
.season-item-badge::before {
  content: '🍃';
  display: inline-block;
}



/* === FIX: don't truncate 'Новинка'/'Хит' badges in left-bottom stack === */
.badges-left-bottom .new-item-badge,
.badges-left-bottom .hit-item-badge {
  max-width: none !important;
  overflow: visible !important;
  white-space: nowrap !important;
}
/* Резервируем место под изображения, чтобы при lazy-loading не было скачков */
.product-image img,
.cart-item-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
/* === Orders: Store accordion (containers by pickup point) === */
.store-accordion { margin-bottom: 14px; border: 1px solid var(--divider); border-radius: var(--radius-md); box-shadow: var(--shadow-1); background:#fff; }
.store-acc-header { display:flex; align-items:center; justify-content:space-between; padding: 12px 14px; cursor:pointer; }
.store-acc-title { font-weight: 800; font-family: var(--font-accent); color: var(--text-primary); }
.store-acc-toggle { border:none; border-radius:10px; padding:8px 10px; font-weight:700; cursor:pointer; background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%); color:#fff; box-shadow: 0 4px 12px rgba(31,90,58,.25); }
.store-acc-body { padding: 10px 12px; border-top: 1px solid var(--divider); background:#fff; }

/* ---------- Избранное (сердечко на карточке) ---------- */
.fav-btn {
    position: absolute;
    top: 8px; right: 8px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(6,32,20,.18);
    background: rgba(255,255,255,.9);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-1);
    transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
    z-index: 2;
}
.fav-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.fav-btn:active { transform: translateY(0); }

.fav-icon {
    font-size: 18px; line-height: 1;
    color: rgba(163,58,47,.35); /* бледное сердце */
}
.fav-btn.fav-active { border-color: rgba(163,58,47,.35); background: #fff; }
.fav-btn.fav-active .fav-icon { color: #e23b2e; } /* красное сердце */

.product-image .fav-btn { /* закрепляем внутри области изображения */
    top: 8px; right: 8px;
}

/* =========================================================
   STORIES — стили для прогресс-баров и кнопки пропуска
   ========================================================= */

/* Прогресс-бары на всю ширину */
#stories-progress {
  display: flex;
  width: calc(100% - 32px); /* Учитываем padding */
  gap: 4px;
  padding: 0 16px;
  box-sizing: border-box;
  position: absolute;
  top: 16px;
  left: 0;
  z-index: 1000;
}

.stories-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

/* Кнопка пропуска ниже */
.stories-skip-lower {
  position: absolute;
  top: 30px !important;
  right: 16px;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  cursor: pointer;
}

/* Стили для оверлея сториз */
#stories-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 32, 20, 0.95);
  z-index: 9999;
  display: none;
}

#stories-overlay[aria-hidden="false"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#stories-slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.story-slide {
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.story-slide[style*="display: flex"] {
  display: flex !important;
}

/* Адаптивность для сториз */
@media (max-width: 480px) {
  #stories-progress {
    width: calc(100% - 24px); /* Учитываем padding на мобильных */
    padding: 0 12px;
    top: 12px;
    gap: 3px;
  }
  
  .stories-skip-lower {
    top: 25px !important;
    right: 12px;
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .stories-bar {
    height: 2px;
  }
}

/* ФИКС ВЫРАВНИВАНИЯ КНОПОК АНКЕТЫ */
#anketa-modal .anketa-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    align-items: center;
}

#anketa-modal .anketa-buttons .primary-btn,
#anketa-modal .anketa-buttons .logout-btn {
    margin: 0 !important;
    padding: 12px 16px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1;
    box-sizing: border-box !important;
}

/* Убираем глобальные отступы для этих кнопок */
#anketa-modal .primary-btn {
    margin-bottom: 0 !important;
}

#anketa-modal .logout-btn {
    margin-top: 0 !important;
}
/* ===== Product Detail ===== */
.pd-container { flex:1; padding: 16px; }
.pd-photo { width:100%; height: 240px; background:#f3efe4; border-radius: var(--radius-lg); overflow:hidden; box-shadow: var(--shadow-1); }
.pd-photo img { width:100%; height:100%; object-fit: cover; }
.pd-title { font-family: var(--font-accent); font-size: 1.35rem; margin: 12px 0 6px; }
.pd-badges { display:flex; gap:8px; margin-bottom: 8px; }
.badge.big { background: var(--warning); color:#fff; font-weight:800; padding:4px 8px; border-radius: 8px; font-size: .85rem; }
.badge.big.season { background: #2a7b4e; }
.badge.big.hit { background: #a33a2f; }

.pd-farmer-line { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom: 6px; }
.pd-farmer { font-size:.95rem; color: var(--text-secondary); font-style: italic; }
.pd-farmer-desc { font-size:.9rem; color: var(--text-muted); margin-bottom: 10px; }
.pd-farmer-link { font-size:.85rem; }

.pd-oval { background:#fff; border:1px solid var(--divider); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-1); display:grid; gap:6px; margin: 10px 0 14px; }
.pd-fav { display:flex; align-items:center; gap:10px; margin: 6px 0 12px; }
.pd-heart { width:40px; height:40px; border-radius: 50%; border:1px solid var(--divider); background:#fff; cursor:pointer; font-size:20px; display:flex; align-items:center; justify-content:center; box-shadow: var(--shadow-1); }
.pd-heart.fav-active .fav-icon { color: #e03131; }
.pd-fav-label { font-weight:700; }

.pd-add { margin: 6px 0 14px; }

.pd-block { background:#fff; border:1px solid var(--divider); border-radius: var(--radius-md); padding:12px 14px; box-shadow: var(--shadow-1); margin-bottom: 12px; }
.pd-h { font-weight:800; margin-bottom:8px; font-family: var(--font-accent); }

.pd-links .pd-row { display:flex; align-items:center; gap:8px; margin-bottom: 8px; }
.tg-icon { font-size: 18px; }

.link-btn { background:none; border:none; color: var(--accent); cursor:pointer; font-weight:700; text-decoration: underline; padding:0; }


/* =========================================================
   COMPACT PRODUCT & CART CARDS — overrides (non-destructive)
   Goal: larger image, denser text, minimal whitespace
   Added: 2025-09-21T02:19:53
   ========================================================= */

:root {
  /* tunables for quick adjustment */
  --product-image-height-mobile: 220px;
  --product-image-height-desktop: 260px;
  --product-text-sm: 0.74rem;
  --product-text-base: 0.88rem;
  --product-text-price: 0.95rem;
  --product-gap: 6px;
}

/* ——— Product cards ——— */
.products-container {
  gap: 8px !important;
  padding: 10px !important;
}
.product-card {
  padding: 10px !important;
  min-height: unset !important;
  gap: var(--product-gap);
}
.product-image {
  height: var(--product-image-height-desktop) !important;
  border-radius: 12px !important;
}
@media (max-width: 540px) {
  .product-image {
    height: var(--product-image-height-mobile) !important;
  }
}
.product-info {
  gap: 4px !important;
  margin: 8px 0 !important;
}
.product-name {
  font-size: var(--product-text-base) !important;
  line-height: 1.15 !important;
  min-height: unset !important;
  -webkit-line-clamp: 3 !important;
}
.product-farmer,
.product-weight,
.product-delivery {
  font-size: var(--product-text-sm) !important;
  line-height: 1.1 !important;
  margin: 0 !important;
}
.product-price {
  font-size: var(--product-text-price) !important;
  margin: 0 !important;
}
.product-actions {
  margin-top: auto !important;
  padding-top: 6px !important;
}
.add-to-cart-btn {
  padding: 8px 10px !important;
  font-size: 0.9rem !important;
}
.quantity-controls {
  padding: 6px 10px !important;
  gap: 8px !important;
}
.qty-btn {
  width: 26px !important;
  height: 26px !important;
}

/* ——— Cart items ——— */
.cart-container {
  padding: 16px !important;
}
.cart-item {
  gap: 10px !important;
  padding: 10px !important;
}
.cart-item-image {
  width: 96px !important;
  height: 96px !important;
  border-radius: 10px !important;
}
.cart-item-info h4 {
  font-size: 0.92rem !important;
  line-height: 1.15 !important;
  margin: 0 0 2px 0 !important;
}
.cart-item-info p {
  font-size: 0.75rem !important;
  line-height: 1.1 !important;
  margin: 0 0 4px 0 !important;
}
.cart-item-price {
  font-size: 1rem !important;
}
.cart-summary {
  padding: 14px !important;
}

/* ——— General header/tabs (keep compact) ——— */
.top-tabs {
  gap: 6px !important;
  padding: 6px 0 4px !important;
}
.tab-btn {
  padding: 6px 8px !important;
}

/* ——— Keep bottom spacing minimal while preserving nav ——— */
.screen-padding-bottom {
  padding-bottom: 52px !important;
}

/* ===== ФИКС: Кнопки редактирования заказа ===== */
.order-edit-footer {
    position: sticky;
    bottom: 0;
    background: var(--panel-alt);
    padding: 12px 16px;
    box-shadow: var(--shadow-1);
    border-top: 1px solid var(--divider);
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.footer-btn {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 8px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    min-width: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(31,90,58,.25);
}

.cancel-btn {
    background: var(--danger);
    color: white;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .footer-btn {
        font-size: 13px;
        padding: 6px 6px;
        height: 42px;
    }
    
    .order-edit-footer {
        padding: 6px 10px;
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .footer-btn {
        font-size: 12px;
        padding: 8px 4px;
    }
}

/* Кнопки подкатегорий — не вылезают за экран, переносят текст */
#subcategory-list .tab-btn {
    white-space: normal;          /* разрешаем перенос строк */
    word-break: break-word;       /* перенос длинных слов */
    line-height: 1.3;
    max-width: 100%;              /* не шире контейнера */
    box-sizing: border-box;       /* учитывать padding внутри */
    display: inline-block;        /* корректная работа переноса */
    text-align: left;             /* выравнивание текста */
}

/* Перелив и позиционирование кнопки "Подкатегории" в шапке категории */
#subcategory-toggle-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        120deg,
        rgba(39, 174, 96, 0.10),
        rgba(39, 174, 96, 0.35),
        rgba(39, 174, 96, 0.10)
    );
    background-size: 200% 200%;
    animation: subcategoryGlow 2.4s ease-in-out infinite;
    border-color: rgba(39, 174, 96, 0.45);
    margin-left: auto;   /* уезжает вправо в строке flex-контейнера */
    flex-shrink: 0;      /* не даём кнопке ужиматься слишком сильно */
}

/* Анимация мягкого перелива */
@keyframes subcategoryGlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* ===== Stories replay buttons in profile (same glow as subcategory toggle) ===== */
.profile-stories-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        120deg,
        rgba(39, 174, 96, 0.10),
        rgba(39, 174, 96, 0.35),
        rgba(39, 174, 96, 0.10)
    );
    background-size: 200% 200%;
    animation: subcategoryGlow 2.4s ease-in-out infinite;
    border-color: rgba(39, 174, 96, 0.45);
}

.profile-stories-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    max-width: 420px;   /* как у .profile-info */
    margin: 0px auto 10px;  /* центрируем и даём отступ сверху/снизу */
    width: 100%;        /* чтобы внутри max-width занимало всю ширину */
}

/* === Cart compact layout on desktop (match catalog grid) === */
@media (min-width: 768px) {
    #cart-items {
        grid-template-columns: repeat(auto-fit, minmax(250px, 340px));
        justify-content: center;
    }
}

/* ===== Product Detail: compact layout on desktop ===== */
@media (min-width: 768px) {
  #product-detail-screen .pd-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  #product-detail-screen #pd-content {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Compact buttons in product card */
  #product-detail-screen .pd-add .add-to-cart-btn,
  #product-detail-screen .pd-add .quantity-controls {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  #product-detail-screen .pd-links .primary-btn {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Optional: adjust product photo height on desktop */
  #product-detail-screen .pd-photo {
    height: 260px;
  }
}
/* ===== Product Detail: full-width buttons on desktop ===== */
@media (min-width: 768px) {
  #product-detail-screen .pd-add .add-to-cart-btn,
  #product-detail-screen .pd-add .quantity-controls,
  #product-detail-screen .pd-links .primary-btn {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* === Группировка корзины по датам выдачи === */
.cart-date-header {
    grid-column: 1 / -1;
    margin: 4px 0 2px;
}

.cart-date-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(245,240,210,.96), rgba(245,240,210,.82));
    border: 1px solid var(--divider);
    box-shadow: var(--shadow-1);
}

.cart-date-chip-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cart-date-chip-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Toggle: «Доставка» */
.cart-delivery-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cart-delivery-toggle-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.cart-delivery-toggle-track {
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: rgba(6,32,20,.18);
    border: 1px solid rgba(6,32,20,.16);
    position: relative;
    transition: background-color .18s ease, border-color .18s ease;
    flex: 0 0 auto;
}

.cart-delivery-toggle-thumb {
    position: absolute;
    top: 50%;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #fff;
    box-shadow: 0 2px 6px rgba(6,32,20,.18);
    transition: transform .18s ease;
}

.cart-delivery-toggle-input:checked + .cart-delivery-toggle-track {
    background: rgba(42,123,78,.95);
    border-color: rgba(42,123,78,.65);
}

.cart-delivery-toggle-input:checked + .cart-delivery-toggle-track .cart-delivery-toggle-thumb {
    transform: translate(14px, -50%);
}

.cart-delivery-toggle-text {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--brand-ink);
    white-space: nowrap;
}

.cart-delivery-toggle:focus-within .cart-delivery-toggle-track {
    box-shadow: var(--focus-ring);
}


.cart-date-chip-main {
    font-family: var(--font-accent);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--brand-ink);
}

.cart-date-chip-sub {
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

@media (max-width: 420px) {
    .cart-date-chip-main {
        font-size: 0.9rem;
    }
    .cart-date-chip-sub {
        font-size: 0.75rem;
    }
}

.sound-icon {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  font-size: 24px;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================
   POPOLNENIE BALANSA — стили для экрана пополнения баланса
   ========================================================= */

/* Стили для страницы пополнения баланса */
.amount-btn {
    padding: 14px 8px;
    border: 2px solid var(--divider);
    border-radius: var(--radius-md);
    background: var(--panel-bg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: var(--text-primary);
    box-shadow: var(--shadow-1);
}

.amount-btn:hover {
    border-color: var(--accent);
    background: rgba(39, 174, 96, 0.05);
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

.amount-btn.selected {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(31, 90, 58, 0.3);
}

.topup-container {
    max-width: 400px;
    margin: 0 auto;
}

/* Блок с текущим балансом */
.balance-info {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    text-align: center;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--divider);
}

/* Сетка кнопок сумм */
.amount-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

/* Секция с информацией о платеже */
.payment-info {
    background: rgba(39, 174, 96, 0.08);
    padding: 12px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent);
    margin-bottom: 16px;
}

/* Результат оплаты */
.payment-result {
    background: var(--panel-bg);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--divider);
    text-align: center;
    margin-top: 16px;
}

.payment-section {
    margin-top: 20px;
}

/* Дополнительно: стили для поля ввода когда оно активно */
#custom-amount:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
    outline: none;
}
/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .amount-btn {
        padding: 12px 6px;
        font-size: 13px;
    }
    
    .topup-container {
        padding: 12px;
    }
    
    .balance-info {
        padding: 16px;
    }
}

@media (max-width: 360px) {
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr) !important; /* 🔹 ВАЖНО: принудительно 2 колонки */
        gap: 6px;
    }
    
    .amount-btn {
        padding: 6px 6px;
        font-size: 12px;
        min-width: 0; 
    }
}

/* 🔹 ДЛЯ САМЫХ МАЛЕНЬКИХ ЭКРАНОВ - уменьшаем отступы но сохраняем 2 колонки */
@media (max-width: 320px) {
    .amount-buttons {
        gap: 4px;
    }
    
    .amount-btn {
        padding: 8px 4px;
        font-size: 11px;
    }
}
/* Для планшетов и десктопов */
@media (min-width: 768px) {
    .topup-container {
        padding: 20px;
    }
    
    .amount-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .amount-btn {
        padding: 16px 10px;
        font-size: 15px;
    }
}

/* ---------- Пункт выдачи ---------- */
.pickup-banner {
    margin-top: 3px;
	margin-bottom: 3px;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(245,240,210,.92) 0%, rgba(245,240,210,.86) 60%, rgba(245,240,210,.78) 100%);
    border: 1px solid var(--divider);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pickup-label {
    font-weight: 700;
}

.pickup-value {
    font-weight: 500;
}


/* ---------- Выбор даты выдачи товара ---------- */
.product-delivery {
    position: relative;
}

.product-delivery-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-right: 4px;
}

.delivery-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(6,32,20,.16);
    background: rgba(245,240,210,0.95);
    color: var(--brand-ink);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delivery-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-2);
    border: 1px solid var(--divider);
    padding: 6px 0;
    min-width: 220px;
    max-width: 100vw;
    z-index: 1200;
    display: none;
    left: 0;
    right: auto;
}

.delivery-dropdown.align-left {
    left: 0;
    right: auto;
}

.delivery-dropdown.align-right {
    right: 0;
    left: auto;
}

.delivery-dropdown.open {
    display: block;
}

.delivery-option {
    width: 100%;
    text-align: left;
    padding: 6px 12px;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.delivery-option:hover {
    background: var(--panel-alt);
}

.delivery-option.active {
    font-weight: 700;
    background: rgba(31,90,58,0.08);
}

/* Блок даты в большой карточке */
.pd-delivery {
    margin: 10px 0 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    position: relative; /* ← вот это ключевое */
}
.pd-delivery-label {
    font-weight: 600;
}
.pd-delivery-value {
    font-weight: 500;
}

/* Подсказка о планировании по датам выдачи */
.delivery-hint {
    position: fixed;
    top: 10px;
    right: 10px;
    max-width: 260px;
    background: rgba(245,240,210,0.98);
    color: var(--text-primary);
    border-radius: 14px;
    box-shadow: var(--shadow-2);
    padding: 6px 10px;
    font-size: 0.78rem;
    line-height: 1.3;
    border: 1px solid var(--divider);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 2000;
}
.delivery-hint.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.search-preorder-title {
    /* пусть занимает всю строку grid-а, как .search-empty */
    grid-column: 1 / -1;
    max-width: 640px;
    margin: 0 auto 8px;

    padding: 0 6px 8px;
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;

    white-space: normal;        /* обычный перенос по словам */
    word-break: normal;         /* не ломать слова внутри */
    overflow-wrap: break-word;  /* только если слово совсем не влазит */
}

/* === New Year button decoration === */
.newyear-btn {
    position: relative;
}
.newyear-btn::after {
    content: "🎄";
    position: absolute;
    top: -8px;
    right: -6px;
    font-size: 1.2em;
    pointer-events: none;
}
/* Snowflakes animation */
.newyear-btn::before {
    content: "❄";
    position: absolute;
    left: 6px;
    top: -10px;
    font-size: 0.9em;
    animation: snowfall 2.5s linear infinite;
    opacity: 0.85;
    pointer-events: none;
    text-shadow: 
        8px 4px 0px currentColor,
        14px 10px 0px currentColor,
        2px 16px 0px currentColor;
}
@keyframes snowfall {
    0% { transform: translateY(0); opacity: 1;}
    100% { transform: translateY(24px); opacity: 0;}
}



/* Тексты переключателя доставки */
.cart-delivery-toggle-text {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--brand-ink);
}

.cart-delivery-toggle-text .delivery-text-on {
    display: none;
}

.cart-delivery-toggle-input:checked ~ .cart-delivery-toggle-text .delivery-text-off {
    display: none;
}

.cart-delivery-toggle-input:checked ~ .cart-delivery-toggle-text .delivery-text-on {
    display: block;
}

/* === Cart delivery toggle: reserve space so layout doesn't shift === */
.cart-delivery-toggle {
    display: grid;
    grid-template-columns: 34px 124px; /* фиксируем место под трек и текст */
    align-items: center;
    column-gap: 8px;
}

.cart-delivery-toggle-track {
    grid-column: 1;
}

.cart-delivery-toggle-text {
    grid-column: 2;
    position: relative;
    width: 124px;              /* фиксируем ширину под обе надписи */
    min-height: calc(2 * 1.05em);
    line-height: 1.05;
    display: block;
    white-space: normal;
}

/* Резервируем высоту/ширину по самой "длинной" надписи (в две строки) */
.cart-delivery-toggle-text::before {
    content: "Доставка\Aв пункт выдачи";
    white-space: pre;
    display: block;
    visibility: hidden;
    pointer-events: none;
}

/* Переключаем тексты без влияния на размеры */
.cart-delivery-toggle-text .delivery-text-off,
.cart-delivery-toggle-text .delivery-text-on {
    position: absolute;
    inset: 0;
}

.cart-delivery-toggle-text .delivery-text-on {
    opacity: 0;
    pointer-events: none;
}

.cart-delivery-toggle-input:checked ~ .cart-delivery-toggle-text .delivery-text-off {
    opacity: 0;
    pointer-events: none;
}

.cart-delivery-toggle-input:checked ~ .cart-delivery-toggle-text .delivery-text-on {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 360px) {
    .cart-delivery-toggle {
        grid-template-columns: 34px 110px;
    }
    .cart-delivery-toggle-text {
        width: 110px;
    }
}


/* === Cart delivery toggle states (delivery not supported / disabled) === */
.cart-delivery-toggle-unsupported {
    opacity: .6;
}
.cart-delivery-toggle-unsupported .cart-delivery-toggle-track {
    filter: grayscale(1);
}

.cart-delivery-toggle-disabled {
    opacity: .55;
    cursor: not-allowed;
}
.cart-delivery-toggle-disabled .cart-delivery-toggle-track {
    filter: grayscale(1);
}

/* ==================== SPA АВТОРИЗАЦИЯ ==================== */

/* === Стили для экранов авторизации === */

/* Контейнеры auth-экранов */
#auth-screen .scrollable,
#store-select-screen .scrollable {
    padding-bottom: 80px; /* Место для фиксированных кнопок */
}

.auth-container {
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.store-select-container {
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 100px; /* Для фиксированных кнопок внизу */
}

/* Заголовки */
.auth-welcome {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 10px;
}

.auth-welcome h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2a7b4e; /* Зеленый цвет кооператива */
}

.auth-welcome p {
    color: #666;
    font-size: 16px;
    line-height: 1.4;
}

.store-select-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 10px;
}

.store-select-header h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2a7b4e;
}

.store-select-subtitle {
    color: #666;
    font-size: 16px;
    line-height: 1.4;
}

/* === Карточки провайдеров === */
.providers-list {
    margin-bottom: 30px;
}

.provider-card {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #e8f5e9;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.provider-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #2a7b4e);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.provider-card.available {
    cursor: pointer;
}

.provider-card.available:hover {
    border-color: #4CAF50;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.2);
}

.provider-card.available:hover::before {
    opacity: 1;
}

.provider-card.available:active {
    transform: translateY(-2px);
    transition: transform 0.1s ease;
}

.provider-card.unavailable {
    opacity: 0.6;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-color: #dee2e6;
    cursor: not-allowed;
}

.provider-icon {
    font-size: 36px;
    margin-right: 20px;
    min-width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 14px;
    color: #2a7b4e;
}

.provider-card.unavailable .provider-icon {
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    color: #757575;
}

.provider-info {
    flex: 1;
}

.provider-info h3 {
    font-size: 18px;
    margin-bottom: 6px;
    color: #333;
    font-weight: 600;
}

.provider-info p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.coming-soon {
    display: inline-block;
    background: linear-gradient(135deg, #FFB74D, #FF9800);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    letter-spacing: 0.3px;
}

.provider-action {
    margin-left: 15px;
    min-width: 100px;
}

/* === Карточки магазинов === */
.stores-list {
    margin-bottom: 30px;
}

.store-card {
    background: white;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 3px solid #e8f5e9;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.store-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #2a7b4e);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.store-card:hover {
    border-color: #4CAF50;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.2);
}

.store-card:hover::before {
    opacity: 1;
}

.store-card:active {
    transform: translateY(-2px);
    transition: transform 0.1s ease;
}

.store-card.selected {
    border-color: #4CAF50;
    background: linear-gradient(135deg, rgba(232, 245, 233, 0.3), rgba(200, 230, 201, 0.1));
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.15);
}

.store-card.selected::before {
    opacity: 1;
}

.store-card-header {
    margin-bottom: 18px;
}

.store-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    line-height: 1.3;
}

.store-address {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.store-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #f5f5f5;
    padding-top: 16px;
    margin-top: 16px;
}

.store-id {
    font-size: 13px;
    color: #888;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.store-selector {
    display: flex;
    align-items: center;
}

.store-selector-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #ccc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: white;
}

.store-selector-dot.selected {
    border-color: #4CAF50;
    background: #4CAF50;
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.2);
    animation: pulse 2s infinite;
}

.store-selector-dot.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* === Информационные блоки === */
.auth-info {
    background: linear-gradient(135deg, #f8fff8, #e8f5e9);
    padding: 20px;
    border-radius: 16px;
    margin-top: 25px;
    border-left: 4px solid #4CAF50;
}

.store-info {
    background: linear-gradient(135deg, #f8fff8, #e8f5e9);
    padding: 22px;
    border-radius: 16px;
    margin-bottom: 25px;
    border-left: 4px solid #4CAF50;
}

.small-text {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.small-text strong {
    color: #2a7b4e;
    font-weight: 600;
}

.store-features {
    list-style: none;
    padding: 0;
    margin: 18px 0;
}

.store-features li {
    padding: 10px 0;
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.store-features li::before {
    content: "✓";
    color: #4CAF50;
    font-weight: bold;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

/* === Кнопки === */
.btn {
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #2a7b4e);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #43A047, #1e6b3a);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: linear-gradient(135deg, #757575, #616161);
    color: white;
    box-shadow: 0 4px 12px rgba(117, 117, 117, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #616161, #424242);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(117, 117, 117, 0.3);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-large {
    padding: 18px 32px;
    font-size: 18px;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 16px;
    font-weight: 600;
}

/* Панель действий магазина */
.store-actions-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, white, rgba(255, 255, 255, 0.95));
    padding: 20px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
    border-top: 2px solid #f0f0f0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(10px);
}

/* === Панель статуса авторизации === */
.auth-status-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 255, 248, 0.98));
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-status-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    border: 2px solid #e8f5e9;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-status-title {
    font-size: 24px;
    margin-bottom: 12px;
    color: #2a7b4e;
    font-weight: 600;
}

.auth-status-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* QR код */
.qr-container {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 16px;
    border: 2px solid #e8f5e9;
}

.qr-container p {
    margin: 0 0 20px 0;
    color: #555;
    font-size: 15px;
}

.qr-container canvas {
    border: 12px solid white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #0088cc, #006699);
    color: white;
    padding: 16px 32px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
    width: 100%;
    font-size: 16px;
}

.telegram-link:hover {
    background: linear-gradient(135deg, #006699, #004d73);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4);
}

.telegram-link:active {
    transform: translateY(0);
}

/* Прогресс бар */
.auth-progress {
    margin: 30px 0;
    width: 100%;
}

.auth-progress progress {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    border: none;
    overflow: hidden;
}

.auth-progress progress::-webkit-progress-bar {
    background: #e8f5e9;
    border-radius: 5px;
}

.auth-progress progress::-webkit-progress-value {
    background: linear-gradient(90deg, #4CAF50, #2a7b4e);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.auth-progress progress::-moz-progress-bar {
    background: linear-gradient(90deg, #4CAF50, #2a7b4e);
    border-radius: 5px;
}

.auth-timer {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Кнопки действий */
.auth-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.auth-cancel-btn {
    min-width: 140px;
}

/* === Алерты и уведомления === */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-color: #f44336;
    color: #c62828;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .auth-container,
    .store-select-container {
        padding: 16px;
        max-width: 100%;
    }
    
    .auth-welcome,
    .store-select-header {
        margin-bottom: 25px;
        padding-top: 5px;
    }
    
    .auth-welcome h2,
    .store-select-header h2 {
        font-size: 22px;
    }
    
    .provider-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .provider-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .provider-info {
        margin-bottom: 15px;
        width: 100%;
    }
    
    .provider-action {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .provider-action .btn {
        width: 100%;
    }
    
    .store-card {
        padding: 20px 16px;
    }
    
    .store-actions-panel {
        padding: 16px;
        gap: 10px;
    }
    
    .btn-large {
        padding: 16px;
        font-size: 16px;
    }
    
    .auth-status-content {
        padding: 30px 24px;
        margin: 16px;
    }
    
    .auth-status-title {
        font-size: 22px;
    }
    
    .qr-container {
        padding: 16px;
        margin: 20px 0;
    }
    
    .qr-container canvas {
        width: 180px;
        height: 180px;
    }
    
    .telegram-link {
        padding: 14px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .auth-welcome h2,
    .store-select-header h2 {
        font-size: 20px;
    }
    
    .auth-welcome p,
    .store-select-subtitle {
        font-size: 15px;
    }
    
    .provider-card,
    .store-card {
        border-radius: 14px;
        padding: 18px;
    }
    
    .provider-info h3 {
        font-size: 17px;
    }
    
    .store-name {
        font-size: 17px;
    }
    
    .auth-status-content {
        padding: 24px 20px;
    }
    
    .auth-status-title {
        font-size: 20px;
    }
    
    .auth-status-message {
        font-size: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 15px;
    }
}

/* === Анимации для загрузки === */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
}

/* Стили для пустых состояний */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
    line-height: 1.5;
}

/* === Интеграция с основной навигацией === */
#auth-screen .bottom-nav,
#store-select-screen .bottom-nav {
    display: none !important;
}

/* Стили для состояния "выбора" */
.select-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #4CAF50;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.store-card.selected .select-feedback {
    opacity: 1;
}

/* Кастомный скролл для auth-экранов */
#auth-screen .scrollable,
#store-select-screen .scrollable {
    scrollbar-width: thin;
    scrollbar-color: #c8e6c9 #f5f5f5;
}

#auth-screen .scrollable::-webkit-scrollbar,
#store-select-screen .scrollable::-webkit-scrollbar {
    width: 6px;
}

#auth-screen .scrollable::-webkit-scrollbar-track,
#store-select-screen .scrollable::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

#auth-screen .scrollable::-webkit-scrollbar-thumb,
#store-select-screen .scrollable::-webkit-scrollbar-thumb {
    background: #c8e6c9;
    border-radius: 3px;
}

#auth-screen .scrollable::-webkit-scrollbar-thumb:hover,
#store-select-screen .scrollable::-webkit-scrollbar-thumb:hover {
    background: #a5d6a7;
}
/* Стили для auth callback страницы */
.auth-hint {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.provider-card .coming-soon {
    background: #ffc107;
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

/* Стили для кнопок авторизации */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ba87e 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
}

.auth-instructions {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    font-size: 14px;
    line-height: 1.5;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    margin-top: 10px;
}
.store-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.store-card {
    padding: 14px 16px;
}

.store-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Заголовки подкатегорий ("Группы") в списках товаров ---------- */
.subcategory-title {
    grid-column: 1 / -1;
    margin: 10px 4px 2px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(6,32,20,.06);
    border: 1px solid rgba(6,32,20,.12);
    font-weight: 800;
    font-family: var(--font-accent);
    color: var(--text-primary);
}


/* ---------- Полноэкранный режим поиска ---------- */
body.search-fullscreen .app-header { display: none !important; }
body.search-fullscreen .pickup-banner-global { display: none !important; }
body.search-fullscreen .bottom-nav { display: none !important; }

body.search-fullscreen .search-panel {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    background: var(--panel-alt);
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

body.search-fullscreen .search-panel-inner {
    max-width: none;
    width: 100%;
    margin: 0;
    border-radius: 0;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
}

body.search-fullscreen .search-meta-row {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 16px 8px;
    position: sticky;
    top: 56px;
    z-index: 2;
    background: var(--panel-alt);
}

body.search-fullscreen #search-results-container {
    flex: 1 1 auto;
    padding: 12px;
    overflow-y: auto;
    align-content: start;
}



/* ===== Pickup point banner: clickable + arrow ===== */
.pickup-clickable { cursor: pointer; }
.pickup-clickable:hover { opacity: 0.95; }
.pickup-arrow {
  margin-left: 8px;
  font-size: 16px;        /* ← было ~12px, это основной параметр */
  line-height: 1;
  font-weight: 600;
  opacity: 0.85;
  vertical-align: middle;
}
/* ===== end ===== */



/* === Telegram auth (QR / buttons) === */
.qr-container {
    margin-top: 14px;
}
.qrcode-box {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px auto 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    width: fit-content;
}
.qrcode-box img,
.qrcode-box canvas {
    display: block;
    border-radius: 10px;
}
.telegram-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.telegram-open-btn {
    width: auto;
    min-width: 180px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    margin-bottom: 0;
}
.telegram-copy-btn {
    width: auto;
    min-width: 180px;
    height: 44px;
    border-radius: var(--radius-md);
}
/* === Auth status panel (centered overlay) === */
.auth-status-panel {
    position: fixed;
    inset: 0;
    padding: 16px;
    background: rgba(6,32,20,.70);
    backdrop-filter: blur(8px);
    /* IMPORTANT: when JS sets display:flex, it will center the card */
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.auth-status-content {
    background: var(--panel-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-3);
    border: 1px solid var(--divider);
}


/* =========================================================
   HAND HINT (shared) — base styles for pointers
   Used by: pickup-hint (select pickup point), add-to-cart-hint (add to cart)
   ========================================================= */
.hand-hint{
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1105;
    display: none;
    pointer-events: none;
    text-align: center;
    filter: drop-shadow(0 10px 18px rgba(6,32,20,.22));
}
.hand-hint.visible{ display: block; }

.hand-hint-finger{
    font-size: 44px;
    line-height: 1;
    transform-origin: 50% 100%;
    animation: pickupHintBounce 1.15s ease-in-out infinite;
}
.hand-hint-text{
    margin-top: 6px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .2px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(6,32,20,.75);
    border: 1px solid rgba(245,240,210,.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 360px){
  .hand-hint-finger{ font-size: 40px; }
  .hand-hint-text{ font-size: 12px; padding: 7px 10px; }
}


/* =========================================================
   PICKUP POINT HINT (hand pointer) — shown when pickup not selected
   Позиция: под баннером выбора пункта выдачи, над шапкой экранов
   ========================================================= */
.pickup-hint{
    position: fixed;
    left: 50%;
    top: calc(env(safe-area-inset-top, 0px) + 58px); /* ~ высота pickup-banner */
    transform: translateX(-50%);
    z-index: 1105; /* выше app-header (1000) и search-panel (1100) */
    display: none;
    pointer-events: none;
    text-align: center;
    filter: drop-shadow(0 10px 18px rgba(6,32,20,.22));
}
.pickup-hint.visible{ display: block; }

.pickup-hint-finger{
    font-size: 44px;
    line-height: 1;
    transform-origin: 50% 100%;
    animation: pickupHintBounce 1.15s ease-in-out infinite;
}
.pickup-hint-text{
    margin-top: 6px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .2px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(6,32,20,.75);
    border: 1px solid rgba(245,240,210,.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes pickupHintBounce{
    0%   { transform: translateY(0) scale(1); opacity: .85; }
    45%  { transform: translateY(-10px) scale(1.03); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: .85; }
}

@media (max-width: 360px){
  .pickup-hint-finger{ font-size: 40px; }
  .pickup-hint-text{ font-size: 12px; padding: 7px 10px; }
}

/* =========================================================
   FLOATING SEARCH BUTTON (oval) — shown on most screens
   ========================================================= */
.floating-search-btn{
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px) + 52px); /* над нижним меню */
    transform: translateX(-50%);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(245,240,210,.28);

    background: linear-gradient(180deg, rgba(31,90,58,.98) 0%, rgba(42,123,78,.98) 100%);
    color: #fff;

    font-family: var(--font-base);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .2px;

    box-shadow: 0 10px 28px rgba(6,32,20,.26);
    cursor: pointer;

    transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease;
    opacity: 0;
    pointer-events: none;
}
.floating-search-btn.visible{
    display: inline-flex;
    opacity: 1;
    pointer-events: auto;
}
.floating-search-btn.hidden-anim{
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
    pointer-events: none;
}
.floating-search-btn:hover{
    box-shadow: 0 12px 32px rgba(6,32,20,.30);
    transform: translateX(-50%) translateY(-1px);
}
.floating-search-btn:active{
    transform: translateX(-50%) translateY(0px);
}
.floating-search-btn:focus-visible{
    outline: none;
    box-shadow: var(--focus-ring), 0 12px 32px rgba(6,32,20,.30);
}

.floating-search-btn .fsb-icon{
    font-size: 18px;
    line-height: 1;
}
.floating-search-btn .fsb-text{
    line-height: 1;
}

/* На совсем узких экранах чуть компактнее */
@media (max-width: 360px){
  .floating-search-btn{
    padding: 11px 16px;
    font-size: 14px;
    gap: 8px;
  }
  .floating-search-btn .fsb-icon{ font-size: 17px; }
}

/* Когда открыт полноэкранный поиск — кнопка плавно исчезает */
body.search-fullscreen .floating-search-btn{
    opacity: 0 !important;
    transform: translateX(-50%) translateY(10px) !important;
    pointer-events: none !important;
}



/* ===== Add to cart hint (reuse shared hand-hint styles) ===== */
.add-to-cart-hint{
  /* inherits base look from .hand-hint (position, animation, text pill) */
  z-index: 200000; /* above everything */
  left: 0; /* will be set by JS via style.left */
  top: 0;  /* will be set by JS via style.top */
  transform: translateX(-50%);
  display: none;
  pointer-events: none;
  text-align: center;
  filter: drop-shadow(0 10px 18px rgba(6,32,20,.22));
}
.add-to-cart-hint.visible{ display:block; }

/* map inner elements to shared styles */
.add-to-cart-hint .hint-hand{ font-size: 44px; line-height: 1; transform-origin: 50% 100%; animation: pickupHintBounce 1.15s ease-in-out infinite; }
.add-to-cart-hint .hint-text{
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .2px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(6,32,20,.75);
  border: 1px solid rgba(245,240,210,.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 360px){
  .add-to-cart-hint .hint-hand{ font-size: 40px; }
  .add-to-cart-hint .hint-text{ font-size: 12px; padding: 7px 10px; }
}


/* ===== SMS auth ===== */
.sms-auth-panel{
    max-width: 420px;
    margin: 0 auto;
    padding: 18px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
}

.sms-label{
    display:block;
    margin: 12px 0 6px;
    font-size: 14px;
    opacity: .9;
}

.sms-input{
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.18);
    color: inherit;
    outline: none;
}

.sms-input:focus{
    border-color: rgba(255,255,255,0.35);
}

.sms-actions{
    display:flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.sms-error{
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 0, 0, 0.10);
    border: 1px solid rgba(255, 0, 0, 0.25);
    font-size: 14px;
}

.sms-code-inputs{
    display:flex;
    justify-content:center;
    gap: 10px;
    margin: 14px 0 6px;
}

.sms-code-digit{
    width: 46px;
    height: 52px;
    text-align: center;
    font-size: 22px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.18);
    color: inherit;
    outline: none;
}

.sms-code-digit:focus{
    border-color: rgba(255,255,255,0.35);
}


/* ======================= SMS AUTH UI ======================= */
.screen-header{
    display:flex;
    align-items:center;
    gap:12px;
    padding:16px 18px 6px 18px;
}
.screen-header h2{
    margin:0;
    font-size:20px;
    font-weight:700;
}
.screen-header .back-btn{
    border:none;
    background:transparent;
    font-size:22px;
    line-height:1;
    cursor:pointer;
    padding:4px 6px;
    border-radius:10px;
}
.screen-header .back-btn:hover{
    background:rgba(0,0,0,0.06);
}

.sms-auth-container{
    max-width:420px;
    margin:0 auto;
    padding:18px;
}

.auth-step{
    background:rgba(255,255,255,0.92);
    border-radius:18px;
    padding:18px;
    box-shadow:0 8px 22px rgba(0,0,0,0.08);
}

.auth-hint{
    font-size:14px;
    margin-bottom:12px;
    opacity:0.9;
}

.auth-label{
    display:block;
    font-size:13px;
    font-weight:600;
    margin:10px 0 6px;
}

.auth-input{
    width:100%;
    box-sizing:border-box;
    padding:12px 14px;
    border-radius:14px;
    border:1px solid rgba(0,0,0,0.12);
    background:#fff;
    outline:none;
    font-size:15px;
}
.auth-input:focus{
    border-color:rgba(0,0,0,0.22);
}

.auth-error{
    min-height:18px;
    font-size:13px;
    color:#b00020;
    margin:8px 0 0;
}

.auth-primary-btn{
    width:100%;
    margin-top:14px;
    padding:12px 14px;
    border:none;
    border-radius:14px;
    cursor:pointer;
    font-weight:700;
    color:#fff;
    background:linear-gradient(90deg, #1f8d5a, #1aa06a);
    box-shadow:0 10px 22px rgba(31,141,90,0.22);
}
.auth-primary-btn:hover{ filter:brightness(1.03); }
.auth-primary-btn:active{ transform:translateY(1px); }

.auth-secondary-btn{
    width:100%;
    margin-top:10px;
    padding:11px 14px;
    border:none;
    border-radius:14px;
    cursor:pointer;
    font-weight:700;
    color:#2b2b2b;
    background:rgba(0,0,0,0.08);
}
.auth-secondary-btn:hover{ background:rgba(0,0,0,0.10); }
/* =========================================================== */



/* --- Start notification buttons layout tweaks --- */
.start-notif .start-notif-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.start-notif .start-notif-btn.yes {
    flex: 2;      /* "да" в 2 раза шире */
    order: 2;     /* и стоит вторым */
}

.start-notif .start-notif-btn.no {
    flex: 1;
    order: 1;     /* "нет" первым */
}



/* ===== FIX: Start welcome notification buttons (desktop 2:1 ratio) ===== */
@media (min-width: 768px) {
  .start-notif .start-notif-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;          /* не переносим */
    max-width: 360px;           /* вменяемая ширина блока */
    margin: 8px auto 0;         /* по центру */
  }

  /* порядок: сначала НЕТ, потом ДА */
  .start-notif .start-notif-btn.no {
    order: 1;
    width: 120px;               /* 1 часть */
    max-width: 120px;
    flex: 0 0 120px;
  }

  .start-notif .start-notif-btn.yes {
    order: 2;
    width: 240px;               /* 2 части — строго в 2 раза шире */
    max-width: 240px;
    flex: 0 0 240px;
  }
}
\n\n
/* ===== Start welcome notification: add vertical air (1.5x height) ===== */
.start-notif .start-notif-content {
    padding-top: 18px;
    padding-bottom: 18px;
}

.start-notif .start-notif-text {
    gap: 14px; /* больше воздуха между заголовком и кнопками */
}

.start-notif .start-notif-actions {
    margin-top: 8px;
}



/* ===== FIX: increase start-notif height and push buttons down ===== */
.start-notif .start-notif-content {
    padding-top: 20px !important;
    padding-bottom: 28px !important;
    align-items: flex-start; /* чтобы контент не стягивался к центру */
}

.start-notif .start-notif-text {
    gap: 18px !important; /* больше воздуха между текстовыми строками */
}

.start-notif .start-notif-actions {
    margin-top: 16px !important; /* опускаем кнопки ниже */
}



/* =========================================================
   STORE INFO MODAL (pickup point details + media carousel)
   ========================================================= */
.store-info-modal{
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: rgba(6,32,20,0.88);
    backdrop-filter: blur(6px) saturate(1.1);
    -webkit-backdrop-filter: blur(6px) saturate(1.1);
    z-index: 20060; /* выше start-notif (20050) */
}
.store-info-modal.open{ display: flex; }

.store-info-card{
    width: 100%;
    max-width: 640px;
    background: rgba(255,255,255,.96);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-3);
    border: 1px solid rgba(6,32,20,.10);
    overflow: hidden;
}

.store-info-top{
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--divider);
    background: linear-gradient(180deg, rgba(245,240,210,.9) 0%, rgba(255,255,255,.92) 100%);
}
.store-info-title{
    font-family: var(--font-accent);
    font-weight: 800;
    font-size: 1.12rem;
    color: var(--brand-ink);
    letter-spacing: .2px;
}

.store-info-body{
    padding: 14px 16px 2px;
}
.store-info-line{
    margin-bottom: 10px;
}
.store-info-label{
    font-size: 0.88rem;
    font-weight: 800;
    color: rgba(6,32,20,.78);
    margin-bottom: 3px;
}
.store-info-value{
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--brand-ink);
    line-height: 1.25;
    word-break: break-word;
}

.store-info-desc{
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 12px 12px;
    border-radius: var(--radius-md);
    background: rgba(6,32,20,.04);
    border: 1px solid rgba(6,32,20,.08);
    color: rgba(6,32,20,.82);
    font-size: 0.92rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.store-info-carousel{
    position: relative;
    margin: 0 0 12px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(6,32,20,.05);
    border: 1px solid rgba(6,32,20,.10);
}
.store-info-media-wrap{
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    max-height: 52vh;
    padding: 8px;
}
.store-info-media{
    width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(6,32,20,.12);
    background: #f3efe4;
}
.store-info-media-empty{
    padding: 24px 12px;
    text-align: center;
    font-weight: 700;
    color: rgba(6,32,20,.65);
}

.store-info-nav{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(245,240,210,.35);
    background: rgba(6,32,20,.72);
    color: #fff;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(6,32,20,.22);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.store-info-nav:disabled{
    opacity: .35;
    cursor: default;
}
.store-info-nav--prev{ left: 10px; }
.store-info-nav--next{ right: 10px; }

.store-info-counter{
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(6,32,20,.70);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(245,240,210,.22);
}

.store-info-footer{
    padding: 12px 16px 16px;
    border-top: 1px solid var(--divider);
    background: rgba(255,255,255,.92);
}
.store-info-ok{
    margin-bottom: 0;
}

@media (max-width: 420px){
    .store-info-media-wrap{ min-height: 200px; }
    .store-info-nav{ width: 38px; height: 42px; border-radius: 13px; }
}



/* ===== FIX: fixed media area size in store info modal ===== */
.store-info-media-wrap{
    min-height: 260px;
    height: 320px;
    max-height: 50vh;
}

.store-info-media{
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* ----- Store info modal: Telegram links ----- */
.store-info-tg-links{
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(6,32,20,.03);
    border: 1px solid rgba(6,32,20,.08);
}

.store-info-tg-item{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}

.store-info-tg-item + .store-info-tg-item{
    border-top: 1px dashed rgba(6,32,20,.10);
    margin-top: 6px;
    padding-top: 10px;
}

.store-info-tg-icon{
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(31,90,58,.12);
    color: rgba(31,90,58,1);
    flex: 0 0 auto;
    border: 1px solid rgba(31,90,58,.18);
}

.store-info-tg-text{ min-width: 0; }

.store-info-tg-title{
    font-weight: 800;
    color: rgba(6,32,20,.80);
    font-size: 0.90rem;
    line-height: 1.25;
    margin-bottom: 6px;
}

.store-info-tg-link{
    display: inline-block;
    word-break: break-word;
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
    background: rgba(31,90,58,.08);
    border: 1px solid rgba(31,90,58,.14);
    padding: 7px 10px;
    border-radius: 12px;
    transition: transform .12s ease, filter .12s ease;
}
.store-info-tg-link:hover{
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.store-info-links a{color:inherit;text-decoration:none;font-weight:600}
.store-info-links a:hover{text-decoration:underline}


/* ===== Store info modal: fixed height + inner scroll (mobile friendly) ===== */
.store-info-card {
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.store-info-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Minimal scrollbar */
.store-info-body::-webkit-scrollbar {
    width: 4px;
}
.store-info-body::-webkit-scrollbar-track {
    background: transparent;
}
.store-info-body::-webkit-scrollbar-thumb {
    background: rgba(6,32,20,.35);
    border-radius: 4px;
}

@media (max-width: 480px) {
    .store-info-card {
        max-height: 92vh;
    }
}


/* ===== Store select: store type label under store name ===== */
.store-type{
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(6,32,20,.55);
    line-height: 1.15;
    padding-left: 2px;
}

/* ===================== SMS CODE BOXES (4 digits) ===================== */
.sms-code-hidden {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.sms-code-boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 12px 0 6px 0;
}

.sms-code-digit {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.18);
    background: #fff;
    font-size: 22px;
    line-height: 54px;
    text-align: center;
    outline: none;
}

.sms-code-digit:focus {
    border-color: rgba(0,0,0,0.45);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

@media (max-width: 360px) {
    .sms-code-digit {
        width: 46px;
        height: 50px;
        font-size: 20px;
        line-height: 50px;
    }
}


/* Floating label inputs (anketa) */
.floating-field{
    position: relative;
    margin: 10px 0;
}

.floating-field .floating-input{
    width: 100% !important;
    padding: 18px 12px 10px 12px !important;
    margin: 0 !important;
    border: 1px solid rgba(6,32,20,.18) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--text-primary);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: var(--font-base);
    font-size: 15px;
}

.floating-field .floating-input:focus{
    border-color: rgba(42,123,78,.75) !important;
    box-shadow: var(--focus-ring);
}

.floating-field label{
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
    background: transparent;
    padding: 0 6px;
    transition: top .15s ease, transform .15s ease, font-size .15s ease, color .15s ease, background-color .15s ease;
}

/* When focused or has value (CSS path) */
.floating-field .floating-input:focus + label,
.floating-field .floating-input:not(:placeholder-shown) + label{
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--brand-ink-80);
    background: #fff;
}

/* JS fallback for inputs without :placeholder-shown (date, autofill) */
.floating-field.has-value label{
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--brand-ink-80);
    background: #fff;
}

/* Keep date picker icon aligned */
.floating-field .floating-input[type="date"]{
    padding-top: 18px !important;
    padding-bottom: 10px !important;
}



/* --- Anketa confirm checkbox + disabled Save button --- */
.anketa-confirm-block {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--divider, rgba(6,32,20,.08));
    border-radius: var(--radius-md, 12px);
    background: var(--panel-alt, #faf7ef);
}

.anketa-confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--text-primary, #062014);
    font-size: 0.95rem;
    line-height: 1.25;
}

.anketa-confirm-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #1f5a3a);
    flex: 0 0 auto;
}

.anketa-save-btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed !important;
    filter: grayscale(0.15);
    pointer-events: none; /* визуально и по клику */
}

/* ======= Not Found (404) ======= */
.not-found-wrap {
    padding: 16px;
}

.not-found-card {
    background: #fff;
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    max-width: 520px;
    margin: 18px auto;
    text-align: center;
}

.not-found-emoji {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 10px;
}

.not-found-h {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.not-found-p {
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.35;
    margin-bottom: 14px;
}

.not-found-actions {
    display: flex;
    justify-content: center;
}

.not-found-actions .primary-btn {
    min-width: 220px;
}

.not-found-hint {
    font-size: 12px;
    color: #6b6b6b;
    margin-top: 12px;
}
