:root {
    /* Цвета логотипа Yashna: кремовый фон, тёплый коричневый текст, терракотовый кувшин,
       шалфейные листья. Одинаковые в светлой и тёмной теме Telegram — это цвета бренда. */
    --bg-color: #F8EFE0;
    --card-bg: #FFFBF4;
    --text-color: #4A2F1B;
    --hint-color: #8A6A50;
    --accent: #D9653B;
    --accent-dark: #B9502A;
    --green: #6F905A;
    --green-soft: rgba(111, 144, 90, 0.14);
    --secondary-bg: #EFE2CC;
}

* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0 16px;
}

/* --- Вкладки (Страницы) --- */
.page {
    display: none;
    padding-bottom: 120px; /* Отступ под плавающее меню */
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Шапка магазина --- */
.shop-hero { display: flex; align-items: center; gap: 14px; padding: 18px 0 14px; }
.shop-logo { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.shop-name { font-family: 'Pacifico', cursive; font-size: 30px; line-height: 1.15; color: var(--text-color); }
.shop-tagline { font-size: 14px; color: var(--hint-color); margin-top: 2px; line-height: 1.35; }

.shop-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.perk { background: rgba(90, 58, 34, 0.08); border-radius: 14px; padding: 10px 6px; text-align: center;
        font-size: 12px; line-height: 1.3; font-weight: 600; color: var(--text-color); }
.perk-icon { display: block; font-size: 22px; margin-bottom: 4px; }

.section-title { font-size: 20px; font-weight: 700; margin: 0 0 12px; color: var(--text-color); }

/* --- Открытые цены --- */
.open-card { margin-top: 22px; padding: 16px 18px; border-radius: 16px; background: var(--green-soft); }
.open-title { font-size: 17px; font-weight: 700; color: var(--text-color); margin-bottom: 6px; }
.open-text { font-size: 14px; line-height: 1.45; color: var(--text-color); opacity: 0.85; }
.open-text + .open-text { margin-top: 8px; }
.open-price { font-size: 12px; color: var(--hint-color); margin-top: 3px; }

/* --- Итог в корзине --- */
.cart-summary { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: rgba(90, 58, 34, 0.06); }
.sum-row { display: flex; justify-content: space-between; font-size: 15px; padding: 3px 0; color: var(--text-color); }
.sum-total { font-size: 18px; font-weight: 700; margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(90, 58, 34, 0.2); }
.sum-hint { font-size: 13px; color: var(--green); margin: 4px 0; }

/* --- "Не нашли нужное?" под товарами --- */
.ask-card { margin-top: 22px; padding: 18px; border-radius: 16px; border: 1.5px dashed rgba(90, 58, 34, 0.35); text-align: center; }
.ask-title { font-size: 17px; font-weight: 700; color: var(--text-color); margin-bottom: 6px; }
.ask-text { font-size: 14px; line-height: 1.45; color: var(--hint-color); margin-bottom: 14px; }
.ask-btn { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); padding: 10px 20px;
           border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; }

/* --- Карточки продуктов --- */
.products-container { display: grid; grid-template-columns: 1fr; gap: 20px; }
.product-card { background: var(--card-bg); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid rgba(90, 58, 34, 0.1); transition: transform 0.2s ease; }
.product-card:active { transform: scale(0.98); }
.product-image { width: 100%; height: 200px; background-color: rgba(90, 58, 34, 0.1); object-fit: cover; display: block; }
.product-info { padding: 15px; }
.product-title { font-size: 18px; font-weight: 700; margin-bottom: 5px; color: var(--text-color); }
.product-desc { font-size: 13px; color: var(--hint-color); margin-bottom: 15px; line-height: 1.4; }
.price-unit { font-size: 13px; font-weight: 500; color: var(--hint-color); }
.product-bottom { display: flex; justify-content: space-between; align-items: center; }
.price-text { font-size: 16px; font-weight: 700; color: var(--text-color); }
.add-btn { background-color: var(--accent); color: #ffffff; border: none; padding: 10px 20px; border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer; }

/* --- Счетчик --- */
.counter-control { display: flex; align-items: center; background: rgba(90, 58, 34, 0.1); border-radius: 12px; padding: 4px; }
.calc-btn { background: var(--card-bg); border: none; width: 32px; height: 32px; border-radius: 8px; font-size: 1.2em; font-weight: bold; color: var(--text-color); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.weight-text { font-weight: bold; margin: 0 12px; min-width: 20px; text-align: center; color: var(--text-color); }

/* ========================================= */
/* ПЛАВАЮЩЕЕ НИЖНЕЕ МЕНЮ */
/* ========================================= */
.bottom-tab-bar {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 400px; background: rgba(255, 251, 244, 0.94);
    backdrop-filter: blur(12px); border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); display: flex;
    justify-content: space-around; padding: 12px 10px; z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
body.drawer-open .bottom-tab-bar { transform: translate(-50%, 150px); opacity: 0; pointer-events: none; }
body.keyboard-open .bottom-tab-bar { transform: translate(-50%, 150px); opacity: 0; pointer-events: none; }

.tab-btn { background: none; border: none; color: var(--hint-color); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; width: 33%; transition: 0.2s; }
.tab-icon { font-size: 24px; filter: grayscale(100%); opacity: 0.6; transition: 0.2s; }
.tab-text { font-size: 11px; font-weight: 500; }
.tab-btn.active { color: var(--accent); }
.tab-btn.active .tab-icon { filter: grayscale(0%); opacity: 1; transform: scale(1.1); }

/* ========================================= */
/* УНИВЕРСАЛЬНЫЕ ШТОРКИ (ДЛЯ ВСЕХ 3 ОКОН) */
/* ========================================= */
.drawer {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--bg-color); border-radius: 20px 20px 0 0;
    padding: 20px 20px 30px 20px; box-sizing: border-box;
    z-index: 3000; transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
    max-height: 80vh; overflow-y: auto;
}
.drawer.open { transform: translateY(0); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(90, 58, 34, 0.1); padding-bottom: 10px; margin-bottom: 15px; }
.close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-color); }

/* --- Затемнение фона --- */
#drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 2500;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#drawer-overlay.show { opacity: 1; pointer-events: all; }