/* WorkLine 1.11.12 — Напитки и ТТК:
 * 7.1 Компактный однострочный блок объёма премикса
 * 7.2 Единица измерения «мл» в поле объёма премикса/настойки
 * 7.3 Статичная шапка (название + «+ строка») в окне добавления/редактирования напитка
 * 7.4 Шторка категорий ТТК со стрелкой (как в Накладных, Меню и Этикетках)
 * 7.5 Статичная шапка от «Названия» до «+ строка» в окне ТТК
 * 7.6 Строка «Выход | Ед. изм. | + строка» ровно на 3 равные части
 * 7.7 Статичные настройки подкатегорий в одной строке с заголовком, свайп только у категорий */

/* ===== 7.1: Блок объёма премикса в одну строчку ===== */
.premix-info-box {
    padding: 8px 11px;
    line-height: 1.35;
}
.premix-info-box .premix-info-title {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.8;
    margin-bottom: 4px;
}
.premix-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.premix-info-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    white-space: nowrap;
}
.premix-info-lbl {
    opacity: 0.72;
    font-weight: 500;
}
.premix-info-item b {
    font-weight: 800;
    color: var(--text);
}
.premix-info-sep {
    opacity: 0.35;
    flex: 0 0 auto;
}

/* ===== 7.2: Единица измерения «мл» внутри поля количества ===== */
#drinks .qty-row {
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    text-align: left;
    padding: 10px 12px;
}
#drinks .qty-row .drinks-label {
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13.5px;
}
#drinks .qty-controls {
    flex: 0 0 auto;
    gap: 6px;
}
#drinks .btn-c-compact {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}
.qty-input-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-width: 64px;
    padding: 0 8px;
    gap: 3px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.15s ease;
}
.qty-input-wrap:focus-within {
    border-color: var(--primary);
}
.qty-input-wrap.is-disabled {
    opacity: 0.52;
}
.qty-input-wrap .qty-input-compact {
    width: 44px;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: inherit;
    -moz-appearance: textfield;
}
.qty-input-wrap .qty-input-compact::-webkit-inner-spin-button,
.qty-input-wrap .qty-input-compact::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-input-wrap.has-unit {
    min-width: 78px;
    padding: 0 9px;
}
.qty-input-wrap.has-unit .qty-input-compact {
    width: 42px;
    text-align: right;
}
.qty-unit-suffix {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.9;
    user-select: none;
    white-space: nowrap;
    cursor: text;
    flex: 0 0 auto;
}
.qty-unit-suffix[hidden] {
    display: none !important;
}

/* ===== 7.3: Модалка добавления/редактирования напитка — статичный верх ===== */
#drink-add-overlay .overlay-box {
    display: flex;
    flex-direction: column;
    max-width: 390px;
    max-height: 84vh;
    max-height: 84dvh;
    overflow: hidden;
}
#drink-add-overlay .overlay-header {
    flex: 0 0 auto;
}
#drink-add-overlay .cocktail-add-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.drink-add-pinned {
    flex: 0 0 auto;
    padding: 10px 14px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    z-index: 2;
}
.drink-add-pinned .cocktail-add-name-input {
    margin-bottom: 10px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
}
.drink-add-pinned .cocktail-ings-head {
    margin-bottom: 0;
}
#drink-add-overlay .drink-add-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 14px 12px;
}
#drink-add-overlay .cocktail-add-actions {
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
}

/* ===== 7.4: ТТК — кнопка шторки категорий и активный фильтр ===== */
.ttk-toolbar .ttk-cats-btn.wl-cats-arrow-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    flex: 0 0 auto;
}
.ttk-toolbar .ttk-cats-btn.wl-cats-arrow-btn.has-filter,
.ttk-toolbar .ttk-cats-btn.wl-cats-arrow-btn.is-open {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb, 15, 118, 110), 0.1);
}
#ttk-cats.ttk-cats {
    margin: 8px 0 2px;
    padding: 0;
}
#ttk-cats[hidden] {
    display: none !important;
}
.ttk-active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px 6px 11px;
    border-radius: 10px;
    border: 1px solid rgba(var(--primary-rgb, 15, 118, 110), 0.28);
    background: rgba(var(--primary-rgb, 15, 118, 110), 0.08);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
}
.ttk-active-filter-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.ttk-active-filter-info .wl-icon {
    color: var(--primary);
    flex: 0 0 auto;
}
.ttk-active-filter-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ttk-active-filter-clear {
    flex: 0 0 auto;
    height: 26px;
    padding: 0 9px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.ttk-cats-drawer-tools {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ttk-cats-tool-btn {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-align: left;
}
.ttk-cats-tool-btn .wl-icon {
    color: var(--primary);
    flex: 0 0 auto;
}
.ttk-cats-tool-btn:active {
    background: rgba(var(--primary-rgb, 15, 118, 110), 0.12);
    border-color: var(--primary);
}

/* ===== 7.5, 7.6, 7.7: Модалка ТТК — статичная шапка, 3 равные колонки, свайп только категорий ===== */
#ttk-overlay .overlay-box.ttk-modal-box {
    display: flex;
    flex-direction: column;
    max-width: 396px !important;
    max-height: 86vh;
    max-height: 86dvh;
    overflow: hidden;
}
#ttk-overlay .overlay-header {
    flex: 0 0 auto;
    border-bottom: 1px solid var(--border);
}
.ttk-modal-pinned {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 13px 11px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    z-index: 2;
}
.ttk-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.ttk-lbl {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 0.66;
    margin: 0;
    padding-left: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#ttk-overlay .ttk-modal-pinned input[type="text"],
#ttk-overlay .ttk-modal-scroll textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    min-width: 0;
}
#ttk-overlay .ttk-modal-pinned input[type="text"] {
    height: 38px;
    min-height: 38px;
    padding: 0 11px;
    font-size: 15px;
    font-weight: 600;
}
#ttk-overlay .ttk-modal-scroll textarea {
    padding: 9px 11px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    resize: vertical;
}

/* 7.7: Заголовок «Подкатегория» + статичные действия на одной аккуратной строчке */
.ttk-cat-block {
    gap: 6px;
}
.ttk-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.ttk-cat-head .ttk-lbl {
    flex: 0 1 auto;
}
.ttk-cat-head-acts {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}
.ttk-cat-act-btn {
    height: 26px;
    padding: 0 9px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.ttk-cat-act-btn.is-add {
    border-color: rgba(var(--primary-rgb, 15, 118, 110), 0.34);
    background: rgba(var(--primary-rgb, 15, 118, 110), 0.09);
    color: var(--primary);
}
.ttk-cat-act-btn:active {
    transform: scale(0.97);
}
.ttk-cat-act-btn[hidden] {
    display: none !important;
}

/* Свайп-лента ТОЛЬКО для категорий */
#ttk-overlay .ttk-cat-picker {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -13px;
    padding: 1px 13px 2px;
    gap: 6px;
}
#ttk-overlay .ttk-cat-picker::-webkit-scrollbar {
    display: none;
}
#ttk-overlay .ttk-cat-picker > .ttk-pick-chip {
    flex: 0 0 auto;
    white-space: nowrap;
    height: 32px;
    padding: 0 11px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 650;
}
#ttk-overlay .ttk-cat-new-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
#ttk-overlay .ttk-cat-new-row[hidden] {
    display: none !important;
}
#ttk-overlay .ttk-cat-new-row input {
    flex: 1 1 auto;
    height: 36px;
    min-height: 36px;
    font-size: 14px;
}
#ttk-overlay .ttk-cat-new-row .btn-main {
    flex: 0 0 auto;
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

/* 7.6: Выход | Ед. изм. | + строка — ровно на 3 равные части в одной строчке */
.ttk-meta3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}
.ttk-meta3-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.ttk-meta3-col input[type="text"] {
    text-align: center;
    padding: 0 8px !important;
}
.ttk-meta3-col .ttk-add-row-btn {
    width: 100%;
    height: 38px;
    padding: 0 8px;
    border-radius: 10px;
    border: 1px solid rgba(var(--primary-rgb, 15, 118, 110), 0.36);
    background: rgba(var(--primary-rgb, 15, 118, 110), 0.1);
    color: var(--primary);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
}
.ttk-meta3-col .ttk-add-row-btn:active {
    transform: scale(0.97);
    background: rgba(var(--primary-rgb, 15, 118, 110), 0.18);
}

/* 7.5: Прокручиваемая область ингредиентов, технологии и примечания */
#ttk-overlay .ttk-modal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 13px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#ttk-overlay .ttk-ings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#ttk-overlay .ttk-modal-footer {
    flex: 0 0 auto;
    padding: 10px 13px 12px;
    gap: 8px;
    border-top: 1px solid var(--border);
    background: var(--card);
}

/* Тёмная тема — высокий контраст на активных акцентных кнопках */
:where([data-theme="dark"]) .ttk-toolbar .ttk-add-btn,
:where([data-theme="dark"]) #ttk-overlay .ttk-modal-footer .ttk-btn-save,
:where([data-theme="dark"]) #ttk-overlay .ttk-pick-chip.active,
:where([data-theme="dark"]) #ttk-overlay .ttk-cat-new-row .btn-main.primary {
    color: var(--on-primary, #111318) !important;
}
:where([data-theme="dark"]) .ttk-active-filter {
    background: rgba(var(--primary-rgb, 45, 212, 191), 0.12);
    border-color: rgba(var(--primary-rgb, 45, 212, 191), 0.32);
}
