/* Смета заказа (OrderEstimate) — общие стили для сайта (rolls.html) и админки (admin.html).
   Использует переменные --ink/--muted/--line/--bg-soft из style.css; есть безопасные фолбэки. */
.est-wrap{margin:26px 0 18px}
.est-head .k{font-size:12px;font-weight:700;letter-spacing:.2em;text-transform:uppercase;color:var(--muted,#8a8a85);margin-bottom:8px}
.est-head h2{font-size:clamp(20px,2.6vw,28px);font-weight:900;letter-spacing:-.03em;line-height:1.1;text-transform:uppercase;margin-bottom:8px;color:var(--ink,#0c0c0c)}
.est-head p{font-size:14.5px;color:var(--muted,#8a8a85);max-width:760px;margin-bottom:18px;line-height:1.6}
.est-empty{border:1.5px dashed var(--line,#e6e6e3);border-radius:20px;padding:26px;color:var(--muted,#8a8a85);font-size:14.5px;line-height:1.6}

/* переключатель режима */
.est-mode{display:flex;align-items:center;gap:14px;flex-wrap:wrap;border:1px solid var(--line,#e6e6e3);border-radius:16px;padding:14px 18px;margin-bottom:14px}
.est-mode-l{font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--muted,#8a8a85)}
.est-mode-sw{display:inline-flex;background:var(--bg-soft,#f4f4f3);border:1px solid var(--line,#e6e6e3);border-radius:999px;padding:3px}
.est-mode-sw button{border:none;background:transparent;font:inherit;font-size:13.5px;font-weight:700;color:var(--muted,#8a8a85);padding:8px 18px;border-radius:999px;cursor:pointer}
.est-mode-sw button.on{background:var(--ink,#0c0c0c);color:#fff}
.est-mode em{font-style:normal;font-size:12.5px;color:var(--muted,#8a8a85);line-height:1.5;flex:1;min-width:220px}

.est-f{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted,#8a8a85)}
/* min-width:0 обязателен: у select минимальная ширина = длина самого длинного пункта списка,
   без этого длинное название изделия/ткани распирает карточку шире экрана на мобильном */
.est-f{min-width:0}
.est-f input,.est-f select{border:1.5px solid var(--line,#e6e6e3);border-radius:9px;padding:9px 10px;font-family:inherit;font-size:15px;font-weight:600;background:#fff;color:var(--ink,#0c0c0c);width:100%;min-width:0;max-width:100%}
.est-f select{cursor:pointer;height:40px;padding-right:30px;text-overflow:ellipsis}
/* «Вид ткани» шире — длинные названия ткани (с плотностью и составом) помещаются аккуратно */
.est-f-fab{grid-column:span 2;min-width:0}
@media(max-width:560px){ .est-f-fab{grid-column:auto} }
.est-f input:focus,.est-f select:focus{outline:none;border-color:var(--ink,#0c0c0c)}
.est-f i{font-style:normal;font-weight:600;text-transform:none;letter-spacing:normal;color:var(--muted,#8a8a85);font-size:11px}
.est-rates{border:1px solid var(--line,#e6e6e3);border-radius:16px;padding:6px 18px 16px;margin-bottom:16px;background:var(--bg-soft,#f4f4f3)}
.est-rates summary{cursor:pointer;font-size:12.5px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;color:var(--ink,#0c0c0c);padding:12px 0}
.est-rates-g{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.est-hint{font-size:12.5px;color:var(--muted,#8a8a85);margin-top:12px;line-height:1.6}
.est-hint b{color:var(--ink,#0c0c0c)}
/* minmax(0,1fr) + min-width:0 — карточка не может стать шире колонки:
   длинный текст (пункт списка, название материала) сжимается/переносится, а не распирает вёрстку */
.est-items{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;margin-bottom:16px}
.est-item{border:1px solid var(--line,#e6e6e3);border-radius:18px;padding:18px;background:#fff;min-width:0}
.est-item-h{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.est-item-h b{font-size:16px;font-weight:800;letter-spacing:-.01em;color:var(--ink,#0c0c0c)}
.est-item-h span{font-size:12.5px;font-weight:700;color:var(--muted,#8a8a85);text-transform:uppercase;letter-spacing:.06em}
.est-item-t{display:flex;align-items:center;gap:10px;min-width:0}
.est-photo{width:44px;height:44px;border-radius:9px;object-fit:cover;border:1px solid var(--line,#e6e6e3);flex:none}
.est-photo-btn{border:none;background:none;padding:0;cursor:pointer;flex:none;line-height:0}
.est-photo-ph{width:44px;height:44px;border-radius:9px;flex:none;background:#fff;border:1.5px dashed #c7c7c2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;cursor:pointer;color:#111;padding:0}
.est-photo-ph:hover{border-color:#0c0c0c}
.est-photo-ph .pp{font-size:16px;font-weight:800;line-height:1;color:#111}
.est-photo-ph .pl{font-size:8px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:#777;line-height:1.1}
.est-photo-ph-static{cursor:default}
/* крупное фото изделия (сайт): фото слева на всю высоту, справа сверху — выбор+кол-во, ниже — характеристики */
.est-big-top{display:flex;gap:16px;align-items:flex-start;margin-bottom:12px}
.est-big-right{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:12px}
.est-big-right .est-specs{margin-bottom:0}
.est-big .est-photo,.est-big .est-photo-btn .est-photo,.est-big .est-photo-ph{width:150px;height:172px;border-radius:14px}
.est-big .est-photo-ph{border-width:2px}
.est-big .est-photo-ph .pp{font-size:34px}
.est-big .est-photo-ph .pl{font-size:11px;letter-spacing:.06em}

.est-specs{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:12px}
.est-photo-cell{display:flex;align-items:flex-end}
.est-photo-add{border:1.5px dashed var(--line,#e6e6e3);background:transparent;border-radius:9px;padding:9px 12px;font:inherit;font-size:13px;font-weight:700;cursor:pointer;color:var(--ink,#0c0c0c);width:100%}
.est-photo-add:hover{border-color:var(--ink,#0c0c0c)}
.est-sewline{font-size:13px;color:var(--muted,#8a8a85);margin:0 0 12px;line-height:1.5}
.est-sewline b{color:var(--ink,#0c0c0c)}
.es-sub{display:block;font-size:10.5px;color:#666;font-weight:400;margin-top:2px}
/* самостоятельная смета: управление изделиями */
.est-mgr-h{display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap}
.est-mgr-ph{flex:none;display:flex}
.est-mgr-h>.est-mgr-ph{align-self:center}          /* маленькое фото (админка) — по центру строки */
.est-cap,.est-qty>span{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted,#8a8a85)}
/* выбор изделия: своя подпись сверху, окно сжимается (min-width:0) и ограничено по ширине,
   чтобы длинное название не выдавливало «Кол-во» — окна выбора и количества на одной линии */
.est-mgr-l{display:flex;flex-direction:column;gap:5px;flex:1 1 300px;min-width:0;max-width:560px}
.est-mgr-fields{display:flex;gap:10px;flex-wrap:wrap;min-width:0}
.est-mgr-fields select{border:1.5px solid var(--line,#e6e6e3);border-radius:10px;padding:0 12px;height:44px;font-family:inherit;font-size:15px;font-weight:600;background:var(--card,#fff);color:var(--ink,#0c0c0c);min-width:0;max-width:100%;flex:1 1 200px}
.est-mgr-fields input{border:1.5px solid var(--line,#e6e6e3);border-radius:10px;padding:0 12px;height:44px;font-family:inherit;font-size:15px;font-weight:500;background:var(--field,#fff);color:var(--ink,#0c0c0c);min-width:0;flex:1 1 160px}
.est-mgr-fields select:focus,.est-mgr-fields input:focus{outline:none;border-color:var(--ink,#0c0c0c)}
.est-qty{display:flex;flex-direction:column;gap:5px;width:120px;flex:none}
.est-qty input{border:1.5px solid var(--line,#e6e6e3);border-radius:10px;padding:0 12px;height:44px;font-family:inherit;font-size:16px;font-weight:700;background:var(--field,#fff);color:var(--ink,#0c0c0c);width:100%}
.est-qty input:focus{outline:none;border-color:var(--ink,#0c0c0c)}
.est-del{border:1px solid var(--line,#e6e6e3);background:transparent;border-radius:50%;width:36px;height:36px;cursor:pointer;color:var(--muted,#8a8a85);font-size:14px;flex:none;align-self:flex-start;margin-top:22px}
.est-del:hover{border-color:#c0392b;color:#c0392b}
.est-additem{width:100%;border:1.5px dashed var(--line,#e6e6e3);background:transparent;border-radius:16px;padding:16px;font:inherit;font-size:15px;font-weight:700;cursor:pointer;color:var(--ink,#0c0c0c);margin-bottom:16px}
.est-additem:hover{border-color:var(--ink,#0c0c0c)}
/* фурнитура — список позиций */
.est-hw{border:1px solid var(--line,#e6e6e3);border-radius:12px;padding:12px 14px;margin:0 0 14px;background:var(--bg-soft,#f7f7f5)}
.est-hw-h{display:flex;align-items:center;gap:10px}
/* кнопка-бар «Материалы» — явно тапабельная, с подписью «Показать/Скрыть» и шевроном */
.est-hw-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:1;min-width:0;
  background:var(--card,#fff);border:1.5px solid var(--line,#e6e6e3);border-radius:10px;padding:11px 14px;
  font:inherit;font-size:12px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--ink,#0c0c0c);cursor:pointer;line-height:1.2}
.est-hw-toggle{min-width:0}
.est-hw-toggle:hover{border-color:var(--ink,#0c0c0c)}
.est-hw-toggle.open{background:var(--bg-soft,#f4f4f3)}
.hw-tog-t{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hw-chev{flex:none;font-size:10.5px;font-weight:700;color:var(--muted,#8a8a85);white-space:nowrap}
.est-hw-body{margin-top:12px}
.est-hw-hbtns{display:flex;gap:8px;flex-wrap:wrap}
.est-hw-add{border:1.5px solid var(--line,#e6e6e3);background:var(--card,#fff);border-radius:999px;padding:7px 14px;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;color:var(--ink,#0c0c0c)}
.est-hw-add:hover{border-color:var(--ink,#0c0c0c)}
.est-hw-row{display:grid;grid-template-columns:1fr 116px 90px 100px 92px 34px;gap:8px;align-items:center;margin-bottom:8px}
/* ячейка поля с подписью: подпись скрыта на десктопе (есть строка-заголовок), видна на мобильном */
.hw-cell{display:flex;flex-direction:column;gap:4px;min-width:0}
.hw-cell input,.hw-cell select{width:100%}
.hw-lab{display:none;font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--muted,#8a8a85)}
.hw-c-sum{align-items:flex-end;justify-content:center}
/* строка-заголовок столбцов списка материалов */
.est-hw-head{margin-bottom:6px}
.est-hw-head span{font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--muted,#8a8a85);padding:0 2px}
.est-hw-head span:nth-child(3),.est-hw-head span:nth-child(4),.est-hw-head span:nth-child(5){text-align:right}
@media(max-width:640px){ .est-hw-head{display:none} }
.est-hw-row input,.est-hw-row select{border:1.5px solid var(--line,#e6e6e3);border-radius:9px;padding:9px 10px;font-family:inherit;font-size:14px;font-weight:500;background:var(--field,#fff);color:var(--ink,#0c0c0c);width:100%}
.est-hw-row input:focus,.est-hw-row select:focus{outline:none;border-color:var(--ink,#0c0c0c)}
.est-hw-row .hw-mode{font-size:12.5px;font-weight:600}
.est-hw-row .hw-num{text-align:right}
.est-hw-sum{font-size:14px;font-weight:800;text-align:right;color:var(--ink,#0c0c0c);white-space:nowrap;font-variant-numeric:tabular-nums}
.est-hw-del{border:1px solid var(--line,#e6e6e3);background:transparent;border-radius:50%;width:32px;height:32px;cursor:pointer;color:var(--muted,#8a8a85);font-size:13px}
.est-hw-del:hover{border-color:#c0392b;color:#c0392b}
.est-hw-empty{font-size:12.5px;color:var(--muted,#8a8a85);line-height:1.5;margin:0}
/* мобильная: каждый материал — компактная карточка с подписями полей */
@media(max-width:640px){
  .est-hw-h{flex-wrap:wrap}
  .est-hw-toggle{flex:1 1 100%}
  .est-hw-add{flex:1 1 100%;text-align:center}
  .hw-lab{display:block}
  .est-hw-row{grid-template-columns:1fr 1fr;gap:10px 12px;align-items:end;
    padding:12px;border:1px solid var(--line,#e6e6e3);border-radius:12px;background:var(--card,#fff);margin-bottom:12px}
  .est-hw-row .hw-c-name,.est-hw-row .hw-c-mode{grid-column:1 / -1}
  .est-hw-row .hw-num{text-align:left}
  .est-hw-row .hw-c-sum{align-items:flex-start}
  .est-hw-row .hw-c-sum .est-hw-sum{font-size:17px}
  .est-hw-row .est-hw-del{align-self:center;justify-self:end;width:36px;height:36px}
}
.est-sew{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.est-sew .est-f{max-width:160px}
.est-sew em{font-style:normal;font-size:12px;color:var(--muted,#8a8a85);line-height:1.5;flex:1;min-width:180px}
.est-tw{overflow-x:auto}
.est-t{width:100%;border-collapse:collapse;font-size:14px}
.est-t th{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--muted,#8a8a85);text-align:left;padding:6px 10px;border-bottom:1.5px solid var(--line,#e6e6e3)}
.est-t td{padding:9px 10px;border-bottom:1px solid var(--line,#e6e6e3);vertical-align:top;color:var(--ink,#0c0c0c)}
.est-t .r{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.est-t tfoot td{border-bottom:none;border-top:2px solid var(--ink,#0c0c0c);font-weight:800;padding-top:11px}
.est-t tfoot b{font-size:16px}
.est-t tr.est-mut td{color:var(--muted,#8a8a85)}
.est-note{display:block;font-size:11.5px;font-weight:500;color:var(--muted,#8a8a85);text-transform:none;letter-spacing:normal;margin-top:2px}
.est-sum{border:2px solid var(--ink,#0c0c0c);border-radius:20px;padding:20px;margin-bottom:16px}
.est-sum-h{font-size:12.5px;font-weight:800;text-transform:uppercase;letter-spacing:.12em;color:var(--muted,#8a8a85);margin-bottom:14px}
.est-sum-g{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:14px}
.est-sum-g div span{display:block;font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted,#8a8a85);margin-bottom:4px}
.est-sum-g div b{font-size:19px;font-weight:900;letter-spacing:-.02em;color:var(--ink,#0c0c0c)}
.est-sum-g .big b{font-size:24px}
.est-sum-g .big span{color:var(--ink,#0c0c0c)}
.est-toggle{display:flex;align-items:center;gap:9px;font-size:14px;font-weight:600;color:var(--ink,#0c0c0c);margin:0 2px 16px;cursor:pointer}
.est-toggle input{width:17px;height:17px;accent-color:#0c0c0c}
.est-retail{border:1px solid var(--line,#e6e6e3);border-radius:20px;padding:20px;background:#0c0c0c;color:#fff}
.est-retail-h{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.est-retail-h span{font-size:12.5px;font-weight:800;text-transform:uppercase;letter-spacing:.12em;color:#b9b9b6}
.est-mk{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#b9b9b6}
.est-mk input{width:64px;border:1.5px solid #3a3a3a;background:#161616;color:#fff;border-radius:8px;padding:7px 9px;font-family:inherit;font-size:14px;font-weight:700}
.est-mk input:focus{outline:none;border-color:#fff}
.est-price{font-size:38px;font-weight:900;letter-spacing:-.03em;margin:8px 0 14px}
.est-price i{font-style:normal;font-size:16px;font-weight:700;color:#b9b9b6;margin-left:4px}
.est-t-r{font-size:14px}
.est-t-r td{border-color:#262626;color:#e9e9e6}
.est-t-r .est-note{color:#9a9a95}
.est-t-r tfoot td{border-top-color:#fff;color:#fff}
.est-tax-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:16px 0 4px}
.est-tax-row .est-f span{color:#9a9a95}
.est-tax-row .est-f input{background:#161616;border-color:#3a3a3a;color:#fff}
.est-order{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:16px;padding-top:16px;border-top:1px solid #262626}
.est-order span{display:block;font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#9a9a95;margin-bottom:4px}
.est-order b{font-size:21px;font-weight:900;letter-spacing:-.02em}
@media(max-width:760px){ .est-tax-row{grid-template-columns:1fr} .est-order{grid-template-columns:1fr} }

/* печатный лист: смета */
.es-h{font-size:16px;font-weight:900;text-transform:uppercase;margin:18px 0 8px}
.es-t{width:100%;border-collapse:collapse;font-size:12px;margin-bottom:8px}
.es-t th,.es-t td{border:1px solid #999;padding:5px 7px}
.es-t th{background:#f0f0f0;text-align:left;font-size:10px;text-transform:uppercase;letter-spacing:.06em}
.es-t .r{text-align:right;white-space:nowrap}
.es-rt{font-size:11.5px;color:#333;line-height:1.6}
.es-item{border:1px solid #ddd;border-radius:8px;padding:12px;margin:0 0 12px}
.es-ihead{display:flex;align-items:center;gap:12px;margin-bottom:8px;page-break-inside:avoid;page-break-after:avoid}
/* печать: изделие течёт по страницам без пустот, таблица рвётся по строкам с повтором шапки */
.es-t tr{page-break-inside:avoid}
.es-t thead{display:table-header-group}
.es-h{page-break-after:avoid}
.es-photo{width:64px;height:64px;object-fit:cover;border-radius:6px;border:1px solid #ddd;flex:none}
.es-photo-ph-print{background:#fff;border:1.5px dashed #bbb;object-fit:unset;display:inline-flex;align-items:center;justify-content:center;text-align:center;font-size:8px;font-weight:700;text-transform:uppercase;color:#777;line-height:1.1;padding:2px}
.es-iname b{font-size:15px}.es-iname span{display:block;color:#666;font-size:11.5px;margin-top:2px}
.es-note{display:block;color:#777;font-size:10.5px;margin-top:2px}.es-mut td{color:#999}
.es-total tfoot td{background:#111;color:#fff}
.es-t th,.es-total tfoot td{-webkit-print-color-adjust:exact;print-color-adjust:exact}

/* мобильная: фото изделия крупно сверху на всю ширину, данные — под ним, всё в границах экрана */
@media(max-width:640px){
  .est-item{padding:14px}
  .est-big-top{flex-direction:column;gap:14px;min-width:0}
  .est-big-right{width:100%;min-width:0}
  .est-big .est-mgr-ph{width:100%}
  .est-big .est-photo-btn{width:100%;display:block}
  .est-big .est-photo,.est-big .est-photo-btn .est-photo,.est-big .est-photo-ph{width:100%;height:300px;border-radius:16px}
  /* «Изделие» — на всю ширину; «Кол-во» и крестик — одной ровной строкой под ним */
  .est-mgr-h{gap:10px;align-items:flex-end}
  .est-mgr-l{flex:1 1 100%;max-width:none}
  .est-qty{flex:1 1 auto;width:auto;min-width:0}
  .est-del{margin-top:0;align-self:flex-end;margin-bottom:4px}
  /* характеристики: две ровные колонки, «Вид ткани» — на всю ширину */
  .est-specs{grid-template-columns:1fr 1fr;gap:10px}
  .est-f-fab{grid-column:1 / -1}
  /* таблица затрат: фиксированная раскладка — вписывается в ширину экрана без бокового скролла */
  .est-t{font-size:13px;table-layout:fixed;width:100%}
  .est-t th:first-child,.est-t td:first-child{width:44%}
  .est-t th,.est-t td{padding:8px 6px;overflow-wrap:anywhere}
  .est-t .r{white-space:normal}
  .est-t th:first-child,.est-t td:first-child{padding-left:0}
  .est-t th:last-child,.est-t td:last-child{padding-right:0}
  .est-sum{padding:16px}
  .est-sum-g{grid-template-columns:1fr 1fr;gap:12px}
}
