/* Калькулятор — стили в палитре stroybaget.ru (scoped) */

.bc-calc {
  --panel: #ffffff;
  --ink: #2d2d2d;
  --muted: #7a7a7a;
  --line: #e5e2db;
  --accent: #c2205f;
  --accent-dk: #a0184d;
  --accent-soft: #e35a92;
  --blue: #1f8ecc;
  --shadow: 0 8px 28px rgba(45, 45, 45, 0.08);
  --f-head: "Roboto Slab", Georgia, serif;
  --f-body: "Roboto Slab", system-ui, sans-serif;
}

.bc-calc * { box-sizing: border-box; }

.bc-calc .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

.bc-calc .grid {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 22px;
  padding: 20px 0 40px;
  align-items: start;
}

.bc-calc .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.bc-calc .result { position: sticky; top: 16px; }

.bc-calc .panel h2 {
  margin: 0 0 14px;
  font-family: var(--f-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.bc-calc .panel h3 {
  margin: 18px 0 8px;
  font-family: var(--f-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.bc-calc fieldset {
  border: 1px solid var(--line);
  border-radius: 0;
  margin: 0 0 14px;
  padding: 12px 14px 14px;
  background: var(--paper-soft, #faf8f4);
}

.bc-calc legend {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  padding: 0 6px;
}

.bc-calc .preset-box select {
  width: 100%;
  margin-top: 4px;
  font-family: var(--f-body);
  font-size: 14px;
}

.bc-calc .preset-hint {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 0;
  background: #fff;
  border: 1px dashed var(--line);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}

.bc-calc label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
  font-family: var(--f-body);
}

.bc-calc label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  cursor: pointer;
}

.bc-calc label.check input { width: auto; accent-color: var(--accent); }

.bc-calc .hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  user-select: none;
}

.bc-calc .hint::after,
.bc-calc .hint::before {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 50;
  pointer-events: none;
}

.bc-calc .hint::after {
  content: attr(data-tip);
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 0;
  background: #2b2b2b;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.bc-calc .hint::before {
  content: "";
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2b2b2b;
}

.bc-calc .hint:hover::after,
.bc-calc .hint:hover::before,
.bc-calc .hint:focus::after,
.bc-calc .hint:focus::before {
  opacity: 1;
  visibility: visible;
}

.bc-calc input,
.bc-calc select {
  width: 100%;
  margin-top: 4px;
  padding: 9px 11px;
  font: inherit;
  font-family: var(--f-body);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bc-calc select,
.pk-filters select {
  padding: 9px 36px 9px 12px;
  cursor: pointer;
  background-color: #faf8f4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238a8580' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' d='M4.5 6.25 8 9.75l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px 16px;
  -webkit-appearance: none;
  appearance: none;
}

.pk-filters select { margin-top: 0; }

.bc-calc select:hover,
.pk-filters select:hover {
  border-color: #cfc9c0;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23c2205f' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' d='M4.5 6.25 8 9.75l3.5-3.5'/%3E%3C/svg%3E");
}

.bc-calc input:focus,
.bc-calc select:focus,
.pk-filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 32, 95, 0.12);
}

.bc-calc select:focus,
.pk-filters select:focus {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23c2205f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4.5 6.25 8 9.75l3.5-3.5'/%3E%3C/svg%3E");
}

.bc-calc select option,
.pk-filters select option {
  color: var(--ink, #2d2d2d);
  background: #fff;
}

.bc-calc .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bc-calc .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.bc-calc .row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.bc-calc .preview-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0 16px;
  border-bottom: 1px solid var(--line);
}

.bc-calc .preview {
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border-radius: 0;
  padding: 16px;
  overflow: hidden;
}

.bc-calc .preview svg {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  border-radius: 0;
}

.bc-calc .preview svg image {
  image-rendering: auto;
}

.bc-calc .preview-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.35;
  margin: 0 2px 8px;
}

.bc-calc .preview-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 4px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--ink);
}

.bc-calc .preview-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bc-calc .preview-toggle-ui {
  flex: 0 0 42px;
  height: 24px;
  border-radius: 999px;
  background: #d8d2c8;
  position: relative;
  transition: background 0.2s ease;
}

.bc-calc .preview-toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.bc-calc .preview-toggle input:checked + .preview-toggle-ui {
  background: var(--accent, #c2205f);
}

.bc-calc .preview-toggle input:checked + .preview-toggle-ui::after {
  transform: translateX(18px);
}

.bc-calc .preview-toggle-label {
  line-height: 1.3;
}

.bc-calc .preview-meta { font-size: 13px; color: var(--muted); }
.bc-calc .preview-meta > div:first-child { font-size: 15px; margin-bottom: 6px; }
.bc-calc .preview-meta b { color: var(--ink); }

.bc-calc .thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bc-calc .thumb { margin: 0; width: 150px; text-align: center; }
.bc-calc .thumb img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  background: #faf8f4;
  border-radius: 0;
  border: 1px solid var(--line);
}
.bc-calc .thumb figcaption {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  word-break: break-all;
}

.bc-calc table.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--f-body);
}

.bc-calc table.spec th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid var(--line);
  padding: 6px;
  font-size: 12px;
}

.bc-calc table.spec td {
  padding: 6px;
  border-bottom: 1px solid var(--line);
}

.bc-calc table.spec .num { text-align: right; white-space: nowrap; }
.bc-calc table.spec tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--line);
  border-bottom: none;
  color: var(--accent-dk);
}

.bc-calc table.spec.small td { padding: 5px 6px; }
.bc-calc .muted { color: var(--muted); font-style: italic; }

.bc-calc .grand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 18px;
  padding: 16px 18px;
  background: linear-gradient(120deg, var(--accent-dk), var(--accent));
  color: #fff;
  border-radius: 0;
  box-shadow: 0 12px 28px -10px rgba(194, 32, 95, 0.55);
}

.bc-calc .grand span {
  font-family: var(--f-head);
  font-size: 15px;
  font-weight: 700;
}

.bc-calc .grand b { font-size: 28px; font-weight: 900; }
.bc-calc .note { font-size: 11px; color: var(--muted); margin-top: 12px; line-height: 1.45; }
.bc-calc .note-phone { white-space: nowrap; }

.bc-calc .slotrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.bc-calc .slotrow-label { flex: 0 0 78px; font-size: 13px; color: var(--muted); }

.bc-calc .slot {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
}

.bc-calc .slot.filled { border-color: rgba(194, 32, 95, 0.25); }
.bc-calc .slot-empty { flex: 1; font-size: 13px; color: var(--muted); font-style: italic; }

.bc-calc .slot-thumb {
  flex: 0 0 72px;
  height: 72px;
  border-radius: 0;
  overflow: hidden;
  background: #faf8f4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bc-calc .slot-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bc-calc .slot-swatch { display: block; width: 100%; height: 100%; }
.bc-calc .slot-info { flex: 1; min-width: 0; }
.bc-calc .slot-art { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-calc .slot-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-calc .slot-buttons { display: flex; gap: 6px; flex-wrap: wrap; }

.bc-calc .slot-btn {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--f-body);
  cursor: pointer;
  background: var(--paper-soft, #faf8f4);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.bc-calc .slot-btn:hover { background: #f0ebe3; border-color: #d8d2c8; }

.bc-calc .slot-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.bc-calc .slot-btn.primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.bc-calc .slot-btn.danger { color: #b42318; padding: 8px 12px; }

.bc-calc .mini {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--f-body);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.bc-calc .mini.danger { color: #b42318; }

.bc-calc .dropzone {
  position: relative;
  margin-top: 10px;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: 0;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  color: var(--muted);
  font-size: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.bc-calc .dropzone:hover,
.bc-calc .dropzone:focus {
  border-color: var(--accent);
  outline: none;
}

.bc-calc .dropzone.dragover {
  border-color: var(--accent);
  background-color: rgba(194, 32, 95, 0.06);
}

.bc-calc .dropzone.has-image {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border-style: solid;
  padding: 8px 10px;
  overflow: hidden;
  background: #f7f4ee;
}

.bc-calc .dz-preview {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 0;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.bc-calc .dropzone.has-image .dz-controls {
  margin-left: auto;
  width: auto;
  background: none;
  padding: 0;
}

.bc-calc .dz-hint[hidden],
.bc-calc .dz-controls[hidden] {
  display: none !important;
}

.bc-calc .dz-controls {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  padding: 8px 10px;
  box-sizing: border-box;
}

.bc-calc .dropzone:not(.has-image) .dz-controls {
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 0;
}

/* Модальный каталог */
html.pk-lock { overflow: hidden; }

.bc-calc .pk-overlay,
.pk-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(30, 22, 12, 0.55);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bc-calc .pk-overlay.open,
.pk-overlay.open { display: flex; }

.bc-calc .pk-modal,
.pk-modal {
  width: min(920px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  font-family: var(--f-body);
}

.bc-calc .pk-head,
.pk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(120deg, var(--accent-dk, #a0184d), var(--accent, #c2205f));
  color: #fff;
}

.bc-calc .pk-head h3,
.pk-head h3 { margin: 0; font-size: 17px; font-family: var(--f-head); }

.bc-calc .pk-close,
.pk-close {
  width: auto;
  margin: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: none;
  font-size: 22px;
  line-height: 1;
  padding: 2px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.bc-calc .pk-close:hover,
.pk-close:hover { background: rgba(255, 255, 255, 0.3); }

.bc-calc .pk-filters,
.pk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line, #e5e2db);
}

.bc-calc .pk-filters .pk-search,
.pk-filters .pk-search { flex: 1 1 220px; margin: 0; }

.bc-calc .pk-filters .pk-color,
.bc-calc .pk-filters .pk-grp,
.bc-calc .pk-filters .pk-subcat,
.pk-filters .pk-color,
.pk-filters .pk-grp,
.pk-filters .pk-subcat {
  flex: 0 0 auto;
  min-width: 130px;
  margin: 0;
}

.bc-calc .pk-wrap-width,
.pk-wrap-width { display: flex; gap: 6px; }
.bc-calc .pk-wrap-width input,
.pk-wrap-width input {
  width: 120px;
  margin: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.bc-calc .pk-wrap-width input::-webkit-outer-spin-button,
.bc-calc .pk-wrap-width input::-webkit-inner-spin-button,
.pk-wrap-width input::-webkit-outer-spin-button,
.pk-wrap-width input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bc-calc .pk-count,
.pk-count { margin-left: auto; font-size: 12px; color: var(--muted, #7a7a7a); }

.bc-calc .pk-grid,
.pk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: stretch;
  flex: 1 1 auto;
  gap: 14px;
  padding: 16px 18px;
  overflow-y: auto;
  min-height: 0;
}

.bc-calc .pk-empty,
.pk-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted, #7a7a7a);
  padding: 30px;
  font-style: italic;
}

.bc-calc .pk-card,
.pk-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line, #e5e2db);
  border-radius: 0;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  padding: 0;
  cursor: pointer;
  font: inherit;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}

.bc-calc .pk-card:hover,
.pk-card:hover {
  box-shadow: 0 8px 28px rgba(45, 45, 45, 0.08);
  border-color: var(--accent, #c2205f);
  transform: translateY(-1px);
}

.bc-calc .pk-card.is-selected,
.pk-card.is-selected {
  border-color: var(--accent, #c2205f);
  box-shadow: 0 0 0 2px var(--accent, #c2205f) inset;
}

.bc-calc .pk-thumb,
.pk-thumb {
  height: 210px;
  flex: 0 0 auto;
  background: #faf8f4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.bc-calc .pk-thumb img,
.pk-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.bc-calc .pk-swatch,
.pk-swatch { width: 70%; height: 70%; border-radius: 0; }
.bc-calc .pk-swatch.pk-noimg,
.pk-swatch.pk-noimg {
  display: flex; align-items: center; justify-content: center;
  opacity: 0.85;
}
.bc-calc .pk-swatch.pk-noimg span,
.pk-swatch.pk-noimg span {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.92);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.bc-calc .pk-info,
.pk-info {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  gap: 2px;
  flex: 1 1 auto;
}

.bc-calc .pk-art,
.pk-art {
  font-weight: 700;
  font-size: 13px;
  word-break: break-word;
  line-height: 1.25;
  color: var(--ink, #2d2d2d);
}

.bc-calc .pk-meta,
.pk-meta { font-size: 11px; color: var(--muted, #7a7a7a); }

.bc-calc .pk-price,
.pk-price {
  font-size: 13px;
  color: var(--accent-dk, #a0184d);
  font-weight: 700;
  margin-top: 2px;
}

.bc-calc .pk-pager,
.pk-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  border-top: 1px solid var(--line, #e5e2db);
}

.bc-calc .pk-pager button,
.pk-pager button {
  width: auto;
  margin: 0;
  padding: 8px 16px;
  cursor: pointer;
  background: #faf8f4;
  border: 1px solid var(--line, #e5e2db);
  border-radius: 999px;
  font-family: var(--f-body);
  font-weight: 600;
}

.bc-calc .pk-pager button:disabled,
.pk-pager button:disabled { opacity: 0.4; cursor: default; }

.bc-calc .pk-page,
.pk-page {
  font-size: 13px;
  color: var(--muted, #7a7a7a);
  min-width: 60px;
  text-align: center;
}

@media (max-width: 960px) {
  .bc-calc .grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0 32px;
  }
  .bc-calc .result {
    position: static;
    order: -1;
  }
  .bc-calc .panel {
    padding: 18px 16px;
  }
}

@media (max-width: 720px) {
  .bc-calc .row3 { grid-template-columns: 1fr 1fr; }
  .bc-calc .grand b { font-size: 24px; }
  .bc-calc .thumb,
  .bc-calc .thumb img {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 640px) {
  .bc-calc .wrap {
    padding: 0 12px;
  }
  .bc-calc .panel h2 { font-size: 20px; }
  .bc-calc fieldset {
    padding: 10px 12px 12px;
  }
  .bc-calc .row2,
  .bc-calc .row3 {
    grid-template-columns: 1fr;
  }
  .bc-calc .row4 { grid-template-columns: 1fr 1fr; }
  .bc-calc .slotrow {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .bc-calc .slotrow-label {
    flex: none;
    font-weight: 600;
    color: var(--ink);
  }
  .bc-calc .slot {
    flex-wrap: wrap;
    min-height: 0;
    padding: 10px;
  }
  .bc-calc .slot-info { min-width: 0; flex: 1 1 120px; }
  .bc-calc .slot-buttons {
    width: 100%;
    justify-content: flex-start;
  }
  .bc-calc .slot-btn { flex: 1 1 auto; text-align: center; }
  .bc-calc .preview {
    min-height: 220px;
    padding: 12px;
  }
  .bc-calc .preview-toggle {
    align-items: flex-start;
    gap: 8px;
  }
  .bc-calc .preview-toggle-label { font-size: 12px; }
  .bc-calc .dropzone:not(.has-image) {
    min-height: 96px;
    padding: 12px;
  }
  .bc-calc .dropzone.has-image {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .bc-calc .dropzone.has-image .dz-controls {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .bc-calc .grand {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 16px;
  }
  .bc-calc .spec-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px 4px;
  }
  .bc-calc table.spec { min-width: 320px; }
  .bc-calc .pk-overlay,
  .pk-overlay {
    padding: 0;
    align-items: stretch;
  }
  .bc-calc .pk-modal,
  .pk-modal {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .bc-calc .pk-grid,
  .pk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }
  .bc-calc .pk-thumb,
  .pk-thumb { height: 130px; }
  .bc-calc .pk-head,
  .pk-head { padding: 12px 14px; }
  .bc-calc .pk-filters,
  .pk-filters {
    padding: 10px 12px;
    gap: 8px;
  }
  .bc-calc .pk-count,
  .pk-count {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }
}

@media (max-width: 400px) {
  .bc-calc .row4 { grid-template-columns: 1fr; }
  .bc-calc .pk-grid,
  .pk-grid { grid-template-columns: 1fr; }
  .bc-calc .thumb,
  .bc-calc .thumb img {
    width: 100%;
    max-width: 140px;
    height: auto;
    aspect-ratio: 1;
  }
}

.bc-calc .spec-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 560px) {
  .bc-calc .row4 { grid-template-columns: 1fr 1fr; }
  .bc-calc .pk-filters .pk-color,
  .bc-calc .pk-filters .pk-grp,
  .bc-calc .pk-filters .pk-subcat,
  .bc-calc .pk-wrap-width input,
  .pk-filters .pk-color,
  .pk-filters .pk-grp,
  .pk-filters .pk-subcat,
  .pk-wrap-width input {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
}

/* Loading/error state for server-authoritative baguette prices. */
.bc-calc .bc-material-status { max-width: 1320px; margin: 16px auto; padding: 16px 24px; color: #2d2d2d; background: #fff; border: 1px solid #c3c4c7; }
.bc-calc .bc-material-status[hidden] { display: none; }
.bc-calc .bc-material-status p { margin: 0 0 8px; }
.bc-calc .bc-material-status button { padding: 10px 14px; background: #fff; border: 1px solid #333; color: #222; font: inherit; cursor: pointer; }
.bc-calc .bc-material-status button:hover { background: #f6f4f2; }
.bc-calc .bc-material-status button:focus-visible { outline: 2px solid #2271b1; outline-offset: 3px; }
.bc-calc .bc-material-status.is-error { border-color: #b32d2e; }

/* Shared calculator controls: keep native values as a fallback until enhanced. */
.bc-calc select.bc-native-select,
.pk-filters select.bc-native-select { display: none !important; }
.bc-select { display: block; min-width: 0; margin-top: 4px; }
.bc-select[hidden], .bc-select-list[hidden], .bc-help-tooltip[hidden] { display: none !important; }
.bc-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 10px 12px;
  border: 1px solid #cfc9c0; border-radius: 0; background: #faf8f4;
  color: #2d2d2d; font: 400 15px/1.4 "Roboto Slab", Georgia, serif;
  text-align: left; cursor: pointer;
}
.bc-select-trigger:hover { background: #fff; border-color: #a69f95; }
.bc-select-trigger:focus-visible, .bc-select-trigger[aria-expanded="true"] {
  outline: 2px solid #c2205f; outline-offset: 2px;
}
.bc-select-trigger:disabled { opacity: .5; cursor: default; }
.bc-select-value { min-width: 0; overflow-wrap: anywhere; }
.bc-select-trigger svg { width: 18px; height: 18px; flex: 0 0 18px; color: #7a7066; }
.bc-select-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.bc-select-list {
  position: fixed; z-index: 1200; box-sizing: border-box; margin: 0; padding: 6px;
  max-width: calc(100vw - 16px); overflow: auto; overscroll-behavior: contain;
  background: #fff; color: #2d2d2d; border-radius: 0;
  box-shadow: 0 8px 24px rgba(45,45,45,.2);
  font: 400 15px/1.4 "Roboto Slab", Georgia, serif;
  scrollbar-width: thin; scrollbar-color: #a69f95 #faf8f4;
}
.bc-select-option {
  position: relative; box-sizing: border-box; min-height: 44px; padding: 11px 34px 11px 12px;
  cursor: pointer; overflow-wrap: anywhere;
}
.bc-select-option.is-active { background: #f8e5ed; color: #8b1742; }
.bc-select-option[aria-selected="true"] { font-weight: 700; }
.bc-select-option[aria-selected="true"]::after {
  content: ""; position: absolute; right: 14px; top: 16px;
  width: 6px; height: 11px; border: solid #c2205f;
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.bc-select-option[aria-disabled="true"] { opacity: .5; cursor: default; }
.bc-select-group { padding: 12px 12px 5px; font-size: 13px; font-weight: 700; color: #6e6155; }
.bc-calc .hint[data-bc-hint]::before, .bc-calc .hint[data-bc-hint]::after { display: none; }
.bc-calc .hint[data-bc-hint] { cursor: pointer; }
.bc-calc .hint[data-bc-hint]:focus-visible { outline: 2px solid #c2205f; outline-offset: 3px; }
.bc-help-tooltip {
  position: fixed; z-index: 1300; box-sizing: border-box; padding: 11px 13px;
  max-width: calc(100vw - 16px); overflow: auto; overscroll-behavior: contain;
  color: #fff; background: #2b2b2b; border-radius: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  font: 400 13px/1.5 "Roboto Slab", Georgia, serif; overflow-wrap: anywhere;
}
.pk-head, .pk-filters, .pk-pager { flex: 0 0 auto; }
.pk-filters .pk-search { flex: 1 1 100%; }
.pk-filters .bc-select { flex: 0 1 230px; margin: 0; min-width: 0; }
.pk-filters input {
  box-sizing: border-box;
  min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #cfc9c0;
  border-radius: 0; color: #2d2d2d; background: #fff;
  font: 400 15px/1.4 "Roboto Slab", Georgia, serif;
}
.pk-filters input::placeholder { color: #726a62; opacity: 1; }
.pk-filters input:focus-visible, .pk-card:focus-visible { outline: 2px solid #c2205f; outline-offset: 2px; }
.pk-filters .pk-wrap-width { flex: 0 1 270px; min-width: 0; }
.pk-filters .pk-wrap-width input { flex: 1; min-width: 0; }
.pk-card .pk-info { flex-shrink: 0; padding: 10px; }
.pk-card .pk-art, .pk-card .pk-meta, .pk-card .pk-price { overflow-wrap: anywhere; }
.bc-select-list ::selection, .pk-filters ::selection { color: #fff; background: #a0184d; }
@media (max-width: 640px) {
  .bc-select-trigger, .bc-select-list, .pk-filters input { font-size: 16px; }
  .pk-filters .bc-select { flex: 1 1 160px; }
  .pk-filters .pk-wrap-width { flex-basis: 100%; }
}
