/**
 * Smart Culinary Ecosystem - Main Stylesheet
 * 
 * Theme Name: Smart Culinary
 * Description: Профессиональная тема для кулинарных экосистем.
 * Version: 7.7.1
 * 
 * TABLE OF CONTENTS:
 * 1. Variables & Reset
 * 2. Typography
 * 3. Layout & Containers
 * 4. Components (Buttons, Forms, Badges)
 * 5. Header & Navigation (Live Search)
 * 6. Footer & PWA App Bar (NEW GRID LAYOUT)
 * 7. Recipe Grid & Cards (Compact Styles)
 * 8. Utilities
 * 9. User System Elements
 * 10. Reviews & Ratings
 * 11. Widgets
 * 12. AJAX Comments
 * 13. HOMEPAGE SECTIONS (Builder)
 * 14. HOMEPAGE LAYOUT (Journal Style)
 * 15. HOMEPAGE CATEGORIES (New Visuals)
 * 16. TAXONOMY HUB STYLES (Shelves Wrap Update)
 * 17. GLOBAL DIALOGS (Custom Alerts/Prompts)
 * 18. NUTRITION & HEALTH (Nutri-Score, Allergens)
 * 19. KITCHEN DOCK (Global Tool Bar)
 */

/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
    /* Цветовая палитра */
    --color-primary: #10B981;       /* Sage Green */
    --color-primary-dark: #059669;  /* Darker Sage */
    --color-secondary: #F97316;     /* Carrot Orange (Акценты) */
    --color-text-main: #1E293B;     /* Slate 800 */
    --color-text-muted: #64748B;    /* Slate 500 */
    --color-bg-body: #FAFAF9;       /* Warm White / Milk */
    --color-bg-surface: #FFFFFF;    /* Pure White */
    --color-border: #E2E8F0;        /* Slate 200 */
    
    /* Типографика */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-family-heading: 'Manrope', var(--font-family-base);
    
    /* Размеры и отступы */
    --container-width: 1200px;
    --header-height: 70px;
    --bottom-nav-height: 65px; /* Чуть увеличили для удобства */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Анимации */
    --transition-base: all 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-main);
    background-color: var(--color-bg-body);
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--bottom-nav-height) + 20px); 
}

/* Сброс ссылок */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   2. Typography
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--color-text-main);
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* =========================================
   3. Layout & Containers
   ========================================= */
.sce-container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Прячем пустые контейнеры (фикс для CTA) */
.sce-container:empty {
    display: none;
    padding: 0;
    margin: 0;
}

.site-main {
    margin-top: 0px;
    min-height: 60vh;
}

/* --- Adaptive Sidebar Layout (ARCHIVE) --- */
.sce-archive-layout {
    display: grid;
    gap: 40px;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .sce-archive-layout.has-sidebar {
        grid-template-columns: 280px 1fr; 
        align-items: start;
    }
    .sce-archive-layout.no-sidebar {
        grid-template-columns: 1fr;
    }
    .sce-archive-sidebar {
        position: sticky;
        top: 90px;
        align-self: start;
    }
}

@media (min-width: 992px) and (max-width: 1200px) {
    .sce-archive-layout.has-sidebar .sce-recipe-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hero Section (ОБНОВЛЕННЫЙ ДИЗАЙН) */
.sce-hero-section {
    background: var(--color-bg-surface);
    padding: 80px 0 60px; /* Больше воздуха */
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    position: relative;
    /* FIX: Изменено с hidden на visible, чтобы выпадающий список поиска не обрезался */
    overflow: visible; 
}

.sce-hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.sce-hero-section h1 {
    font-size: 3rem; /* Крупнее */
    margin-bottom: 15px;
    letter-spacing: -0.03em;
    color: var(--color-text-main);
}

.sce-hero-section .highlight {
    color: var(--color-primary);
    position: relative;
    display: inline-block;
    white-space: nowrap;
}

.sce-hero-section .highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 12px;
    background-color: rgba(16, 185, 129, 0.15);
    z-index: -1;
    transform: rotate(-1deg);
    border-radius: 4px;
}

.sce-hero-section .page-description {
    color: var(--color-text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 35px;
    line-height: 1.6;
}

/* Hero Search (ОБНОВЛЕННЫЙ) */
.hero-search-wrapper .sce-search-form {
    background: #fff;
    padding: 6px;
    border-radius: 50px; /* Полное скругление */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    max-width: 600px;
    margin: 0 auto;
    /* FIX: Обеспечиваем контекст наложения для выпадающего списка */
    position: relative; 
    z-index: 100;
}

.hero-search-wrapper .sce-search-form:focus-within {
    box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.15), 0 8px 10px -6px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.3);
}

.hero-search-wrapper input.search-field {
    border: none !important;
    box-shadow: none !important;
    background: transparent;
    font-size: 1.05rem;
    padding-left: 20px;
    color: var(--color-text-main);
}

.hero-search-wrapper button.search-submit {
    border-radius: 50px;
    padding: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.hero-search-wrapper button.search-submit:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

/* Hero Tags (ОБНОВЛЕННЫЕ) */
.hero-tags { 
    margin-top: 25px; 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    flex-wrap: wrap; 
}

.hero-tag { 
    background: #fff; 
    color: var(--color-text-muted); 
    padding: 8px 16px; 
    border-radius: 30px; /* Pill shape */
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 600; 
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.hero-tag:hover { 
    background: #ECFDF5; /* Light Green */
    color: var(--color-primary-dark); 
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.15);
}

.hero-tag.more-tag {
    background: transparent;
    border-style: dashed;
}

.hero-tag.more-tag:hover {
    background: #F8FAFC;
    color: var(--color-primary);
    border-color: var(--color-primary);
    border-style: solid;
}

/* =========================================
   4. Components
   ========================================= */
.button, button, input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
    text-decoration: none;
    line-height: 1.2;
    gap: 8px;
}

.button:hover, button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.button:disabled, button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button.button-secondary {
    background-color: white;
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
}

.button.button-secondary:hover {
    background-color: #F8FAFC;
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.button.button-small { padding: 6px 12px; font-size: 0.85rem; }
.button.button-large { padding: 14px 28px; font-size: 1.1rem; }
.button.button-outline { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.button.button-outline:hover { background: var(--color-primary); color: white; }

/* Forms */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    font-size: 1rem;
    color: var(--color-text-main);
    transition: var(--transition-base);
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-text-main);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.badge.green { color: var(--color-primary); }
.badge.orange { color: var(--color-secondary); }

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}
.verified-badge .dashicons { font-size: 14px; width: 14px; height: 14px; }

/* =========================================
   5. Header & Navigation
   ========================================= */
.site-header {
    background-color: var(--color-bg-surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }

/* Брендинг (Логотип) - Обновлено v6.0.0 */
.site-branding .site-title { 
    margin: 0; 
    font-size: 1.4rem; 
    font-weight: 800; 
    line-height: 1; 
    letter-spacing: -0.03em; 
}
/* Сброс для <p> тега в заголовке */
p.site-title { margin: 0; }

.site-branding .site-title a { 
    color: var(--color-text-main); 
    text-decoration: none; 
    display: inline-flex; 
    align-items: center; 
}

.site-branding .site-title a:hover { 
    color: var(--color-primary); 
}

/* Суффикс бренда (SCE) */
.branding-suffix {
    color: var(--color-primary);
    font-weight: 300;
    margin-left: 4px;
}

.site-description { display: none; }
.main-navigation .menu-toggle { display: none; background: transparent; color: var(--color-text-main); padding: 0; font-size: 24px; }
.sce-main-menu { display: none; list-style: none; margin: 0; padding: 0; gap: 30px; }

@media (min-width: 992px) {
    .sce-main-menu { display: flex; }
    .sce-main-menu a { color: var(--color-text-main); font-weight: 600; font-size: 0.95rem; position: relative; }
    .sce-main-menu a:hover { color: var(--color-primary); }
    .sce-main-menu a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background-color: var(--color-primary); transition: width 0.3s ease; }
    .sce-main-menu a:hover::after { width: 100%; }
    .main-navigation .menu-toggle { display: none; }
    body { padding-bottom: 0; }
}

/* LIVE SEARCH (Dropdown Styles) */
/* FIX: Увеличен z-index, чтобы перекрывать контент ниже */
.sce-live-search-results { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    width: 100%; 
    background: #fff; 
    border: 1px solid var(--color-border); 
    border-radius: 0 0 8px 8px; 
    box-shadow: var(--shadow-lg); 
    z-index: 99999; /* High Z-Index for visibility */
    max-height: 400px; 
    overflow-y: auto; 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    display: none; 
}

.sce-live-search-item { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid #F1F5F9; cursor: pointer; transition: background 0.2s; align-items: center; }
.sce-live-search-item:last-child { border-bottom: none; }
.sce-live-search-item:hover { background: #F8FAFC; }
.sce-live-search-thumb { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: #E2E8F0; }
.sce-live-search-info { flex-grow: 1; min-width: 0; text-align: left; }
.sce-live-search-title { font-weight: 600; font-size: 0.95rem; color: var(--color-text-main); margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sce-live-search-meta { font-size: 0.75rem; color: var(--color-text-muted); display: flex; align-items: center; gap: 10px; }
.sce-live-search-rating { color: #F59E0B; display: flex; align-items: center; gap: 3px; font-weight: 600; }

/* =========================================
   5.1. Secondary Navigation (Course Bar) - UPDATED
   ========================================= */
.sce-course-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    padding: 10px 0;
    position: sticky; /* Липкое меню под хедером */
    top: var(--header-height);
    z-index: 95;
    display: block;
    box-shadow: 0 4px 6px -4px rgba(0,0,0,0.05);
}

/* 
 * Контейнер для fade-эффекта и отступов.
 * Убраны отрицательные отступы для desktop, чтобы не ломать центровку.
 */
.sce-course-bar-inner {
    position: relative;
}

/* Fade эффект по краям (для мобильных) */
.sce-course-bar-inner::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 30px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    z-index: 2;
}

/* Контейнер списка */
.sce-course-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 5px 20px 10px;
    align-items: center;
    
    /* ЦЕНТРОВКА ДЛЯ ДЕСКТОПА */
    width: fit-content;    /* Сжимаем контейнер до содержимого */
    max-width: 100%;       /* Но не шире экрана */
    margin: 0 auto;        /* Центруем блок в родителе */
    
    /* ВАЖНО: Скроллбар всегда виден на мобильных (тонкий), чтобы юзер видел прокрутку */
    scrollbar-width: thin; 
    scrollbar-color: #CBD5E1 transparent;
    cursor: grab; /* Показываем руку для свайпа */
    scroll-behavior: smooth; /* Плавный скролл при клике */
    -webkit-overflow-scrolling: touch;
}

.sce-course-list:active {
    cursor: grabbing;
}

/* Стили скроллбара (Webkit - Chrome, Safari, Android) */
.sce-course-list::-webkit-scrollbar {
    display: block;
    height: 4px;
}

.sce-course-list::-webkit-scrollbar-track {
    background: transparent;
}

.sce-course-list::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 4px;
}

.sce-course-list::-webkit-scrollbar-thumb:hover {
    background-color: #94A3B8;
}

/* Mobile optimizations: Full bleed + Padding */
@media (max-width: 768px) {
    .sce-course-bar-inner {
        /* Отрицательные отступы, чтобы фон и скролл были на всю ширину экрана */
        margin: 0 0px; 
        padding: 0;
    }
    .sce-course-list {
        width: 100%; 
        /* 
           ВАЖНО: padding-left/right: 20px; создает видимый отступ первого элемента от края экрана, 
           но позволяет скроллить контент до самого края (благодаря overflow).
           Это создает эффект "пустоты" слева и справа в начальном положении.
        */
        padding: 5px 20px 10px; 
    }
}

/* Элемент навигации (Капсула / Chip) */
.course-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px 4px 4px; /* Меньше слева для картинки */
    background: #F1F5F9;
    color: var(--color-text-main);
    border-radius: 30px; /* Полный овал */
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    flex-shrink: 0;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    user-select: none;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Состояние наведения */
.course-pill:hover {
    background: #fff;
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(16, 185, 129, 0.15);
}

/* ВАЖНО: Активный элемент выделяется так же, как обычный при наведении, но сильнее */
.course-pill.current {
    background: #ECFDF5; /* Light Green */
    color: var(--color-primary-dark);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary); /* Акцент */
}

/* Миниатюра (Кружок) */
.pill-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #E2E8F0;
}

.pill-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pill-thumb .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #94A3B8;
}

.course-pill.current .pill-thumb {
    border-color: #6EE7B7;
}

.course-pill:hover .pill-thumb .dashicons {
    color: var(--color-primary);
}

/* Иконка-only для кнопок "Назад" */
.pill-thumb.icon-only {
    background: transparent;
    border: none;
}
.pill-thumb.icon-only .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: inherit; /* Наследует цвет текста */
}

/* Индикатор подкатегорий (Стрелочка) */
.pill-indicator {
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -2px; /* Чуть ближе к тексту */
    transition: background 0.2s;
}

.pill-indicator .dashicons {
    font-size: 10px;
    width: 10px;
    height: 10px;
    color: #64748B;
}

.course-pill:hover .pill-indicator {
    background: var(--color-primary);
}
.course-pill:hover .pill-indicator .dashicons {
    color: white;
}

/* Кнопка "Назад" (унифицированный стиль для хлебных крошек) */
.course-pill.back-pill {
    background: #fff;
    border-color: #CBD5E1;
    color: var(--color-text-muted);
    /* Отступ слева немного больше, так как там просто иконка без кружка */
    padding-left: 6px; 
    padding-right: 16px;
}

.course-pill.back-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: #fff;
}

/* =========================================
   6. Footer & PWA App Bar (NEW GRID LAYOUT)
   ========================================= */
.site-footer { 
    background-color: var(--color-text-main); /* Dark Slate */
    color: #94A3B8; 
    padding: 60px 0 30px; 
    margin-top: 60px; 
    font-size: 0.9rem; 
}

/* Grid Layout for Footer Columns */
.footer-grid-layout {
    display: grid;
    gap: 40px;
    margin-bottom: 40px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .footer-grid-layout {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .footer-grid-layout {
        grid-template-columns: 1.5fr 1fr 1fr 1.5fr; /* 4 колонки: Бренд, Меню, Хабы, Виджеты */
    }
}

/* Заголовки колонок */
.footer-heading {
    font-size: 1.1rem;
    color: #fff; 
    margin-bottom: 20px;
    font-weight: 700;
}

/* Колонка бренда */
.footer-branding .site-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    line-height: 1;
    color: #fff;
}
.footer-branding .site-description {
    color: #94A3B8;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Социальные иконки */
.footer-socials {
    display: flex;
    gap: 10px;
}
.social-link {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CBD5E1;
    transition: all 0.2s;
    text-decoration: none;
}
.social-link:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}
.social-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Списки ссылок (Меню и Хабы) */
.footer-navigation ul,
.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-navigation a,
.footer-links-list a {
    color: #94A3B8;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
    display: inline-block;
}

.footer-navigation a:hover,
.footer-links-list a:hover {
    color: var(--color-primary);
    transform: translateX(5px);
}

/* Виджеты в футере */
.footer-widget .widget-title {
    color: #E2E8F0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-widget {
    background: transparent;
    box-shadow: none;
    padding: 0;
    border: none;
    margin-bottom: 20px;
}
.footer-widget ul li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.footer-widget ul li a {
    color: #CBD5E1;
}

/* Нижняя строка */
.site-info { 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 25px; 
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

@media (min-width: 768px) {
    .site-info { flex-direction: row; justify-content: space-between; }
}

/* Styles for Mobile Bottom Nav */
.sce-mobile-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: var(--bottom-nav-height); 
    background: var(--color-bg-surface); 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05); 
    display: flex; 
    justify-content: space-around; 
    align-items: flex-end; /* Align items to bottom for central button pop */
    z-index: 1000; 
    padding-bottom: env(safe-area-inset-bottom); 
    /* Height includes safe area */
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); 
    border-top: 1px solid var(--color-border); 
}

.mobile-nav-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-end; /* Align content to bottom */
    color: var(--color-text-muted); 
    font-size: 10px; 
    font-weight: 500; 
    padding: 8px 0; 
    flex: 1; 
    background: transparent; 
    border: none; 
    text-decoration: none; 
    height: 100%; 
}

.mobile-nav-item .dashicons { 
    font-size: 22px; 
    width: 22px; 
    height: 22px; 
    margin-bottom: 4px; 
    transition: transform 0.2s; 
}

.mobile-nav-item.active { 
    color: var(--color-primary); 
}

.mobile-nav-item.active .dashicons { 
    transform: translateY(-2px); 
}

.mobile-nav-item:hover { 
    background: transparent; 
    color: var(--color-primary-dark); 
}

/* CENTRAL BUTTON STYLES (Overrides) */
.mobile-nav-item.center-item {
    overflow: visible; /* Allow button to pop out */
}

/* The circle button itself */
.tools-btn-circle {
    background: var(--color-primary);
    color: white;
    width: 44px; /* Larger */
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
    
    /* Positioning */
    margin-top: -20px; /* Pull up */
    margin-bottom: 4px;
    
    /* Visual separation */
    border: 4px solid var(--color-bg-surface); /* Cutout effect */
    
    transition: transform 0.2s;
    min-width: 44px;
    flex-shrink: 0;
    position: relative;
}

#mobile-dock-trigger.active .tools-btn-circle {
    background: var(--color-primary-dark);
}

#mobile-dock-trigger:hover .tools-btn-circle {
    transform: translateY(-2px);
}

/* Fix text alignment */
.mobile-nav-item .label {
    line-height: 1;
}

@media (min-width: 768px) {
    .sce-mobile-nav { display: none; }
}

/* =========================================
   7. Recipe Grid & Cards
   ========================================= */
.sce-recipe-grid { display: grid; grid-template-columns: 1fr; gap: 30px; margin-bottom: 40px; }
@media (min-width: 600px) { .sce-recipe-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .sce-recipe-grid { grid-template-columns: repeat(3, 1fr); } }

.recipe-card {
    background: var(--color-bg-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--color-border);
    position: relative;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(16, 185, 129, 0.2);
}

/* --- COMPACT CARD STYLES --- */
.recipe-card.compact-card {
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recipe-card.compact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.compact-thumbnail {
    position: relative;
    padding-top: 65%; /* Aspect Ratio */
    overflow: hidden;
    background: #f1f5f9;
}

.compact-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.recipe-card.compact-card:hover .compact-thumbnail img {
    transform: scale(1.05);
}

/* Оверлей на картинке */
.compact-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    padding: 20px 12px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

.overlay-item {
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.overlay-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Верхние бейджи */
.top-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    z-index: 2;
}

.badge-occasion {
    background: rgba(255, 255, 255, 0.95);
    color: #1D4ED8;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    backdrop-filter: blur(2px);
}

/* Кнопка лайка */
.compact-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 32px;
    height: 39px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(2px);
    transition: all 0.2s;
    z-index: 5;
}

.compact-fav-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.compact-fav-btn.active .dashicons {
    color: #EF4444;
}

.compact-fav-btn .dashicons {
    color: #94A3B8;
    font-size: 18px;
}

/* Контент */
.compact-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.compact-courses {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748B;
    margin-bottom: 6px;
    font-weight: 700;
    line-height: 1.3;
}

.compact-courses a {
    color: #64748B;
    text-decoration: none;
}

.compact-courses a:hover {
    color: var(--color-primary);
}

.compact-title {
    font-size: 1.05rem;
    margin: 0 0 10px;
    line-height: 1.35;
    font-weight: 700;
    flex-grow: 1;
}

.compact-title a {
    color: #1E293B;
    text-decoration: none;
}

.compact-title a:hover {
    color: var(--color-primary);
}

/* НОВЫЕ СТИЛИ ДЛЯ ОТЗЫВОВ И ОПИСАНИЯ */
.recipe-card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-comments {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Футер карточки */
.compact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F1F5F9;
    padding-top: 10px;
    margin-top: auto;
    font-size: 0.85rem;
}

.compact-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #F59E0B;
    font-weight: 700;
}

.compact-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748B;
    text-decoration: none;
    font-weight: 500;
}

.compact-author img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.compact-author:hover {
    color: #1E293B;
}

/* Цвета для сложности */
.diff-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; }
.diff-easy { background: #10B981; }
.diff-medium { background: #F59E0B; }
.diff-hard { background: #EF4444; }

/* Старые стили для обратной совместимости */
.recipe-thumbnail {
    position: relative;
    padding-top: 60%; /* Aspect ratio 5:3 */
    overflow: hidden;
    background-color: #E2E8F0;
}

/* =========================================
   8. Utilities (Пагинация)
   ========================================= */
.sce-pagination-wrapper { text-align: center; margin-top: 50px; }
.sce-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 5px; border-radius: 50%; background: white; color: var(--color-text-main); font-weight: 600; box-shadow: var(--shadow-sm); text-decoration: none; border: 1px solid var(--color-border); transition: var(--transition-base); }
.sce-pagination .page-numbers.current, .sce-pagination .page-numbers:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sce-pagination .next, .sce-pagination .prev { width: auto; padding: 0 20px; border-radius: 22px; }

/* =========================================
   9. User System Elements
   ========================================= */
.header-actions { display: flex; align-items: center; gap: 15px; }
.header-profile-link { display: block; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--color-border); transition: border-color 0.3s ease; }
.header-profile-link:hover { border-color: var(--color-primary); }
.header-profile-link img { width: 100%; height: 100%; object-fit: cover; }
.match-badge { position: absolute; top: 10px; right: 10px; background: var(--color-primary); color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; z-index: 5; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

/* =========================================
   10. Reviews & Ratings
   ========================================= */
.sce-rating-input-wrapper { margin: 20px 0; background: #F8FAFC; padding: 20px; border-radius: 12px; display: inline-block; border: 1px solid var(--color-border); width: 100%; max-width: 400px; }
.sce-star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 8px; }
.sce-star-rating input[type="radio"] { display: none; }
.sce-star-rating label { cursor: pointer; color: #CBD5E1; transition: color 0.2s ease, transform 0.1s; margin: 0; padding: 0; line-height: 1; }
.sce-star-rating label .dashicons { font-size: 32px; width: 32px; height: 32px; vertical-align: middle; }
.sce-star-rating label:hover, .sce-star-rating label:hover ~ label, .sce-star-rating input:checked ~ label { color: #F59E0B; }
.sce-star-rating label:hover, .sce-star-rating label:hover ~ label { color: #FBBF24; transform: scale(1.1); }

/* NEW: Styles for ratings in comment header */
.sce-rating-badge {
    color: #F59E0B;
    display: flex;
    align-items: center;
    gap: 2px;
    background: #FFFBEB;
    padding: 2px 6px;
    border-radius: 12px;
    border: 1px solid #FCD34D;
}
.sce-rating-badge .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Reset button for rating form */
#sce-clear-rating {
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
#sce-clear-rating:hover {
    color: #DC2626 !important;
    text-decoration: underline;
}

.sce-user-rating { display: flex; gap: 2px; margin-bottom: 8px; align-items: center; }
.sce-user-rating .dashicons { color: #F59E0B; }
.sce-user-rating .dashicons-star-empty { color: #E2E8F0; }
.sce-fav-btn.active, .sce-fav-btn-card.active { color: #EF4444 !important; }
.sce-fav-btn.active .dashicons, .sce-fav-btn-card.active .dashicons { color: #EF4444 !important; }
.sce-fav-btn:active, .sce-fav-btn-card:active { transform: scale(0.9); }

/* =========================================
   11. Widgets (Global)
   ========================================= */
.widget { margin-bottom: 40px; padding: 25px; background: var(--color-bg-surface); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); }
.widget-title { font-size: 1.25rem; margin-top: 0; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid #F1F5F9; color: var(--color-text-main); }
.sce-widget-list { list-style: none; margin: 0; padding: 0; }
.sce-widget-item { display: flex; gap: 15px; margin-bottom: 20px; align-items: flex-start; }
.sce-widget-item:last-child { margin-bottom: 0; }
.sce-widget-thumb { flex-shrink: 0; width: 70px; height: 70px; border-radius: 8px; overflow: hidden; background-color: #F1F5F9; transition: var(--transition-base); }
.sce-widget-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.sce-widget-item:hover .sce-widget-thumb img { transform: scale(1.1); }
.sce-widget-content { flex-grow: 1; min-width: 0; }
.sce-widget-title { margin: 0 0 5px; font-size: 1rem; line-height: 1.3; font-weight: 600; }
.sce-widget-title a { color: var(--color-text-main); text-decoration: none; }
.sce-widget-title a:hover { color: var(--color-primary); }
.sce-widget-meta { font-size: 0.8rem; color: var(--color-text-muted); }
.sce-widget-rating { display: flex; align-items: center; color: #F59E0B; margin-bottom: 3px; font-weight: 600; }
.sce-widget-time, .sce-widget-kcal { display: flex; align-items: center; gap: 4px; color: #94A3B8; }

/* =========================================
   12. AJAX Comments
   ========================================= */
.comment-list .children { list-style: none; padding-left: 30px; margin: 0; border-left: 2px solid #F1F5F9; }
@media (max-width: 600px) { .comment-list .children { padding-left: 15px; } }
.comment-list li { margin-bottom: 20px; }
.sce-reply-notification { background-color: #F0F9FF; border-left: 4px solid #0EA5E9; padding: 12px 20px; margin-bottom: 20px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; animation: sce-fade-in 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.sce-reply-notification .reply-info { font-size: 0.95rem; color: #0369A1; display: flex; align-items: center; gap: 8px; }
.sce-reply-notification strong { font-weight: 700; color: #0C4A6E; }
.comment-list .children #respond { margin: 20px 0; padding: 20px; background: #fff; border: 2px solid #E2E8F0; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); animation: sce-slide-down 0.3s ease; }
@keyframes sce-slide-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sce-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sce-highlight-pulse { 0% { background-color: #ECFDF5; transform: scale(1.02); } 50% { background-color: #D1FAE5; transform: scale(1); } 100% { background-color: transparent; transform: scale(1); } }
.sce-new-comment-highlight { animation: sce-highlight-pulse 2s ease-out forwards; border: 1px solid #10B981; }
#sce-cancel-reply:hover { background: #FEF2F2; color: #DC2626 !important; }
#cancel-comment-reply-link { display: none !important; }

/* =========================================
   13. HOMEPAGE SECTIONS (Builder)
   ========================================= */
.sce-hero-section.has-bg-image { color: white; position: relative; padding: 100px 0; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.sce-hero-section.has-bg-image::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1; }
.sce-hero-section.has-bg-image .sce-container { position: relative; z-index: 2; }
.sce-hero-section.has-bg-image h1, .sce-hero-section.has-bg-image .page-description { color: white; }

/* --- ОБНОВЛЕННЫЕ СТИЛИ FEATURES (ПРЕИМУЩЕСТВА) --- */
.sce-features-bg { 
    background: #fff; 
    padding: 40px 0; 
    border-top: 1px solid var(--color-border); 
    border-bottom: 1px solid var(--color-border); 
    margin: 10px 0 40px 0;
}

.sce-features-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 20px; 
    text-align: center; 
}

.feature-box {
    background: #F8FAFC;
    padding: 25px 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid #F1F5F9;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.2);
    background: #fff;
    border-color: var(--color-primary);
}

.feature-box .feature-icon { 
    width: 56px; 
    height: 56px; 
    background: #ECFDF5; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 15px; 
    color: var(--color-primary); 
    font-size: 24px;
}

.feature-box h4 { 
    margin: 0 0 8px; 
    font-size: 1rem; 
    font-weight: 700; 
    color: var(--color-text-main);
}

.feature-box p { 
    font-size: 0.85rem; 
    color: var(--color-text-muted); 
    line-height: 1.5; 
    margin: 0;
}

/* --- СЕКЦИЯ CTA --- */
.sce-cta-section { background: var(--color-text-main); color: white; padding: 30px 0; text-align: center; margin: 0px 0 20px 0;}
.cta-inner h2 { color: white; font-size: 2rem; margin-bottom: 20px; }
.sce-home-section { padding: 10px 0; }
.sce-home-section:first-child { padding-top: 0; }
.sce-home-section:last-child { padding-bottom: 30px; }
.section-hero { padding: 0; margin-bottom: 40px; }

/* --- HERO HEADER TAGS & SEARCH FIX --- */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;  margin-top: 30px;}
.section-heading { font-size: 1.8rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-link { font-weight: 600; font-size: 0.95rem; }
.sidebar-widget .news-thumb-placeholder { background-color: #f0f0f1; border-radius: 4px; }

/* =========================================
   14. HOMEPAGE LAYOUT (Journal Style)
   ========================================= */

.sce-home-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 992px) {
    .sce-home-layout {
        grid-template-columns: 1fr 320px; /* Main content + Sidebar */
        align-items: start;
    }

    .sce-home-main .sce-recipe-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sce-home-sidebar {
        position: sticky;
        top: 90px;
        display: flex;
        flex-direction: column;
        gap: 30px;
    }
}

/* Override Recipe Card styles for sidebar (Recipe of Day) */
.sce-home-sidebar .recipe-card {
    box-shadow: var(--shadow-md);
}

.sce-home-sidebar .recipe-title {
    font-size: 1.1rem; /* Чуть меньше заголовок */
}

.sce-home-sidebar .recipe-card-excerpt {
    display: none; /* Скрываем текст, чтобы было компактнее */
}

/* =========================================
   15. HOMEPAGE CATEGORIES (New Visuals - UPDATED v6.0.1)
   ========================================= */
.sce-categories-grid.new-design {
    display: grid;
    /* Desktop: 6 колонок равномерно */
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

/* Tablet (до 992px) - 3x2 */
@media (max-width: 992px) {
    .sce-categories-grid.new-design {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile (до 600px) - 2x3 */
@media (max-width: 600px) {
    .sce-categories-grid.new-design {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .sce-home-section { padding: 10px 0; }
}

.category-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 140px; /* Увеличена высота */
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #f1f5f9; /* Фоновый цвет при загрузке */
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.category-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    z-index: 1;
}

.category-card:hover .category-card-image {
    transform: scale(1.1); /* Эффект зума */
}

.category-card-image .dashicons {
    /* Если иконка используется как заглушка */
    font-size: 40px;
    color: var(--color-primary);
    opacity: 0.5;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Градиент для читаемости текста */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 30%, rgba(0,0,0,0) 100%);
    z-index: 2;
}

.category-card-name {
    position: relative;
    z-index: 3;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    width: 100%;
    padding: 15px 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1.3;
}

/* =========================================
   16. TAXONOMY HUB STYLES (Shelves Wrap Update)
   ========================================= */

/* Контейнер поиска в хабе */
.sce-term-search-container {
    max-width: 500px;
    margin: 0 auto 30px;
    position: relative;
}

.sce-term-search-container input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border-radius: 25px;
    border: 1px solid var(--color-border);
    font-size: 1rem;
    background: #fff;
    transition: all 0.2s;
}

.sce-term-search-container input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    outline: none;
}

.sce-term-search-container .dashicons {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
}

/* --- A-Z List Style (Ingredient, Tag, Taste, Occasion) --- */
.sce-az-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sce-term-group {
    margin-bottom: 20px;
}

.sce-term-group-title {
    font-size: 1.2rem;
    color: var(--color-text-main);
    border-bottom: 2px solid #F1F5F9;
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sce-term-group-title span.count {
    font-size: 0.8rem;
    color: #94A3B8;
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sce-az-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.az-item {
    background: #fff;
    border: 1px solid #E2E8F0;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.az-item:hover {
    background: #F1F5F9;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.az-item .count {
    color: #94A3B8;
    font-size: 0.8em;
    margin-left: 5px;
}

/* --- Cuisine Style (Travel Grid) --- */
.sce-cuisine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    text-align: center;
}

.cuisine-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s;
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.cuisine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--color-primary);
}

.cuisine-thumb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
    border: 4px solid #F1F5F9;
    transition: border-color 0.2s;
}

.cuisine-card:hover .cuisine-thumb {
    border-color: var(--color-primary);
}

.cuisine-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cuisine-name {
    font-weight: 700;
    color: var(--color-text-main);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cuisine-count {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* --- Taste/Cloud Style (Minimal Cloud) --- */
.sce-taste-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.taste-pill {
    background: #fff;
    border: 1px solid #E2E8F0;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.taste-pill:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.taste-pill .count {
    background: rgba(0,0,0,0.1);
    color: inherit;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* --- Hierarchy Shelf Style (Recipe Type) --- */
/* Наследует стили из course-nav.php (sce-course-bar, sce-course-list) */
.sce-course-shelf {
    margin-bottom: 40px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.shelf-header {
    background: #F8FAFC;
    padding: 15px 20px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shelf-title a {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-main);
    text-decoration: none;
}
.shelf-title a:hover {
    color: var(--color-primary);
}

/* Переопределение для списка внутри полки: Многострочный режим */
.sce-course-shelf .sce-course-list {
    padding: 15px 20px;
    margin: 0; 
    width: 100%;
    max-width: 100%;
    /* Отключаем горизонтальный скролл */
    overflow-x: visible; 
    white-space: normal;
    /* Включаем перенос */
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    height: auto; /* Снимаем ограничение высоты если есть */
}

/* Убираем лишние тени внутри полки */
.sce-course-shelf .course-pill {
    background: #fff;
    border: 1px solid #E2E8F0;
    margin-bottom: 5px; /* Небольшой отступ снизу на случай тесного враппинга */
}
.sce-course-shelf .course-pill:hover {
    border-color: var(--color-primary);
    background: #ECFDF5;
}

/* =========================================
   16.1 SHELF HIERARCHY (Иерархия внутри полок)
   ========================================= */
.sce-shelf-subgroup {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid #E2E8F0; /* Визуальная линия вложенности */
}

.sce-shelf-subgroup:last-child {
    margin-bottom: 0;
}

.sce-shelf-subgroup-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sce-shelf-subgroup-title .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #CBD5E1;
}

.sce-shelf-direct-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-bottom: 15px;
}

.sce-shelf-direct-items:last-child {
    margin-bottom: 0;
}

/* =========================================
   17. GLOBAL DIALOGS (Custom Alerts/Prompts)
   ========================================= */

.sce-global-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.sce-global-modal.active {
    display: flex;
    animation: sce-fade-in 0.2s ease;
}

.sce-dialog-box {
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: sce-scale-up 0.2s ease;
    border: 1px solid var(--color-border);
}

.sce-dialog-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--color-border);
    background: #F8FAFC;
    font-weight: 700;
    color: var(--color-text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sce-dialog-body {
    padding: 25px;
    color: var(--color-text-main);
    font-size: 1rem;
}

.sce-dialog-input {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}
.sce-dialog-input:focus {
    border-color: var(--color-primary);
}

.sce-dialog-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--color-border);
    text-align: right;
    background: #fff;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =========================================
   18. NUTRITION & HEALTH (Nutri-Score, Allergens)
   ========================================= */
.sce-nutri-score {
    display: inline-flex;
    align-items: center;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    padding: 2px;
    background: #fff;
    gap: 1px;
}
.ns-grade {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #94A3B8;
    background: #F1F5F9;
    border-radius: 2px;
    text-transform: uppercase;
}
.ns-grade.active {
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 1;
}
/* Colors */
.ns-grade.grade-a.active { background-color: #038d4c; }
.ns-grade.grade-b.active { background-color: #83c242; }
.ns-grade.grade-c.active { background-color: #fee101; color: #333; }
.ns-grade.grade-d.active { background-color: #f58d24; }
.ns-grade.grade-e.active { background-color: #ee2c2e; }

/* Compact Badge (for cards) */
.sce-nutri-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

/* Allergen Block */
.sce-allergen-alert {
    margin-top: 15px;
    padding: 12px;
    background: #FFF5F5;
    border: 1px solid #FED7D7;
    border-radius: 8px;
    font-size: 0.9rem;
}
.allergen-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #C53030;
    margin-bottom: 5px;
}
.allergen-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.allergen-tag {
    background: #fff;
    color: #C53030;
    border: 1px solid #FEB2B2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* =========================================
   19. KITCHEN DOCK (Global Tool Bar)
   ========================================= */

/* Основной контейнер */
.kitchen-dock {
    position: fixed;
    bottom: 30px; /* Чуть выше */
    right: 30px;  /* Позиция справа для десктопа */
    left: auto;   /* Сбрасываем центровку */
    transform: none;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Выравнивание элементов по правому краю */
    /* Плавный переход при сворачивании */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Свернутое состояние (FAB кнопка) --- */
.kitchen-dock.minimized {
    border-radius: 50%;
    padding: 0;
    width: 56px; /* Фикс размера контейнера под кнопку */
    height: 56px;
    overflow: visible; /* Чтобы видно было точку активности */
    background: transparent; /* Фон у самой кнопки .dock-minimized-view */
    border: none;
    box-shadow: none;
}

/* Сама кнопка внутри минимизированного контейнера */
.dock-minimized-view {
    width: 56px;
    height: 56px;
    background: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    color: white;
    position: relative;
    /* Показываем только когда док свернут */
    display: none;
}

.dock-minimized-view:hover {
    transform: scale(1.1);
    background: var(--color-primary-dark);
}

.dock-minimized-view .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

/* Индикатор активности (красная точка для таймера) */
.dock-activity-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #EF4444;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: pulse-red-dot 2s infinite;
}

@keyframes pulse-red-dot {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- Развернутое состояние (Панель) --- */
.dock-expanded-view {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 10px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column; /* Для кнопки сворачивания */
    align-items: center;
    position: relative;
    /* Анимация появления */
    animation: dock-pop-up 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dock-pop-up {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Кнопка сворачивания (стрелка вниз) */
.dock-collapse-btn {
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94A3B8;
    margin-bottom: 5px;
    transition: color 0.2s;
}
.dock-collapse-btn:hover {
    color: var(--color-primary);
}
.dock-collapse-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Контент внутри панели */
.dock-content {
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
}

/* --- Секции внутри Дока --- */
.dock-section {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text-main);
    transition: transform 0.2s;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
}

.dock-section:hover {
    background: #F8FAFC;
    transform: translateY(-2px);
}

.dock-icon-wrapper {
    width: 40px;
    height: 40px;
    background: #F1F5F9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    color: var(--color-text-muted);
    transition: all 0.2s;
}

.dock-section:hover .dock-icon-wrapper {
    background: var(--color-primary);
    color: white;
}

/* Анимация таймера */
.pulse-red {
    background: #FEE2E2;
    color: #EF4444;
    animation: pulse-red-bg 1.5s infinite;
}

@keyframes pulse-red-bg {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.dock-data {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0; /* FIX: Позволяет flex-элементу сжиматься */
    flex: 1;
}

.dock-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* FIX: Обрезка текста для длинных названий */
.dock-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 200px; /* Ограничение ширины для текста на десктопе */
}

/* Кнопка закрытия таймера (крестик) */
.dock-btn-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #94A3B8;
    padding: 5px;
    line-height: 1;
    margin-left: 5px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.dock-btn-close:hover {
    color: #EF4444;
    background: #FEE2E2;
}

/* --- Логика переключения классов --- */
/* Если .minimized -> показываем кнопку, скрываем панель */
.kitchen-dock.minimized .dock-minimized-view {
    display: flex;
}
.kitchen-dock.minimized .dock-expanded-view {
    display: none;
}

/* Если НЕ .minimized -> скрываем кнопку, показываем панель */
.kitchen-dock:not(.minimized) .dock-minimized-view {
    display: none;
}
.kitchen-dock:not(.minimized) .dock-expanded-view {
    display: flex;
}


/* --- Адаптивность (Mobile) --- */
@media (max-width: 768px) {
    .kitchen-dock {
        /* Позиционируем справа внизу, над таббаром */
        left: auto;
        right: 20px;
        bottom: calc(var(--bottom-nav-height) + 20px);
        transform: none; /* Отменяем центровку */
        align-items: flex-end; /* Прижимаем к правому краю */
    }

    /* В свернутом виде - просто FAB (НО мы скрываем его полностью через display:none для внутренней кнопки) */
    .kitchen-dock.minimized {
        width: auto; /* Авто-ширина */
        
        /* Скрываем сам контейнер, чтобы он не перекрывал клики */
        pointer-events: none;
        visibility: hidden;
        transition: visibility 0s 0.3s; /* Delay hiding until transition ends */
    }
    
    /* Скрываем плавающую кнопку на мобильных (так как есть кнопка в меню) */
    .dock-minimized-view {
        display: none !important;
    }

    /* В развернутом виде - вертикальная панель */
    .kitchen-dock:not(.minimized) {
        pointer-events: auto;
        visibility: visible;
        transition: visibility 0s 0s;
    }

    .dock-expanded-view {
        align-items: stretch; /* Растягиваем элементы */
        padding: 15px;
        width: 220px; /* Фиксированная ширина */
    }

    .dock-content {
        flex-direction: column; /* Вертикальный список */
        align-items: stretch;
        gap: 15px;
        width: 100%;
    }

    .dock-section {
        padding: 8px;
        border-radius: 8px;
        background: #F8FAFC; /* Легкий фон для разделения */
    }
    
    .dock-collapse-btn {
        margin-bottom: 10px;
        align-self: flex-end; /* Кнопка закрытия справа */
        width: auto;
    }

    .dock-val {
        max-width: 150px; /* Чуть меньше на мобильных */
    }
}