/* estimate.css — Стили для редактора смет */

/* === Глобальное скрытие полос прокрутки (везде) ===
   Сама прокрутка работает (колесо/тач), но визуальных полос нет. */
* {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
}
*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;                  /* Chrome/Safari/Electron */
}

/* Header */
#app .header { display:flex; align-items:center; gap:8px; padding:10px 12px; background:var(--primary,#1a365d); color:white; }
#app .header-btn { background:none; border:none; color:white; padding:6px; cursor:pointer; border-radius:50%; display:flex; align-items:center; justify-content:center; }
#app .header h1 { flex:1; font-size:16px; margin:0; color:white; }

/* Каталог */
.ee-cat {
    background:#fafbff;
    border-radius:12px;
    margin:6px 10px;
    overflow:hidden;
    border:1px solid rgba(59,130,246,0.5);
    /* Неоновая рамка: внутренний бордер + внешнее свечение */
    box-shadow:
        0 0 0 1px rgba(59,130,246,0.25),
        0 0 8px rgba(59,130,246,0.45),
        0 0 18px rgba(59,130,246,0.25),
        inset 0 0 6px rgba(59,130,246,0.08);
}

/* Полноэкранная модалка (для сложных экранов — настройки сметы и т.п.) */
.modal-overlay.ee-fullscreen { align-items:stretch; justify-content:stretch; }
.modal-overlay.ee-fullscreen .modal { width:100%; max-width:100%; height:100%; background:var(--bg,#f5f5f5); border-radius:0; display:flex; flex-direction:column; overflow:hidden; }
.modal-overlay.ee-fullscreen .modal h2 { padding:14px; margin:0; font-size:17px; background:var(--primary,#1a365d); color:#fff; }
.modal-overlay.ee-fullscreen .modal .modal-body-scroll { flex:1; overflow-y:auto; }
.modal-overlay.ee-fullscreen .modal .modal-actions { padding:10px 14px; border-top:1px solid #eee; }

/* === Кнопки управления каталогом (компактные, распределены по ширине) === */
.controls { display:flex; gap:6px; padding:6px 10px; background:transparent; justify-content:space-between; }
.control-btn {
    flex:1 1 0;
    max-width:64px;
    height:32px;
    padding:0 8px;
    border:1px solid rgba(41,128,185,0.4);
    border-radius:6px;
    background:transparent;
    color:var(--secondary,#2980b9);
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    transition:all 0.15s;
}
.control-btn:active { background:var(--secondary,#2980b9); color:#fff; }
.control-btn.active-filter { background:var(--secondary,#2980b9); color:#fff; }

/* === Экран КОРЗИНЫ: выезжает снизу вверх, header всегда видимый (sticky) === */
.ee-screen {
    position:fixed; top:0; left:0; right:0; bottom:0;
    background:var(--bg,#f5f5f5);
    z-index:200;
    display:flex;
    flex-direction:column;
    transform:translateY(100%);
    opacity:0.6;
    transition:transform 0.42s cubic-bezier(0.22,1,0.36,1), opacity 0.42s cubic-bezier(0.22,1,0.36,1);
}
.ee-screen.active { transform:translateY(0); opacity:1; }
/* Header корзины/настроек — закреплён сверху, не скроллится */
.ee-screen .header {
    background:var(--primary,#1a365d);
    flex-shrink:0;
    position:sticky;
    top:0;
    z-index:5;
}
/* Контентная часть скроллится отдельно (без полос) */
.ee-screen > div:not(.header) {
    flex:1;
    overflow-y:auto;
}

/* === Экран НАСТРОЕК СМЕТЫ: radix-style dialog (scale + fade, центр экрана) === */
.ee-settings-screen {
    position:fixed; inset:0;
    background:rgba(0,0,0,0.6);
    backdrop-filter:blur(4px);
    z-index:300;
    display:flex;
    align-items:center;
    justify-content:center;
    opacity:0;
    pointer-events:none;
    transition:opacity 0.28s cubic-bezier(0.22,1,0.36,1);
}
.ee-settings-screen.active { opacity:1; pointer-events:auto; }
.ee-settings-screen .ee-settings-card {
    width:100%; max-width:480px;
    max-height:90vh;
    background:var(--bg,#f5f5f5);
    border-radius:16px;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    box-shadow:0 20px 60px rgba(0,0,0,0.5);
    transform:scale(0.95) translateY(12px);
    opacity:0;
    transition:transform 0.32s cubic-bezier(0.22,1,0.36,1), opacity 0.32s cubic-bezier(0.22,1,0.36,1);
}
.ee-settings-screen.active .ee-settings-card { transform:scale(1) translateY(0); opacity:1; }
@media (prefers-reduced-motion: reduce) {
    .ee-screen, .ee-settings-screen, .ee-settings-screen .ee-settings-card { transition:opacity 0.15s ease; transform:none; }
    .ee-cat-arrow, .ee-cat-body, .ee-cat-body .ee-item { transition:none; }
    .ee-cat-body .ee-item { opacity:1; transform:none; }
}
.ee-cat-header { padding:10px 12px; background:var(--primary,#1a365d); color:white; font-weight:600; font-size:14px; display:flex; justify-content:space-between; align-items:center; cursor:pointer; border-radius:12px 12px 0 0; }
.ee-cat-arrow { font-size:12px; transition:transform 0.2s ease; display:inline-block; }
.ee-cat-header.ee-cat-open .ee-cat-arrow { transform:rotate(180deg); }
/* Анимация раскрытия категории — быстрый fade */
.ee-cat-body {
    display:grid;
    grid-template-rows:0fr;
    transition:grid-template-rows 0.2s ease;
}
.ee-cat-body.ee-cat-open { grid-template-rows:1fr; }
.ee-cat-body .ee-item {
    opacity:0;
    transform:translateY(8px);
    transition:opacity 0.2s ease, transform 0.2s ease, background 0.15s;
}
.ee-cat-body.ee-cat-open .ee-item {
    opacity:1;
    transform:translateY(0);
}
.ee-cat-inner { overflow:hidden; min-height:0; }
/* === Карточка позиции каталога (новая раскладка) === */
.ee-item {
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:10px 12px;
    border-bottom:1px solid #eee;
    background:#fff;
    transition:background 0.15s;
}
.ee-item:nth-child(even) { background:#f8f9fa; }
.ee-item.ee-item-in-cart { background:#e8f5e9; border-left:3px solid #4caf50; }
.ee-item-name { font-size:14px; font-weight:500; color:#333; line-height:1.3; display:flex; align-items:center; gap:6px; }
.ee-item-name-text { flex:1; min-width:0; }
/* Бейдж количества — синий как кнопка плюс, с неоновой рамкой */
.ee-qty-badge {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:22px;
    height:22px;
    padding:0 6px;
    border-radius:11px;
    background:var(--secondary,#2980b9);
    color:#fff;
    font-size:12px;
    font-weight:700;
    box-shadow:
        0 0 0 1px rgba(41,128,185,0.8),
        0 0 6px rgba(41,128,185,0.7),
        0 0 14px rgba(41,128,185,0.5);
    flex-shrink:0;
}
.ee-item-note { font-size:12px; color:#f59e0b; margin-top:-2px; }
.ee-item-row {
    display:flex;
    align-items:flex-start;
    justify-content:flex-end;
    gap:8px;
    flex-direction:column;
    align-items:flex-end;
}
.ee-item-price { font-size:14px; font-weight:600; color:var(--secondary,#2980b9); display:inline-flex; align-items:baseline; gap:4px; }
.ee-item-unit { font-size:12px; color:#888; font-weight:400; }
.ee-item-actions { display:inline-flex; align-items:center; gap:4px; flex-shrink:0; }
/* Кнопки +/- в карточках и корзине */
.ee-btn {
    width:28px;
    height:28px;
    border:1px solid #ddd;
    border-radius:6px;
    background:#f5f5f5;
    color:#333;
    font-size:16px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    transition:transform 0.1s, background 0.15s;
}
.ee-btn:active { transform:scale(0.92); }
.ee-btn-minus { color:#e74c3c; }
.ee-btn-plus { background:var(--secondary,#2980b9); color:#fff; border-color:var(--secondary,#2980b9); }
.ee-qty-input {
    width:42px;
    height:28px;
    text-align:center;
    border:1px solid #ddd;
    border-radius:6px;
    padding:0 4px;
    font-size:13px;
    font-weight:600;
}
/* Селект коэффициента в карточке каталога */
.ee-item-actions select,
.ee-coeff-select {
    height:28px;
    border:1px solid #ddd;
    border-radius:6px;
    padding:0 4px;
    font-size:12px;
    background:#fff;
    max-width:90px;
}
.ee-badge { background:#4caf50; color:white; padding:2px 8px; border-radius:10px; font-size:12px; font-weight:600; }

/* === Карточка позиции в КОРЗИНЕ (новая раскладка) === */
.ee-cart-item {
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:10px 12px;
    border-bottom:1px solid #eee;
    background:#fff;
}
.ee-cart-item-name { font-size:14px; font-weight:500; color:#333; line-height:1.3; display:flex; align-items:center; gap:6px; }
.ee-cart-item-name-text { flex:1; min-width:0; }
.ee-cart-item-note { font-size:11px; color:#f59e0b; margin-top:-2px; }
.ee-cart-item-unit { font-size:12px; color:#888; }
.ee-cart-item-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-top:4px;
}
.ee-cart-item-qty { display:inline-flex; align-items:center; gap:4px; }
.ee-cart-item-coeff {
    font-size:11px;
    color:#FF8C00;
    font-weight:600;
    background:rgba(255,140,0,0.1);
    padding:2px 6px;
    border-radius:6px;
    margin-left:4px;
}
.ee-cart-item-sum { font-size:14px; font-weight:700; color:var(--secondary,#2980b9); }
.ee-cart-item-del {
    background:none; border:none; color:#e74c3c;
    padding:4px; cursor:pointer;
    display:inline-flex; align-items:center; justify-content:center;
    border-radius:6px;
    transition:background 0.15s, transform 0.1s;
}
.ee-cart-item-del:hover { background:rgba(231,76,60,0.1); }
.ee-cart-item-del:active { transform:scale(0.9); }

/* === Сетка кнопок внизу корзины (только иконки, равномерно с отступами) === */
.ee-cart-actions {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    padding:0 10px;
    margin-bottom:10px;
}
.ee-cart-actions .ee-icon-btn {
    flex:0 0 auto;
    width:48px;
    height:44px;
    padding:0;
    border-radius:10px;
    font-size:0;          /* скрывает подпись */
}
.ee-cart-actions .ee-icon-btn .ee-anim-icon {
    width:22px;
    height:22px;
}

/* === Форма добавления своей позиции === */
.ee-custom-item {
    background:#fff;
    border-radius:12px;
    padding:12px;
    margin-bottom:10px;
    box-shadow:0 1px 3px rgba(0,0,0,0.08);
    display:flex;
    flex-direction:column;
    gap:8px;
}
.ee-custom-item h4 {
    margin:0 0 4px;
    font-size:14px;
    font-weight:600;
    color:#333;
}
.ee-cust-input {
    width:100%;
    box-sizing:border-box;
    padding:10px;
    border:1px solid #ddd;
    border-radius:8px;
    font-size:14px;
    background:#fff;
}
.ee-cust-row {
    display:grid;
    grid-template-columns:1.4fr 0.8fr 0.8fr;
    gap:8px;
}
.ee-cust-add {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:12px;
    background:var(--secondary,#2980b9);
    color:#fff;
    border:none;
    border-radius:8px;
    font-weight:600;
    font-size:14px;
    cursor:pointer;
    transition:transform 0.1s;
}
.ee-cust-add:active { transform:scale(0.97); }

/* === Тогл-переключатель (как animate-ui BaseSwitch) ===
   Скрытый input[type=checkbox] с классом .ee-toggle превращается в pill-переключатель.
   Сохраняет нативный .checked и onchange — никакой JS-логики не трогаем. */
input[type="checkbox"].ee-toggle {
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    width: 34px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    border-radius: 999px;            /* pill */
    background: rgba(100,116,139,0.4); /* серый, выключен */
    position: relative;
    display: inline-block;
    vertical-align: middle;
    transition: background-color 0.3s cubic-bezier(0.22,1,0.36,1);
    outline-offset: 2px;
}
/* Ручка-кружок */
input[type="checkbox"].ee-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1), /* пружинистая Back ease */
                background-color 0.2s ease;
}
/* Включённое состояние — синяя заливка */
input[type="checkbox"].ee-toggle:checked {
    background: #3b82f6;
}
input[type="checkbox"].ee-toggle:checked::after {
    transform: translateX(14px);
}
input[type="checkbox"].ee-toggle:focus-visible {
    outline: 2px solid #3b82f6;
}
input[type="checkbox"].ee-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
input[type="checkbox"].ee-toggle:disabled::after {
    box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
    input[type="checkbox"].ee-toggle,
    input[type="checkbox"].ee-toggle::after { transition: none; }
}


.ee-icon-btn {
    flex:1;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:10px 12px;
    border-radius:8px;
    font-weight:600;
    font-size:13px;
    cursor:pointer;
    border:1px solid transparent;
    background:transparent;
    transition:transform 0.15s ease, box-shadow 0.2s ease;
}
.ee-icon-btn:active { transform:scale(0.97); }
.ee-icon-btn .ee-anim-icon {
    width:18px; height:18px;
    transition:transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.ee-icon-btn:hover .ee-anim-icon { transform:rotate(-8deg) scale(1.1); }
.ee-icon-btn--secondary {
    background:#fff; color:var(--secondary,#2980b9);
    border-color:rgba(41,128,185,0.5);
}
.ee-icon-btn--secondary:hover .ee-anim-icon { transform:translateX(-3px) scale(1.1); }
.ee-icon-btn--success {
    background:var(--success,#27ae60); color:#fff;
}
.ee-icon-btn--success:hover .ee-anim-icon { transform:scale(1.15); }
.ee-icon-btn--neutral {
    background:#fff; color:#555;
    border-color:#bbb;
}
.ee-anim-icon--spin:hover { transform:rotate(90deg) !important; }
@media (prefers-reduced-motion: reduce) {
    .ee-icon-btn, .ee-icon-btn .ee-anim-icon { transition:none; }
    .ee-icon-btn:hover .ee-anim-icon { transform:none; }
}

/* Cart bar */
.ee-cart-bar { position:fixed; bottom:0; left:0; right:0; background:var(--primary,#1a365d); color:white; padding:10px 16px; display:flex; align-items:center; gap:10px; z-index:100; cursor:pointer; }
