/* Базовые сбросы для мобильных */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f6fa;
    color: #2f3640;
    padding: 15px;
    line-height: 1.5;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Навигация (Navbar) */
.navbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
    color: #2f3640;
    text-align: center;
}

.navbar-links {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 10px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    text-align: center;
    font-size: 0.9rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-logout {
    background: #e74c3c;
}

.btn-success {
    background: #2ecc71;
}

/* Фильтры и табы */
.filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.filter-bar .btn-add {
    grid-column: span 2;
}

.tabs-container {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 15px;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.day-tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: none;
    background: #dcdde1;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Карточки блюд */
.dish-card {
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.dish-card h2, .dish-card h4 {
    font-size: 1.25rem;
    color: #2f3640;
    margin-bottom: 8px;
}

.dish-card p {
    font-size: 0.95rem;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.dish-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: #34495e;
}

.dish-card ul {
    list-style-position: inside;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.dish-card .price {
    font-weight: bold;
    color: #2ecc71;
    font-size: 1.05rem;
}

/* Уведомления */
.flash {
    padding: 12px;
    background: #e3fafc;
    color: #0b7285;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-align: center;
}

/* Адаптация сетки меню под смартфоны */
.mobile-menu-day {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.mobile-menu-day h3 {
    margin-bottom: 10px;
    color: #2f3640;
    border-bottom: 1px solid #f1f2f6;
    padding-bottom: 5px;
}

.meal-row {
    margin-bottom: 12px;
}

.meal-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.select-dish {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #c8d6e5;
    background: #f8f9fa;
    font-size: 1rem;
}

/* Стили для раскрывающихся блоков (аккордеонов) */
details.dish-details {
    margin-top: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    overflow: hidden;
}

details.dish-details summary {
    padding: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #34495e;
    cursor: pointer;
    list-style: none; /* Убираем стандартную стрелочку в некоторых браузерах */
    display: flex;
    justify-content: space-between;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

/* Добавляем кастомную аккуратную стрелочку справа */
details.dish-details summary::after {
    content: "▼";
    font-size: 0.7rem;
    color: #7f8c8d;
    transition: transform 0.2s ease;
}

/* Разворачиваем стрелочку при открытии */
details[open].dish-details summary::after {
    transform: rotate(180deg);
}

.details-content {
    padding: 12px;
    border-top: 1px solid #e1e8ed;
    background: white;
    font-size: 0.95rem;
}

/* Специфичный отступ для списка внутри спойлера */
.details-content ul {
    margin-bottom: 0 !important;
    padding-left: 5px;
}

/* Оформление Markdown элементов внутри рецепта */
.markdown-body h3 {
    font-size: 1.1rem;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #2c3e50;
}

.markdown-body h4 {
    font-size: 1rem;
    margin-top: 8px;
    margin-bottom: 4px;
    color: #34495e;
}

.markdown-body p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #2f3640 !important;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.markdown-body li {
    margin-bottom: 4px;
}

.markdown-body a {
    color: #3498db;
    text-decoration: underline;
}

.markdown-body strong {
    color: #000;
}

/* Специфика для десктопов (если откроют на ПК) */
@media (min-width: 480px) {
    .navbar {
        flex-direction: row;
        justify-content: space-between;
    }

    .navbar-brand {
        text-align: left;
    }

    .filter-bar {
        grid-template-columns: auto auto 1fr;
    }

    .filter-bar .btn-add {
        grid-column: auto;
        margin-left: auto;
    }
}
