/* Общие сбросы и настройки */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--tg-theme-secondary-bg-color, #f4f4f5); /* Фон приложения */
    color: var(--tg-theme-text-color, #000000); /* Цвет текста */
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Запрещаем скролл всего окна, скроллим только контент */
}

/* Контейнер для контента (занимает всё место минус нижняя панель) */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 80px 20px; /* Отступ снизу, чтобы текст не прятался за панелью */
}

/* Экраны (вкладки) */
.tab-content {
    display: none; /* Скрываем все экраны по умолчанию */
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block; /* Показываем активный */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Заголовки */
.header {
    margin-bottom: 20px;
}
.header h1 {
    font-size: 24px;
    font-weight: 700;
}
.header p {
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
    margin-top: 5px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Состояние "Пусто" */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background-color: var(--tg-theme-bg-color, #ffffff);
    border-radius: 16px;
    color: var(--tg-theme-hint-color, #999999);
}
.empty-state i {
    font-size: 40px;
    margin-bottom: 15px;
    color: var(--tg-theme-button-color, #3390ec);
    opacity: 0.5;
}

/* Поле поиска */
.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--tg-theme-bg-color, #ffffff);
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.search-bar i {
    color: var(--tg-theme-hint-color, #999999);
    margin-right: 10px;
}
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    color: var(--tg-theme-text-color, #000);
    width: 100%;
    font-size: 16px;
}

/* НИЖНЯЯ ПАНЕЛЬ НАВИГАЦИИ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: var(--tg-theme-bg-color, #ffffff);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom); /* Поддержка челки iPhone */
    z-index: 1000;
}

/* Темная тема для рамки панели */
@media (prefers-color-scheme: dark) {
    .bottom-nav { border-top: 1px solid rgba(255, 255, 255, 0.1); }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-hint-color, #999999);
    cursor: pointer;
    width: 20%;
    transition: 0.2s;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
}

/* Активная кнопка в панели */
.nav-item.active {
    color: var(--tg-theme-button-color, #3390ec);
}
/* Стили для карточек товаров в каталоге */
.product-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 10px;
}

.product-card {
    background-color: var(--tg-theme-bg-color, #ffffff);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--tg-theme-text-color, #000000);
}

.product-desc {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    line-height: 1.4;
}

.product-prices {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    margin-top: 5px;
    color: var(--tg-theme-text-color, #000000);
}

.buy-btn {
    background-color: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 10px;
}

.buy-btn:active {
    opacity: 0.8;
}