/* ЖЕСТКАЯ ЗАЩИТА ОТ БЕЛЫХ ПОЛОС КЛАВИАТУРЫ */
    html { background-color: #0a0a0a !important; height: 100%; }
    body {
    height: 100%; width: 100%; margin: 0; padding: 0;
    background-color: transparent; 
    color: #fff;
    font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
    overscroll-behavior-y: none;
    touch-action: pan-y; /* <-- ВОТ ТА САМАЯ МАГИЯ */
}
    
    /* Слой фона, который не ползет при скролле */
    #bg-layer {
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        z-index: -1;
        background-color: #0a0a0a;
        background-size: cover; 
        background-position: center top;
        transition: background-image 0.4s ease-in-out;
    }

    #main-wrapper { padding-bottom: 90px; min-height: 100%; box-sizing: border-box; width: 100%; }

    /* ВОЗРАСТНОЙ ГЕЙТ */
    #age-gate { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10, 10, 10, 0.98); z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; box-sizing: border-box; backdrop-filter: blur(10px); }
    .age-title { font-size: 48px; font-weight: 900; color: #fff; margin: 0 0 15px 0; text-transform: uppercase; letter-spacing: 2px; }
    .age-text { font-size: 15px; color: #ccc; margin-bottom: 40px; line-height: 1.6; max-width: 300px; }
    .age-buttons { display: flex; flex-direction: column; gap: 15px; width: 100%; max-width: 280px; }
    .age-btn { padding: 18px; border-radius: 12px; font-weight: 900; font-size: 16px; text-transform: uppercase; border: none; cursor: pointer; transition: 0.3s; }
    .age-btn-yes { background: #f39c12; color: #000; box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4); }
    .age-btn-no { background: #222; color: #888; border: 1px solid #333; }
    .age-btn:active { transform: scale(0.96); }

    /* ШАПКА */
    .header { background: #111; padding: 15px 15px 0 15px; text-align: center; position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 15px rgba(0,0,0,0.8); }
    .title { font-size: 24px; font-weight: 900; margin: 0; text-transform: uppercase; letter-spacing: 2px; color: #fff; }
    .subtitle { font-size: 12px; color: #aaa; margin-top: 6px; font-weight: 600; letter-spacing: 0.5px; display: inline-block; text-decoration: none; transition: 0.3s; }
    .header-actions { display: flex; justify-content: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
    .phone-btn, .tg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; background: #1a1a1a; color: #fff; text-decoration: none; font-size: 13px; font-weight: bold; border-radius: 20px; transition: 0.3s; border: 1px solid #333; }
    .phone-btn span { color: #2ecc71; font-size: 15px; }
    .tg-btn { border: 1px solid #2da5e1; box-shadow: 0 0 10px rgba(45, 165, 225, 0.1); }
    .tg-btn span { color: #2da5e1; font-size: 15px; }

    /* ВКЛАДКИ */
    .tabs { display: flex; margin-top: 15px; border-bottom: 2px solid #333; overflow-x: auto; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab { flex: 1 0 auto; padding: 12px 8px; font-size: 11px; font-weight: bold; text-transform: uppercase; color: #888; cursor: pointer; transition: 0.3s; text-align: center; white-space: nowrap; }
    .tab.active { color: #f39c12; border-bottom: 3px solid #f39c12; }
    .legend { display: none; justify-content: center; gap: 20px; font-size: 12px; font-weight: bold; margin-top: 10px; margin-bottom: 10px; background: #1a1a1a; padding: 10px; border-radius: 8px; border: 1px solid #333; }
    .legend span.l1 { color: #ffffff; }
    .legend span.l2 { color: #f39c12; }
    .tab-content { display: none; padding: 15px; flex-direction: column; gap: 20px; animation: fadeIn 0.3s; }
    .tab-content.active { display: flex; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

    /* --- ФИЛЬТРЫ ХОЛОДИЛЬНИКА --- */
.fridge-filters {
    display: flex;
    gap: 8px; /* Расстояние между окошками */
    width: 100%;
}

.fridge-filters {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* Общие стили для всех полей */
.fridge-filters select,
.fridge-filters input {
    flex: 1;
    width: 100%;
    background: rgba(20, 20, 20, 0.9);
    color: #fff;
    border: 1px solid #3498db;
    padding: 12px 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

/* Убираем страшные системные стрелки ТОЛЬКО у select */
.fridge-filters select {
    appearance: none;
    -webkit-appearance: none;
}

/* Возвращаем браузерную кнопку раскрытия списка для datalist */
.fridge-filters input {
    appearance: auto;
    -webkit-appearance: auto;
}

.fridge-filters select:focus,
.fridge-filters input:focus {
    border-color: #f39c12;
}

    /* КАТЕГОРИИ И ТОВАРЫ */
    .category { background: rgba(20, 20, 20, 0.85); border-radius: 12px; padding: 15px; border-top: 4px solid #333; box-shadow: 0 4px 10px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 12px; }
    .cat-title { font-size: 18px; font-weight: 800; text-transform: uppercase; padding-bottom: 8px; border-bottom: 1px solid #333; margin: 0 0 5px 0; line-height: 1.2; }
    .cat-fire { border-color: #e74c3c; } .cat-fire .cat-title { color: #e74c3c; }
    .cat-classic { border-color: #2ecc71; } .cat-classic .cat-title { color: #2ecc71; }
    .cat-craft { border-color: #e67e22; } .cat-craft .cat-title { color: #e67e22; }
    .cat-dark { border-color: #85c1e9; } .cat-dark .cat-title { color: #85c1e9; }
    .cat-snacks { border-color: #9b59b6; } .cat-snacks .cat-title { color: #9b59b6; }
    .cat-fridge { border-color: #3498db; } .cat-fridge .cat-title { color: #3498db; }
    .cat-promo { border-color: #f1c40f; } .cat-promo .cat-title { color: #f1c40f; }

    .item { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,0.1); transition: background 0.2s; }
    .item:last-child { border-bottom: none; }
    .item.has-story { cursor: pointer; }
    .item.has-story:active { background: rgba(0,0,0,0.5); border-radius: 8px; }

    .item-main { display: flex; gap: 12px; align-items: flex-start; }
    
    /* ИСПРАВЛЕНИЕ: Отключение скелетона после загрузки */
    .item-photo { 
        width: 70px; height: 70px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid #333;
        background: linear-gradient(90deg, #111 25%, #222 50%, #111 75%);
        background-size: 400% 100%;
        animation: skeleton-loading 1.5s infinite;
    }
    .item-photo.is-loaded {
        animation: none;
        background: #222;
    }
    @keyframes skeleton-loading {
        0% { background-position: 100% 50%; }
        100% { background-position: 0 50%; }
    }
    
    .item-info { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }

    .item-top { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; gap: 10px; }
    .item-name-wrap { display: flex; align-items: center; flex-grow: 1; flex-wrap: wrap; gap: 6px; }
    .item-name { font-weight: 800; font-size: 15px; color: #fff; line-height: 1.2; }
    .item-rating { background: rgba(243, 156, 18, 0.15); color: #f1c40f; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: bold; display: inline-flex; align-items: center; gap: 3px; border: 1px solid rgba(243, 156, 18, 0.3); }

    .promo-banner .item-name { font-size: 18px; color: #f1c40f; text-transform: uppercase; }
    .promo-banner .desc { font-size: 13px; color: #fff; margin-top: 4px; display: block; }

    .story-icon { color: #f39c12; font-size: 10px; transition: transform 0.3s ease; }
    .item.expanded .story-icon { transform: rotate(180deg); }
    .item-story { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid #2a2a2a; font-size: 13px; color: #ddd; line-height: 1.5; font-weight: 400; }
    .item.expanded .item-story { display: block; }

    .item-prices { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; text-align: right; }
    .p-out { font-size: 14px; font-weight: 900; color: #ffffff; }
    .p-bar { font-size: 14px; font-weight: 900; color: #f39c12; }
    .p-old { font-size: 12px; color: #777; text-decoration: line-through; }
    .p-action { display: inline-block; font-size: 16px; font-weight: 900; color: #e74c3c; text-shadow: 0 0 8px rgba(231, 76, 60, 0.4); animation: pricePulse 2s ease-in-out infinite; transform-origin: right center; }
    @keyframes pricePulse { 0% { transform: scale(1); text-shadow: 0 0 8px rgba(231, 76, 60, 0.4); } 50% { transform: scale(1.08); text-shadow: 0 0 15px rgba(231, 76, 60, 0.8), 0 0 25px rgba(231, 76, 60, 0.5); } 100% { transform: scale(1); text-shadow: 0 0 8px rgba(231, 76, 60, 0.4); } }

    .item-bot { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: #ccc; margin-top: 6px; align-items: center; }
    .desc { font-style: italic; color: #ddd; }
    .brewery { font-weight: bold; color: #85c1e9; }
    .specs { background: #222; padding: 2px 6px; border-radius: 4px; color: #ddd; }
    .connected-time { color: #2ecc71; font-weight: bold; background: rgba(46, 204, 113, 0.15); padding: 2px 6px; border-radius: 4px; }

    .badge { font-size: 9px; padding: 2px 4px; border-radius: 4px; font-weight: 900; letter-spacing: 0.5px; white-space: nowrap; }
    .badge-transit { background: #f39c12; color: #000; }
    .badge-sold { background: #e74c3c; color: #fff; }
    .badge-new { background: #2ecc71; color: #000; box-shadow: 0 0 8px rgba(46, 204, 113, 0.5); }
    .sold-out { opacity: 0.4; filter: grayscale(100%); pointer-events: none; }
    .sold-out .item-name { text-decoration: line-through; text-decoration-color: #e74c3c; }

    .loading { text-align: center; color: #888; font-size: 16px; margin-top: 50px; width: 100%; }
    .error-msg { text-align: center; margin: 30px 15px; padding: 20px; background: rgba(231, 76, 60, 0.1); border: 1px dashed #e74c3c; border-radius: 12px; color: #fff; line-height: 1.5; }

    /* БАННЕРЫ */
    .review-banner { display: flex; align-items: center; gap: 15px; background: rgba(20, 20, 20, 0.85); border: 1px solid #f39c12; border-radius: 12px; padding: 15px; margin: 20px 15px; text-decoration: none; color: #fff; box-shadow: 0 4px 15px rgba(243, 156, 18, 0.15); transition: 0.3s; }
    .review-banner:active { transform: scale(0.98); background: #1a1a1a; }
    .rb-icon { font-size: 32px; }
    .rb-text { display: flex; flex-direction: column; gap: 5px; }
    .rb-title { font-size: 16px; font-weight: 900; color: #f39c12; text-transform: uppercase; }
    .rb-desc { font-size: 12px; color: #ccc; line-height: 1.3; }

    .loyalty-img-banner { display: block; margin: 0 15px 30px 15px; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.5); border: 1px solid #333; }
    .loyalty-img-banner img { width: 100%; display: block; object-fit: cover; }

    /* --- СТИЛИ КОРЗИНЫ --- */
    .cart-btn-add { padding: 6px 12px; background: rgba(243, 156, 18, 0.15); border: 1px solid rgba(243, 156, 18, 0.35); color: #f1c40f; border-radius: 8px; font-weight: 900; font-size: 12px; cursor: pointer; transition: 0.2s; white-space: nowrap; margin-left: auto; display: block; margin-top: 8px; }
    .cart-btn-add:active { background: #f39c12; color: #000; transform: scale(0.95); }

    #cart-widget { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #f39c12; color: #000; padding: 14px 28px; border-radius: 30px; font-weight: 900; box-shadow: 0 4px 20px rgba(0,0,0,0.6); z-index: 1000; display: none; cursor: pointer; white-space: nowrap; font-size: 16px; border: 2px solid #000; }

    #cart-modal { 
        position: fixed; top: 0; left: 0; right: 0; 
        height: 100dvh; background: #0a0a0a !important; 
        z-index: 9999; display: none; flex-direction: column; 
    }
    .cart-header { position: sticky; top: 0; background: #111; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; z-index: 10; box-shadow: 0 4px 10px rgba(0,0,0,0.5); flex-shrink: 0; }
    .cart-body { padding: 20px; flex-grow: 1; overflow-y: auto; padding-bottom: max(60px, env(safe-area-inset-bottom)); }

    .checkout-btn { background: #2ecc71; color: #000; border: none; width: 100%; padding: 16px; border-radius: 12px; font-weight: 900; margin-top: 15px; cursor: pointer; text-transform: uppercase; font-size: 16px; }
    .checkout-btn:active { transform: scale(0.98); }
    .checkout-btn:disabled { background: #666; color: #aaa; cursor: not-allowed; transform: none; }

    .cart-input { background: #1a1a1a; border: 1px solid #444; color: #fff; padding: 15px; border-radius: 8px; width: 100%; box-sizing: border-box; margin-top: 12px; font-family: inherit; font-size: 16px; appearance: none; }
    .cart-input:focus { outline: none; border-color: #f39c12; background: #222; }

    #toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(46, 204, 113, 0.95); color: #000; padding: 12px 20px; border-radius: 12px; font-weight: 900; font-size: 13px; z-index: 10000; opacity: 0; pointer-events: none; transition: 0.3s; box-shadow: 0 4px 15px rgba(0,0,0,0.5); text-align: center; width: max-content; max-width: 85%; line-height: 1.4; }
    #toast.show { opacity: 1; transform: translateX(-50%) translateY(10px); }
    /* --- БАННЕР УСТАНОВКИ PWA --- */
#install-banner {
    position: fixed;
    bottom: 80px; /* Висит чуть выше виджета корзины */
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 400px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #f39c12;
    border-radius: 16px;
    z-index: 999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.8);
    padding: 12px;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from { bottom: -100px; opacity: 0; }
    to { bottom: 80px; opacity: 1; }
}

.install-banner-content { display: flex; align-items: center; gap: 12px; }
.install-icon { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; border: 1px solid #333; }
.install-text { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.install-text b { font-size: 14px; color: #fff; }
.install-text span { font-size: 11px; color: #aaa; line-height: 1.2; }
#install-btn { background: #f39c12; color: #000; font-weight: 900; border: none; padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; text-transform: uppercase; }
#install-btn:active { transform: scale(0.95); }
#close-install-btn { background: transparent; color: #666; border: none; font-size: 16px; padding: 5px; margin-left: 5px; cursor: pointer; }
/* --- КАСТОМНЫЕ ВЫПАДАЮЩИЕ СПИСКИ ДЛЯ ФИЛЬТРОВ --- */
.autocomplete-wrap {
    position: relative;
    flex: 1; 
    width: 100%;
}

.suggestions-list {
    position: absolute;
    top: calc(100% - 4px); /* Слипается с нижним краем поля */
    left: 0; right: 0;
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid #3498db;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 8px 16px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}

.suggestion-item {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:active { background: rgba(243, 156, 18, 0.3); color: #f39c12; }
.suggestion-item.reset-item {
    color: #f39c12;
    font-weight: bold;
    border-bottom: 1px solid rgba(243, 156, 18, 0.5);
    position: sticky;
    top: 0;
    background: rgba(20, 20, 20, 0.98);
    z-index: 10;
}