/* Konfigurator — style oparte o zmienne motywu, z fallbackami, zeby ten sam
   plik dzialal na Astrze na domekialtanka.pl bez przerabiania. */

.drewno-cfg-launch {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--color-border, #e2e2e2);
  border-radius: 12px;
  background: var(--brand-50, #f7f7f7);
}
.drewno-cfg-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-primary, #111);
  color: var(--brand-on-primary, #fff);
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}
.drewno-cfg-open:hover { background: var(--brand-600, #0d0d0d); }
.drewno-cfg-launch-note {
  margin: 10px 0 0;
  color: var(--color-text-muted, #737373);
  font-size: 14px;
}

body.drewno-cfg-open-body { overflow: hidden; }

.drewno-cfg-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .55);
}
.drewno-cfg-panel {
  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  /* Stala wysokosc, nie max-height: inaczej okno rosnie i kurczy sie przy kazdej
     zmianie kroku, a stopka z cena skacze po ekranie. */
  height: min(92vh, 900px);
  border-radius: 14px;
  background: #fff;
  color: var(--color-text, #1a1a1a);
  font-family: var(--font-body, system-ui, sans-serif);
  overflow: hidden;
}

.drewno-cfg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border, #e2e2e2);
}
.drewno-cfg-kicker {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted, #737373);
}
.drewno-cfg-head h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.25; }
.drewno-cfg-close {
  border: 0;
  background: none;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted, #737373);
}

.drewno-cfg-steps {
  display: flex;
  gap: 6px;
  padding: 12px 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border, #e2e2e2);
}
.drewno-cfg-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--color-border, #e2e2e2);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.drewno-cfg-step-n {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-100, #e3e3e3);
  font-size: 11px;
  font-weight: 600;
}
.drewno-cfg-step.is-current {
  border-color: var(--brand-primary, #111);
  background: var(--brand-primary, #111);
  color: var(--brand-on-primary, #fff);
}
.drewno-cfg-step.is-current .drewno-cfg-step-n { background: rgba(255, 255, 255, .25); }
.drewno-cfg-step.is-done .drewno-cfg-step-n { background: var(--brand-300, #9e9e9e); color: #fff; }

.drewno-cfg-body {
  flex: 1;
  min-height: 0;
  padding: 20px 24px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drewno-cfg-cat { margin-bottom: 28px; }
.drewno-cfg-cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.drewno-cfg-cat-head h3 { margin: 0; font-size: 17px; }
.drewno-cfg-cat-hint { font-size: 12px; color: var(--color-text-muted, #737373); }

.drewno-cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.drewno-cfg-opt {
  display: flex;
  transition: border-color .12s ease, box-shadow .12s ease, opacity .12s ease;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border, #e2e2e2);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.drewno-cfg-opt:hover:not([disabled]) { border-color: var(--brand-300, #9e9e9e); }
.drewno-cfg-opt.is-selected {
  border-color: var(--brand-primary, #111);
  box-shadow: inset 0 0 0 1px var(--brand-primary, #111);
}
.drewno-cfg-opt.is-blocked { opacity: .45; cursor: not-allowed; }
.drewno-cfg-opt.is-permanent { cursor: default; background: var(--brand-50, #f7f7f7); }
.drewno-cfg-opt img {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
}
.drewno-cfg-opt-body { flex: 1; min-width: 0; }
.drewno-cfg-opt-name { display: block; font-weight: 600; font-size: 14px; line-height: 1.35; }
.drewno-cfg-opt-desc,
.drewno-cfg-why {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--color-text-muted, #737373);
}
.drewno-cfg-why { font-style: italic; }
.drewno-cfg-opt-price {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.drewno-cfg-km h3 { margin: 0 0 8px; font-size: 18px; }
.drewno-cfg-km-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 14px;
}
.drewno-cfg-km-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}
.drewno-cfg-km-row input {
  padding: 9px 12px;
  border: 1px solid var(--color-border, #e2e2e2);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
}
.drewno-cfg-calc {
  padding: 10px 18px;
  border: 1px solid var(--brand-primary, #111);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.drewno-cfg-note { margin: 8px 0 0; font-size: 13px; color: var(--color-text-muted, #737373); }
.drewno-cfg-error { margin: 12px 0 0; color: #b32d2e; font-size: 13px; }

.drewno-cfg-sum-tbl { width: 100%; border-collapse: collapse; margin-top: 12px; }
.drewno-cfg-sum-tbl th,
.drewno-cfg-sum-tbl td {
  padding: 9px 4px;
  border-bottom: 1px solid var(--color-border, #e2e2e2);
  text-align: left;
  font-weight: 400;
  font-size: 14px;
}
.drewno-cfg-sum-tbl td { text-align: right; white-space: nowrap; }
.drewno-cfg-sum-cat {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted, #737373);
}
.drewno-cfg-sum-tbl tfoot th,
.drewno-cfg-sum-tbl tfoot td { font-weight: 700; font-size: 16px; border-bottom: 0; }

.drewno-cfg-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--color-border, #e2e2e2);
  background: var(--brand-50, #f7f7f7);
}
.drewno-cfg-total { display: flex; flex-direction: column; }
.drewno-cfg-total span { font-size: 12px; color: var(--color-text-muted, #737373); }
/* Szerokosc kwoty na tabularnych cyfrach — inaczej stopka drga przy przeliczaniu. */
.drewno-cfg-total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.drewno-cfg-opt-price { font-variant-numeric: tabular-nums; }
.drewno-cfg-km-note { font-size: 11px; }
.drewno-cfg-nav { display: flex; gap: 8px; }
.drewno-cfg-nav button {
  padding: 11px 22px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e2e2e2);
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.drewno-cfg-nav button[disabled] { opacity: .4; cursor: not-allowed; }
.drewno-cfg-next,
.drewno-cfg-submit {
  border-color: var(--brand-primary, #111) !important;
  background: var(--brand-primary, #111) !important;
  color: var(--brand-on-primary, #fff);
}

@media (max-width: 640px) {
  .drewno-cfg-modal { padding: 0; }
  .drewno-cfg-panel { height: 100vh; border-radius: 0; width: 100%; }
  .drewno-cfg-grid { grid-template-columns: 1fr; }
  .drewno-cfg-foot { flex-direction: column; align-items: stretch; }
  .drewno-cfg-nav { justify-content: space-between; }
}

/* ---------- formularz zapytania w podsumowaniu ---------- */

.drewno-cfg-form {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border, #e2e2e2);
}
.drewno-cfg-form h4 { margin: 0 0 14px; font-size: 16px; }
.drewno-cfg-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.drewno-cfg-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}
.drewno-cfg-field--wide { margin-top: 12px; }
.drewno-cfg-field input,
.drewno-cfg-field textarea {
  padding: 9px 12px;
  border: 1px solid var(--color-border, #e2e2e2);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  width: 100%;
  box-sizing: border-box;
}
.drewno-cfg-field textarea { resize: vertical; }
.drewno-cfg-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
}
.drewno-cfg-consent input { margin-top: 2px; }
.drewno-cfg-sent {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--brand-primary, #111);
  border-radius: 10px;
  background: var(--brand-50, #f7f7f7);
}
.drewno-cfg-sent p { margin: 6px 0 0; font-size: 14px; color: var(--color-text-muted, #737373); }
.drewno-cfg-submit[disabled] { opacity: .55; cursor: default; }

/* Belka krokow przewija sie poziomo, ale pasek przewijania tylko zabiera miejsce
   i psuje wyglad — chowamy go, gest przewijania zostaje. */
.drewno-cfg-steps {
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* dawne Edge/IE */
}
.drewno-cfg-steps::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Powiększanie obrazków opcji (prośba klienta 02.10): miniatura z lupą + podgląd na całym ekranie. */
.drewno-cfg-zoom { position: relative; flex: 0 0 auto; display: inline-block; cursor: zoom-in; line-height: 0; }
.drewno-cfg-zoom-ico {
  position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand-primary, #111); color: #fff; font-size: 14px; line-height: 18px; text-align: center;
}
.drewno-cfg-lightbox {
  position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center;
  background: rgba(0, 0, 0, .8); cursor: zoom-out; padding: 24px;
}
.drewno-cfg-lightbox img { max-width: min(92vw, 1100px); max-height: 88vh; object-fit: contain; background: #fff; border-radius: 6px; }
.drewno-cfg-lightbox button {
  position: absolute; top: 16px; right: 20px; border: 0; background: none; color: #fff; font-size: 40px; cursor: pointer;
}

/* Pasek kroków: na komputerze wszystkie kroki widoczne naraz (zawijane), żeby nie znikały pierwsze
   kroki i było widać, że da się wrócić. Na telefonie zostaje przewijanie w bok. */
@media (min-width: 768px) {
  .drewno-cfg-steps { flex-wrap: wrap; overflow-x: visible; }
}
.drewno-cfg-step.is-done { border-color: var(--brand-300, #9e9e9e); }
.drewno-cfg-prev:not([disabled]) { font-weight: 600; }
.drewno-cfg-opt[aria-disabled="true"].is-blocked { cursor: not-allowed; }
.drewno-cfg-opt[aria-disabled="true"].is-permanent { cursor: default; }
