@import url('https://fonts.googleapis.com/css2?family=Merienda:wght@400;700&display=swap');

/* dish-detail.css */

/* ---------------------------------------------------- */
/* --- ГЛОБАЛЬНЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ --- */
/* ---------------------------------------------------- */

.product-page-shell {
    padding: 1.5rem;
}

/* ----------------------------------------------------
    Хедер страницы (заголовок + кнопка назад)
---------------------------------------------------- */
.crud-header-bar-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ----------------------------------------------------
    Хлебные крошки (breadcrumbs)
---------------------------------------------------- */
.breadcrumbs-container-center {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0;
    margin-bottom: 1.5rem;
}

    .breadcrumbs-container-center .breadcrumb {
        margin-bottom: 0;
        padding: 0;
        background-color: transparent;
    }

    .breadcrumbs-container-center .breadcrumb-item {
        font-size: 0.95rem;
    }


/* ---------------------------------------------------- */
/* --- СТИЛИ КАРТОЧЕК И КНОПОК (ОСНОВА) --- */
/* ---------------------------------------------------- */

.core-card {
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    background-color: #fff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    display: flex;
    flex-direction: column;
}

/* ----------- Стили для всех action-кнопок ----------- */
.action-btn,
.btn.action-btn,
.btn-outline-primary,
.btn-primary,
.btn-danger,
.btn-warning,
.btn-info,
.btn-success,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-danger,
.btn-outline-info {
    border-radius: .5rem !important;
    padding: .3rem .85rem !important;
    line-height: 1.5;
    font-weight: 500;
    font-size: 0.96rem !important;
    transition: background 0.15s, color 0.15s, border 0.15s;
    box-shadow: none !important;
    text-transform: none;
}

/* Цвета кнопок */
.action-btn-alt-inverted, .btn-outline-primary {
    background-color: transparent !important;
    border: 1px solid #ced4da !important;
    color: #5a8dee !important;
}

.action-btn-edit, .btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #333 !important;
}

.action-btn-delete, .btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

.action-btn-alt, .btn-info {
    background-color: #5a8dee !important;
    border-color: #5a8dee !important;
    color: #fff !important;
}

.action-btn-primary, .btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #fff !important;
}

.btn-success, .btn-outline-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

.btn-outline-success {
    background-color: transparent !important;
    color: #28a745 !important;
}

.btn-outline-danger {
    background-color: transparent !important;
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.btn-outline-info {
    background-color: transparent !important;
    color: #5a8dee !important;
    border-color: #5a8dee !important;
}

.btn-outline-warning {
    background-color: transparent !important;
    color: #ffc107 !important;
    border-color: #ffc107 !important;
}

/* Hover-эффекты для action-btn */
.action-btn:hover,
.btn:hover,
.btn-outline-primary:hover {
    filter: brightness(0.95);
    opacity: 0.95;
    box-shadow: 0 0.125rem 0.25rem rgba(90, 141, 238, 0.09);
}

/* ----------------------------------------------------
    Кнопки для верхней панели (AI, Edit, Delete)
---------------------------------------------------- */

/* КОНТЕЙНЕР ДЛЯ КНОПОК AI, EDIT, DELETE */
.core-card-header-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Отступ между кнопкой AI и блоком Edit/Delete */
    align-items: flex-end; /* Выравнивание всего блока вправо */
}

/* БЛОК ДЛЯ EDIT/DELETE */
.button-bar-top {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0;
    justify-content: flex-end;
}

.btn-ai-recipe {
    background: #5a8dee;
    color: #fff;
    border: none;
    outline: none;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 0.5rem;
    padding: 0.5rem 1.2rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    transition: background 0.16s, color 0.16s;
}

    .btn-ai-recipe:hover {
        background: #3e6dc9;
        color: #fff;
    }

.btn-edit-small {
    background: #ffc107;
    color: #222;
    border: none;
    outline: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    padding: 0.32rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4em;
    transition: background 0.16s, color 0.16s;
}

    .btn-edit-small:hover {
        background: #e0aa1f;
        color: #222;
    }

.btn-delete-small {
    background: #dc3545;
    color: #fff;
    border: none;
    outline: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    padding: 0.32rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4em;
    transition: background 0.16s, color 0.16s;
}

    .btn-delete-small:hover {
        background: #bd2130;
        color: #fff;
    }

/* ----------------------------------------------------
    Кнопки под таблицей ингредиентов
---------------------------------------------------- */
.core-ingredients-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

    .core-ingredients-actions .btn-success,
    .core-ingredients-actions .btn-primary {
        font-size: 1rem;
        font-weight: 500;
        padding: 0.45em 1.2em;
        border-radius: 0.5rem;
        min-width: 170px;
        text-transform: none;
        letter-spacing: 0.01em;
    }

    .core-ingredients-actions .btn-success {
        background-color: #28a745 !important;
        border-color: #28a745 !important;
    }

        .core-ingredients-actions .btn-success:hover {
            background-color: #218838 !important;
            border-color: #1e7e34 !important;
        }

    .core-ingredients-actions .btn-primary {
        background-color: #007bff !important;
        border-color: #007bff !important;
    }

        .core-ingredients-actions .btn-primary:hover {
            background-color: #0056b3 !important;
            border-color: #004085 !important;
        }
    /* Кнопка анализа обычного размера */
    .core-ingredients-actions .btn-outline-secondary {
        font-size: 0.96rem;
        font-weight: 500;
        padding: 0.42em 1.1em;
        border-radius: 0.5rem;
        min-width: 150px;
        background: #f8f9fa !important;
        color: #333 !important;
        border: 1.5px solid #d0d2d6 !important;
    }

        .core-ingredients-actions .btn-outline-secondary:hover {
            background: #e3e6ea !important;
            color: #333 !important;
            border-color: #adb5bd !important;
        }

/* ----------------------------------------------------
    Стили для секций с информацией и селекторами
---------------------------------------------------- */
.core-info-layout-compact {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4rem;
    padding-top: 1rem;
}

/* Блок веса + автора */
.info-column-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 0;
    text-align: left !important;
}

/* Стили для блока веса и заголовка */
.weight-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.weight-label, .selector-label-custom {
    font-size: 1rem;
    color: #1f4d2f;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 0.5rem;
    text-align: left;
    display: block;
}

.weight-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #343a40;
    text-align: left;
}

/* Выравнивание колонок с селекторами по центру */
.dish-type-column, .cuisine-type-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .dish-type-column .selector-label-custom,
    .cuisine-type-column .selector-label-custom {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 0.5rem;
        text-align: center;
    }

/* Author badge */
.author-badge {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: #28a745;
    font-size: 1rem;
    border-radius: 0.5rem;
    padding: 0.14em 0.95em;
    font-weight: 500;
    margin-bottom: 0.8rem;
    margin-top: 0.15rem;
    letter-spacing: 0.01em;
    box-shadow: none;
    border: 1.5px solid #28a745;
}

    .author-badge i {
        margin-right: 0.5em;
        font-size: 1.1em;
    }

/* Стили для author/visible to others заголовков и значений */
.info-block-label {
    font-size: 0.96rem;
    color: #1f4d2f;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 0.32rem;
    display: block;
    text-align: left !important;
}

.info-block-value {
    font-size: 1.05rem;
    font-weight: 500;
    color: #343a40;
    text-align: left !important;
    margin-bottom: 0.75rem;
}

/* ----------------------------------------------------
    Секция предупреждений
---------------------------------------------------- */
.warnings-card {
    padding: 1rem 1.5rem !important;
    box-shadow: none;
    border: 1px solid #fae8b1;
    background-color: #fff8e1;
}

.warnings-title {
    font-weight: 600;
    color: #856404;
}

.badge-warning-custom {
    background-color: #ffc107 !important;
    color: #333 !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.35em 0.65em;
    border-radius: 0.3rem;
}

/* ----------------------------------------------------
    Грид: верхний ряд (50/50)
---------------------------------------------------- */
.page-content-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ratio-container-compact {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
}

.ratio-left-50 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
}

.ratio-right-50 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ----------------------------------------------------
    Нижний ряд (макро, ингредиенты, рецепт и рейтинги)
---------------------------------------------------- */
.row-middle-bottom {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
}

.ratio-left-25 {
    flex: 0 0 25% !important;
    max-width: 25% !important;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ratio-right-75 {
    flex: 0 0 75% !important;
    max-width: 75% !important;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- Макро ратио --- */
.macro-ratio-wrapper {
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    background-color: #fff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    min-height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 0 !important;
}

/* --- Блок ингредиентов --- */
.core-card-ingredients {
    min-height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 0 !important;
}

/* Убираем внешние маргины у секций справа */
.ratio-right-75 > * {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

/* ----------------------------------------------------
    Рейтинги (карточки)
---------------------------------------------------- */
.card.shadow-sm.mb-4, .card.mb-3, .card-header.bg-light {
    border-radius: 0.5rem !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.07) !important;
    border: 1px solid #e0e0e0 !important;
}

.card-header.bg-light {
    background: #f8fafc !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

/* ----------------------------------------------------
    Readonly селекторы
---------------------------------------------------- */
.entity-selector.readonly {
    pointer-events: none !important;
    opacity: 0.75;
    background: #f5f5f5;
}

    .entity-selector.readonly * {
        pointer-events: none !important;
        cursor: not-allowed !important;
    }

.selector-label-custom .bi-lock {
    font-size: 1rem;
    color: #aaa;
    margin-left: 0.25em;
}

.selectors-row {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 2.4rem;
}

.selector-block {
    min-width: 170px;
    text-align: center;
}

/* Добавлено правило для выравнивания селекторов */
.row.align-items-stretch .entity-selector {
    height: 100%;
}

/* ----------- Адаптив ----------- */
@media (max-width: 1200px) {
    .macro-ratio-wrapper,
    .core-card-ingredients {
        min-height: 300px;
    }

    .ratio-left-25,
    .ratio-right-75 {
        min-height: unset;
    }

    .ratio-left-50,
    .ratio-right-50 {
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }

    .ratio-container-compact {
        flex-direction: column;
    }
}

@media (max-width: 992px) {
    .page-content-grid,
    .row-middle-bottom {
        flex-direction: column;
        gap: 1.5rem;
    }

    .ratio-left-40, .ratio-left-50,
    .ratio-right-60, .ratio-right-50,
    .ratio-left-25,
    .ratio-right-75 {
        max-width: 100% !important;
        flex: 1 1 100% !important;
        min-height: unset;
    }

    .macro-ratio-wrapper,
    .core-card-ingredients {
        min-height: 180px;
    }

    .core-card-header-buttons {
        align-items: flex-start;
        width: 100%;
        margin-top: 1rem;
        min-width: 0; /* ИЗМЕНЕНО: Сброс min-width для мобильных */
    }

        .core-card-header-buttons .button-bar-top {
            justify-content: flex-start;
            margin-top: 0.5rem;
        }

    /* .selectors-row {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: stretch !important;
    }
    .selector-block {
        min-width: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    */
}

/* Стили для мобильной сетки 2x2 (экраны < 768px) */
@media (max-width: 767px) {
    .weight-label, .selector-label-custom, .info-block-label {
        font-size: 0.8rem; /* Уменьшаем шрифт заголовков */
        margin-bottom: 0.25rem;
        letter-spacing: 0.02em;
    }

    .weight-text {
        font-size: 1.1rem; /* Уменьшаем шрифт веса */
    }

    .author-badge {
        font-size: 0.9rem; /* Уменьшаем автора */
        padding: 0.1em 0.75em;
        border-width: 1px;
    }

    /* Стили из selector.css, чтобы уменьшить селекторы */
    .entity-selector-vertical .entity-selected-value {
        font-size: 0.8rem; /* Уменьшаем текст селектора */
    }

    .entity-selector-vertical .btn {
        font-size: 0.75em; /* Уменьшаем кнопки селектора */
        padding: .2rem .5rem;
    }
}


@media (max-width: 576px) {
    .hdr-actions {
        flex-direction: column;
    }
}
/* Дополнительная адаптация при узкой ширине */
@media (max-width: 480px) {
    .btn-ai-generator {
        font-size: .875rem;
        padding: .55rem .75rem;
    }
}

/* ----------------------------------------------------
       РЕЦЕПТ (AI-стиль для Dish Details)
    ---------------------------------------------------- */
.ai-recipe-panel {
    margin-bottom: 1rem;
    border-radius: 0.5rem !important;
    overflow: hidden;
}

    .ai-recipe-panel .card-header {
        background: linear-gradient(to right, #f8f9fa, #ffffff) !important;
        border-bottom: 2px solid #e9ecef !important;
    }

        .ai-recipe-panel .card-header:hover {
            background: linear-gradient(to right, #f0f8f0, #ffffff) !important;
        }

    .ai-recipe-panel .card-body {
        background-color: #fefefe;
    }

    .ai-recipe-panel:hover {
        box-shadow: 0 0.5rem 1rem rgba(0,0,0,.12) !important;
        transition: box-shadow .3s ease;
    }

    .ai-recipe-panel.inverted {
        background: #f0f8f0 !important;
    }

/* Кнопка-стрелка сворачивания */
.ai-collapse-btn {
    transition: transform .3s ease, opacity .2s ease;
    text-decoration: none !important;
    opacity: .8;
    color: #17653b !important;
}

    .ai-collapse-btn:hover {
        opacity: 1;
        transform: scale(1.1);
    }

    .ai-collapse-btn i {
        transition: all .25s ease;
        display: inline-block;
    }

/* Стили списков рецепта — единообразно для <ol.recipe-steps> и для списков в .recipe-content */
.recipe-steps,
.ai-recipe-panel .recipe-content ol,
.ai-recipe-panel .recipe-content ul {
    counter-reset: step;
    list-style: none; /* прячем маркер браузера */
    padding-left: 2rem; /* общий отступ слева для списка */
    margin-bottom: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2b2b2b; /* почти чёрный для текста шага */
}

    .recipe-steps li,
    .ai-recipe-panel .recipe-content ol li,
    .ai-recipe-panel .recipe-content ul li {
        position: relative;
        margin: .6rem 0;
        padding-left: 0.75rem; /* небольшой внутренний отступ текста от номера */
    }

        /* Зелёная нумерация "1." "2." слева */
        .recipe-steps li::before,
        .ai-recipe-panel .recipe-content ol li::before,
        .ai-recipe-panel .recipe-content ul li::before {
            counter-increment: step;
            content: counter(step) ".";
            position: absolute;
            left: -1.35rem; /* выносим номер влево от текста */
            width: 1.1rem;
            text-align: right;
            color: #28a745; /* зелёный */
            font-weight: 700;
            font-style: normal; /* сам номер без курсива */
        }

    /* Нумерация для инвертированных блоков (светлый фон) */
    .ai-recipe-panel.inverted .recipe-steps li::before,
    .ai-recipe-panel.inverted .recipe-content ol li::before,
    .ai-recipe-panel.inverted .recipe-content ul li::before {
        color: #17653b; /* тёмно-зелёный */
    }

/* Если внутри Description был уже <ol>, отключим его встроенную нумерацию целиком */
.ai-recipe-panel .recipe-content ol {
    list-style: none;
}

.ai-recipe-panel .recipe-content ul {
    list-style: none;
}

/* Когда рецепт хранится готовым HTML (параграфы/списки) */
.recipe-content {
    font-family: 'Merienda', 'Georgia', 'Times New Roman', serif;
    font-size: 1.06rem;
    line-height: 1.6;
    color: #202020;
}

    .recipe-content p {
        margin-bottom: .75rem;
    }

/* Стили рецепта должны применяться только в рамках страницы Dish Details */
.product-page-shell .recipe-steps,
.product-page-shell .ai-recipe-panel .recipe-content ol,
.product-page-shell .ai-recipe-panel .recipe-content ul {
    counter-reset: step;
    list-style: none;
    padding-left: 2rem;
    margin-bottom: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2b2b2b;
}

    .product-page-shell .recipe-steps li,
    .product-page-shell .ai-recipe-panel .recipe-content ol li,
    .product-page-shell .ai-recipe-panel .recipe-content ul li {
        position: relative;
        margin: .6rem 0;
        padding-left: 0.75rem;
    }

        .product-page-shell .recipe-steps li::before,
        .product-page-shell .ai-recipe-panel .recipe-content ol li::before,
        .product-page-shell .ai-recipe-panel .recipe-content ul li::before {
            counter-increment: step;
            content: counter(step) ".";
            position: absolute;
            left: -1.35rem;
            width: 1.1rem;
            text-align: right;
            color: #28a745;
            font-weight: 700;
            font-style: normal;
        }
/* Если в Description был <ol>/<ul> — отключим их встроенную нумерацию только на Dish Details */
.product-page-shell .ai-recipe-panel .recipe-content ol,
.product-page-shell .ai-recipe-panel .recipe-content ul {
    list-style: none;
}

/* === Ряд кнопок в шапке карточки блюда === */
.hdr-actions {
    display: flex;
    gap: .5rem;
    width: 100%;
}

    .hdr-actions .hdr-btn {
        flex: 1 1 0;
        white-space: nowrap;
    }

.core-card-header-buttons {
    flex: 1 1 auto;
}

/* ИЗМЕНЕНО: Добавляем min-width только для экранов > 992px */
@media (min-width: 992px) {
    .core-card-header-buttons {
        min-width: 340px;
    }
}


/* === AI Generator кнопка === */
.btn-ai-generator {
    background-color: #eaf6ff; /* очень светло-голубой фон */
    border: 2px solid #0b397d; /* тёмно-синяя толстая окантовка */
    color: #0b397d; /* тёмно-синий текст */
    font-weight: 600;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: background-color .15s, border-color .15s, color .15s;
}

    .btn-ai-generator:hover,
    .btn-ai-generator:focus {
        background-color: #d7edff;
        border-color: #093066;
        color: #093066;
        text-decoration: none;
    }

    .btn-ai-generator:active {
        background-color: #c3e4ff;
        border-color: #072852;
        color: #072852;
    }

    .btn-ai-generator .bi {
        font-size: 1.05em;
        line-height: 1;
    }

    /* Кнопка генерации рецепта AI с инверсией цветов */
    .btn-ai-generator.inverted {
        background-color: #17653b; /* тёмно-зелёный фон */
        border-color: #0b3f91; /* тёмно-синий цвет рамки */
        color: #fff; /* белый текст */
    }

    .btn-ai-generator.inverted:hover,
    .btn-ai-generator.inverted:focus {
        background-color: #155d33; /* тёмно-зелёный при наведении */
        border-color: #083377; /* тёмно-синий при наведении */
        color: #fff; /* белый текст */
        text-decoration: none;
    }

    .btn-ai-generator.inverted:active {
        background-color: #144d28; /* ещё тёмнее зелёный при нажатии */
        border-color: #072a14; /* очень тёмно-синий при нажатии */
        color: #fff; /* белый текст */
    }

/* Equal heights for top row */
.row-top.ratio-container-compact.equal-rows {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}
.row-top.ratio-container-compact.equal-rows .ratio-left-50,
.row-top.ratio-container-compact.equal-rows .ratio-right-50 {
    flex: 1 1 50%;
    display: flex;
}
.row-top.ratio-container-compact.equal-rows .ratio-left-50 > * {
    flex: 1;
}
.row-top.ratio-container-compact.equal-rows .ratio-right-50 > form,
.row-top.ratio-container-compact.equal-rows .ratio-right-50 .core-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Кнопочная панель */
.buttons-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.left-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.right-ai { display: flex; }

.btn-row-unified { display:flex; gap:.5rem; flex-wrap:wrap; }

.hdr-btn-unified {
    --btn-radius: 9px;
    border: 2px solid;
    font-weight: 600;
    border-radius: var(--btn-radius);
    padding: .45rem 1.05rem;
    font-size: .85rem;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 34px;
    letter-spacing: .5px;
    white-space: nowrap;
}

/* Цветовые стили кнопок (как раньше) */
.btn-save { background:#d3fad8; color:#0d6832; border-color:#0d6832; }
.btn-save:hover { background:#c0f3c6; color:#0b592a; border-color:#0b592a; }
.btn-save:active { background:#aceeaf !important; border-color:#094d23 !important; color:#094d23 !important; }

.btn-cancel { background:#e2e2e2; color:#222; border-color:#303030; }
.btn-cancel:hover { background:#d6d6d6; color:#111; border-color:#202020; }
.btn-cancel:active { background:#cacaca !important; border-color:#141414 !important; }

.btn-delete { background:#ffd9df; color:#6b081b; border-color:#6b081b; }
.btn-delete:hover { background:#ffc7cf; color:#5a0716; border-color:#5a0716; }
.btn-delete:active { background:#ffb3be !important; border-color:#470512 !important; }

.btn-ai { background:#d9e9ff; color:#0b3f91; border-color:#0b3f91; }
.btn-ai:hover { background:#c9e0ff; color:#083377; border-color:#083377; }
.btn-ai:active { background:#b9d6ff !important; border-color:#062a61 !important; }

/* Линия и «Помпушки» */
.buttons-extra { max-width: fit-content; }
.btn-group-divider {
    height:1px;
    background:#d0d0d0;
    width:100%;
    margin:0 0 4px 0;
}
.pompushki-label {
    font-style: italic;
    color:#0d6832;
    font-weight:600;
    font-size:.9rem;
}

/* Weight + Availability */
.weight-group .weight-label,
.availability-group .availability-label {
    font-weight:700;
    font-size:.75rem;
    letter-spacing:.5px;
    color:#0d6832;
    margin-bottom:2px;
    text-transform:uppercase;
}

/* Селекторы компактные, окантовка темно-зелёная + скругление больше */
.selector-row-compact .entity-selector-shell { display:flex; flex-direction:column; }
.selector-title-top {
    font-weight: 700;
    font-size: .9rem;
    color: #0d6832;
    margin-bottom: 4px; /* 4px между заголовком и блоком селектора */
    letter-spacing: .4px;
}
.selector-selected-name {
    margin-top: 4px;
    font-weight: 600;
    color: #000;
    font-size: .85rem;
    letter-spacing: .3px;
    min-height: 1.1rem;
}

/* Селекторы: вертикальная компоновка — картинка сверху, название ниже */
.entity-selector-vertical {
    display: flex;
    flex-direction: column;
}
.entity-selector-vertical .entity-mini-image-wrapper {
    order: 1;
    margin-bottom: 4px; /* отступ между картинкой и подписями сверху/снизу */
}
.entity-selector-vertical .entity-selected-value {
    order: 2;
    margin-top: 4px; /* 4px между картинкой и выбранным названием */
    font-weight: 600;
    color: #0d6832; /* темно-зелёный для выбранного значения */
}

/* Тёмно‑зелёная окантовка и скругление для обоих селекторов */
.entity-selector-shell [data-selector-id="dishesTypeSelector"],
.entity-selector-shell [data-selector-id="cuisineTypeSelector"] {
    --sel-border: #0d6832;
    --sel-radius: 22px;
    border: 2px solid var(--sel-border);
    border-radius: var(--sel-radius);
    padding: .4rem .5rem;
    background: #f6fff6;
}

/* Превью-картинка селектора */
.entity-selector-shell [data-selector-id="dishesTypeSelector"] .entity-mini-img-box,
.entity-selector-shell [data-selector-id="cuisineTypeSelector"] .entity-mini-img-box {
    min-height: 95px;
    height: 110px;
    max-height: 120px;
    border-radius: calc(var(--sel-radius) - 2px);
    overflow: hidden;
}

/* Сетка для ряда вес/автор/видимость — аккуратные отступы */
.weight-group { margin-bottom: 0; }
.author-badge { margin-bottom: 0; }
/* видимость уже внутри той же строки, доп. маргины не нужны */

/* ----------------------------------------------------
    Стили для мобильных устройств
---------------------------------------------------- */
