/** Konfigurator szycia — ETAP 2 */
.kfs-configurator {
  margin: 1rem 0;
  clear: both;
  color: #222;
}

.kfs-configurator * {
  box-sizing: border-box;
}

.kfs-card {
  position: relative;
  border: 1px solid #e7e2dc;
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.045);
}

.kfs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.kfs-header h3,
.kfs-section-heading h4 {
  margin: 0;
  color: #151515;
}

.kfs-header h3 {
  font-size: 20px;
  line-height: 1.3;
}

.kfs-header-note,
.kfs-section-heading p,
.kfs-muted,
.kfs-help {
  color: #666;
  line-height: 1.45;
}

.kfs-header-note {
  margin: 5px 0 0;
  font-size: 13px;
}

.kfs-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #777;
}

.kfs-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.kfs-section {
  border-top: 1px solid #eee9e3;
  padding: 18px 0;
}

.kfs-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.kfs-section-heading {
  margin-bottom: 12px;
}

.kfs-section-heading h4 {
  font-size: 16px;
  line-height: 1.35;
}

.kfs-section-heading p {
  margin: 4px 0 0;
  font-size: 13px;
}

.kfs-dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.kfs-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
}

.kfs-input-action {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.kfs-input-action input {
  min-width: 90px;
  flex: 1 1 auto;
  height: 42px;
  border: 1px solid #d6d0c8;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: #222;
}

.kfs-input-action input:disabled {
  background: #f6f3ef;
  color: #555;
}


.kfs-input-action {
  flex-wrap: wrap;
}

.kfs-input-action input.has-error,
.kfs-input-action input.has-error:focus {
  border-color: #ff3b30;
  box-shadow: none;
  outline: none;
}

.kfs-help {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

.kfs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
}

.kfs-btn--secondary {
  background: #222;
  color: #fff;
}

.kfs-btn--ghost {
  background: #fff;
  color: #222;
  border-color: #d6d0c8;
}

.kfs-btn.is-confirmed {
  background: #ffffff;
  border-color: #cfd8e3;
  color: #111827;
}

.kfs-btn.is-confirmed::before {
  content: "✓";
  display: inline-block;
  margin-right: 6px;
  color: #16a34a;
  font-weight: 900;
}

.kfs-input-action input.is-confirmed {
  background: #f3f4f6;
  color: #374151;
}

.kfs-btn--primary {
  width: 100%;
  background: #111;
  color: #fff;
  min-height: 48px;
}

.kfs-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.kfs-hidden {
  display: none !important;
}

.kfs-locked-area {
  transition: opacity .18s ease, filter .18s ease;
}

.kfs-locked-area.is-disabled {
  opacity: .48;
  filter: grayscale(10%);
  pointer-events: none;
  user-select: none;
}

.kfs-accordion-list {
  display: grid;
  gap: 10px;
}

.kfs-accordion {
  border: 1px solid #e1dbd3;
  border-radius: 12px;
  background: #fff;
  overflow: visible;
}

.kfs-accordion__toggle {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: #faf8f5;
  border: 0;
  color: #222;
  text-align: left;
  cursor: pointer;
}

.kfs-accordion__toggle strong {
  display: block;
  font-size: 15px;
}

.kfs-accordion__toggle em {
  display: block;
  margin-top: 3px;
  color: #666;
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
}

.kfs-accordion__icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  position: relative;
}

.kfs-accordion__icon:before,
.kfs-accordion__icon:after {
  content: '';
  position: absolute;
  background: #222;
  border-radius: 1px;
  transition: transform .16s ease;
}

.kfs-accordion__icon:before {
  top: 8px;
  left: 3px;
  width: 12px;
  height: 2px;
}

.kfs-accordion__icon:after {
  top: 3px;
  left: 8px;
  width: 2px;
  height: 12px;
}

.kfs-accordion.is-open .kfs-accordion__icon:after {
  transform: scaleY(0);
}

.kfs-accordion__body {
  padding: 12px;
  background: #fff;
}

.kfs-option-list {
  display: grid;
  gap: 10px;
}

.kfs-option {
  position: relative;
  display: grid;
  grid-template-columns: auto 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 74px;
  padding: 10px;
  border: 1px solid #e7e2dc;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.kfs-option:hover,
.kfs-option.is-selected {
  border-color: #222;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .06);
}

.kfs-option.is-selected {
  background: #fcfaf7;
}

.kfs-option input[type="radio"] {
  margin-top: 26px;
  accent-color: #111;
}

.kfs-option__media {
  position: relative;
  width: 72px;
  height: 54px;
}

.kfs-thumb {
  display: block;
  width: 72px;
  height: 54px;
  padding: 0;
  border: 1px solid #ddd7cf;
  border-radius: 10px;
  overflow: hidden;
  background: #f7f3ef;
  cursor: zoom-in;
}

.kfs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kfs-thumb--empty:before {
  content: 'brak zdjęcia';
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-size: 10px;
  color: #777;
  text-align: center;
}

.kfs-option__content {
  min-width: 0;
}

.kfs-option__title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.kfs-option__desc,
.kfs-option__tip {
  display: block;
  margin-top: 4px;
  color: #666;
  font-size: 12px;
  line-height: 1.38;
}

.kfs-option__tip {
  color: #8a6b36;
}

.kfs-option__price {
  display: block;
  min-width: 64px;
  min-height: 18px;
  padding-top: 1px;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.kfs-surcharge-list {
  display: grid;
  gap: 6px;
}

.kfs-surcharge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.35;
}

.kfs-surcharge-row strong {
  white-space: nowrap;
}

.kfs-surcharge-row--total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e1dbd3;
  font-weight: 700;
}

.kfs-preview-popover {
  position: fixed;
  z-index: 9999;
  width: min(320px, calc(100vw - 28px));
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ddd7cf;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .18);
  pointer-events: none;
}

.kfs-preview-popover:before {
  content: '';
  position: absolute;
  top: 22px;
  left: -8px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid #ddd7cf;
  border-bottom: 1px solid #ddd7cf;
  transform: rotate(45deg);
}

.kfs-preview-popover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  border-radius: 8px;
}

.kfs-preview-popover__caption {
  margin-top: 6px;
  font-size: 12px;
  color: #555;
  text-align: center;
}

.kfs-dependent-empty,
.kfs-surcharge-box,
.kfs-summary-box {
  border: 1px dashed #d8d1c8;
  border-radius: 12px;
  padding: 12px;
  background: #fbfaf8;
  color: #666;
  font-size: 13px;
}

.kfs-dependent-group {
  border: 1px solid #e1dbd3;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.kfs-dependent-group__head {
  margin-bottom: 10px;
}

.kfs-dependent-group__head strong,
.kfs-dependent-group__head span {
  display: block;
}

.kfs-dependent-group__head span {
  margin-top: 3px;
  color: #666;
  font-size: 12px;
}

.kfs-summary-box p {
  margin: 4px 0;
}

.kfs-actions {
  padding-top: 2px;
}

.kfs-actions .kfs-muted {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
}

.kfs-mobile-preview {
  display: none;
}

.kfs-native-cart-hidden {
  display: none !important;
}

@media (min-width: 768px) {
  .kfs-option:hover .kfs-thumb:after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 0 2px #111;
    pointer-events: none;
  }
}

@media (max-width: 991px) {
  .kfs-dimension-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .kfs-configurator {
    margin: 12px 0;
  }

  .kfs-card {
    padding: 14px;
    border-radius: 12px;
  }

  .kfs-header {
    flex-direction: column;
    gap: 8px;
  }

  .kfs-input-action {
    flex-direction: column;
  }

  .kfs-btn {
    width: 100%;
  }

  .kfs-option {
    grid-template-columns: auto 64px minmax(0, 1fr);
    gap: 10px;
    padding: 9px;
  }

  .kfs-option__media,
  .kfs-thumb {
    width: 64px;
    height: 50px;
  }

  .kfs-option input[type="radio"] {
    margin-top: 23px;
  }

  .kfs-mobile-preview {
    position: sticky;
    top: 0;
    z-index: 50;
    display: none;
    margin: -2px 0 12px;
    padding: 8px;
    border: 1px solid #ddd7cf;
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
  }

  .kfs-mobile-preview.is-visible {
    display: block;
  }

  .kfs-mobile-preview img {
    display: block;
    width: 100%;
    max-height: 42vh;
    object-fit: contain;
    border-radius: 9px;
    background: #f7f3ef;
  }

  .kfs-mobile-preview__caption {
    margin-top: 6px;
    padding-right: 34px;
    font-size: 12px;
    color: #555;
  }

  .kfs-mobile-preview__close {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }
}

/* ETAP 2.1 — czyszczenie frontend UX */
.kfs-dependent-section[hidden] {
  display: none !important;
}

.kfs-dimensions {
  padding-top: 0;
}

.kfs-dimension-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.kfs-field label {
  font-weight: 700;
  color: #151515;
}

@media (max-width: 767px) {
  .kfs-input-action {
    flex-direction: row;
    align-items: stretch;
  }

  .kfs-input-action input {
    min-width: 0;
  }

  .kfs-input-action .kfs-btn {
    width: auto;
    flex: 0 0 auto;
    padding-left: 12px;
    padding-right: 12px;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .kfs-input-action {
    flex-direction: column;
  }

  .kfs-input-action .kfs-btn {
    width: 100%;
  }
}

/* ETAP 2.2 — dopasowanie UX do konfigurator_firany_new */
body#product .kfs-configurator,
body#product .kfs-configurator * {
  text-align: left;
}

body#product .kfs-configurator {
  width: 100%;
  max-width: 620px;
  margin: 18px 0 20px;
  color: #111827;
}

body#product .kfs-card {
  padding: 16px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

body#product .kfs-section {
  border-top: 1px solid #e5e7eb;
  padding: 14px 0;
}

body#product .kfs-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

body#product .kfs-section-heading h4 {
  color: #111827;
  font-size: 15px;
  font-weight: 800;
}

body#product .kfs-field label {
  margin: 0 0 7px;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

body#product .kfs-input-action {
  gap: 10px;
}

body#product .kfs-input-action input {
  height: 42px;
  min-height: 42px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  box-shadow: none;
}

body#product .kfs-input-action input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.10);
  outline: none;
}

body#product .kfs-input-action input:disabled {
  background: #f9fafb;
  color: #374151;
  opacity: 1;
}

body#product .kfs-btn {
  border-radius: 10px;
  font-weight: 800;
}

body#product .kfs-btn--secondary {
  background: #111827;
  color: #ffffff;
}

body#product .kfs-btn--ghost {
  background: #ffffff;
  color: #111827;
  border-color: #cfd8e3;
}

body#product .kfs-btn--primary {
  background: #111827;
  color: #ffffff;
}

body#product .kfs-accordion-list {
  gap: 8px;
}

body#product .kfs-accordion {
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #ffffff;
}

body#product .kfs-accordion__toggle {
  min-height: 54px;
  padding: 12px 14px;
  background: #f9fafb;
  color: #111827;
}

body#product .kfs-accordion__toggle strong {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}

body#product .kfs-accordion__toggle em {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

body#product .kfs-accordion__body {
  padding: 10px;
  background: #ffffff;
}

body#product .kfs-option {
  grid-template-columns: auto 72px minmax(0, 1fr) 72px;
  align-items: center;
  min-height: 64px;
  padding: 9px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #ffffff;
}

body#product .kfs-option:hover,
body#product .kfs-option.is-selected {
  border-color: #111827;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

body#product .kfs-option.is-selected {
  background: #f9fafb;
}

body#product .kfs-option input[type="radio"] {
  margin-top: 0;
  accent-color: #111827;
}

body#product .kfs-option__content {
  min-width: 0;
  text-align: left;
}

body#product .kfs-option__title {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

body#product .kfs-option__desc,
body#product .kfs-option__tip {
  color: #374151;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

body#product .kfs-option__tip {
  color: #7c5b16;
}

body#product .kfs-option__price {
  min-width: 64px;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

body#product .kfs-surcharge-row--total {
  border-top-color: #dbe4f0;
}

body#product .kfs-thumb {
  border-color: #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
}

body#product .kfs-preview-popover {
  z-index: 2147482000;
  width: 360px;
  max-width: min(360px, 38vw);
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.24);
  overflow: visible;
}

body#product .kfs-preview-popover:before {
  display: none;
}

body#product .kfs-preview-popover:after {
  content: '';
  position: absolute;
  top: var(--kfs-preview-arrow-y, 50%);
  width: 0;
  height: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

body#product .kfs-preview-popover.is-left:after {
  right: -12px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 12px solid #ffffff;
}

body#product .kfs-preview-popover.is-right:after {
  left: -12px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 12px solid #ffffff;
}

body#product .kfs-preview-popover img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
}

body#product .kfs-preview-popover__caption {
  margin-top: 6px;
  color: #374151;
  font-size: 12px;
  text-align: center;
}

body#product .kfs-dependent-empty,
body#product .kfs-surcharge-box,
body#product .kfs-summary-box {
  border-color: #dbe4f0;
  background: #f9fafb;
  color: #374151;
}

@media (max-width: 767px) {
  body#product .kfs-card {
    padding: 14px;
  }

  body#product .kfs-input-action {
    flex-direction: row;
  }

  body#product .kfs-input-action input {
    min-width: 0;
  }

  body#product .kfs-input-action .kfs-btn {
    width: auto;
    flex: 0 0 auto;
    padding-left: 12px;
    padding-right: 12px;
    white-space: nowrap;
  }

  body#product .kfs-option {
    grid-template-columns: auto 64px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
  }

  body#product .kfs-option__media,
  body#product .kfs-thumb {
    width: 64px;
    height: 50px;
  }

  body#product .kfs-option input[type="radio"] {
    margin-top: 0;
  }

  body#product .kfs-mobile-preview {
    border-color: #d1d5db;
    background: rgba(255,255,255,.98);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
  }
}

/* ETAP 2.3 — miniaturki i przyciski jak w konfigurator_firany_new */
body#product .kfs-option {
  grid-template-columns: auto 42px minmax(0, 1fr);
  min-height: 52px;
  padding: 10px 12px;
  gap: 10px;
  background: #f9fafb;
  overflow: visible;
}

body#product .kfs-option:hover,
body#product .kfs-option.is-selected {
  background: #ffffff;
}

body#product .kfs-option__media,
body#product .kfs-thumb {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
}

body#product .kfs-thumb {
  border-radius: 6px;
}

body#product .kfs-thumb img {
  object-fit: cover;
}

body#product .kfs-option input[type="radio"] {
  margin: 0;
}

body#product .kfs-btn[data-kfs-change].is-confirmed {
  gap: 0;
}

body#product .kfs-btn[data-kfs-change].is-confirmed::before {
  content: "✓" !important;
  display: inline-block !important;
  margin-right: 6px;
  color: #16a34a;
  font-weight: 900;
}

body#product .kfs-btn[data-kfs-change].is-confirmed::after {
  content: none !important;
  display: none !important;
}

@media (max-width: 767px) {
  body#product .kfs-option {
    grid-template-columns: auto 42px minmax(0, 1fr);
  }

  body#product .kfs-option__media,
  body#product .kfs-thumb {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
  }
}

/* ETAP 2.7 — grupa zależna inline wyśrodkowana pod wybraną opcją główną */
.kfs-option-stack {
  display: grid;
  gap: 8px;
}

.kfs-dependent-group--inline {
  width: calc(100% - 36px);
  margin: 8px auto 2px auto;
  border-color: #e4d8c8;
  background: #fffaf3;
}

.kfs-dependent-group--inline[hidden] {
  display: none !important;
}

.kfs-dependent-group--inline .kfs-dependent-group__head {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #efe5d8;
}

.kfs-dependent-group--inline .kfs-dependent-group__head strong {
  color: #111827;
  font-size: 14px;
}

.kfs-dependent-group--inline .kfs-option-list {
  gap: 8px;
}

@media (max-width: 767px) {
  .kfs-dependent-group--inline {
    width: calc(100% - 18px);
    margin-left: auto;
    margin-right: auto;
  }
}


/* ETAP 2.8 — główny konfigurator zwinięty na starcie */
body#product .kfs-main-toggle {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid #111827;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
}

body#product .kfs-main-toggle__icon::before {
  content: '+';
  display: inline-block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

body#product .kfs-main-toggle[aria-expanded="true"] .kfs-main-toggle__icon::before {
  content: '−';
}

body#product .kfs-configurator.is-collapsed .kfs-card {
  display: none !important;
}

body#product .kfs-configurator.is-expanded .kfs-card {
  display: block;
  margin-top: 8px;
}

body#product .kfs-configurator.is-expanded .kfs-main-toggle {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

@media (max-width: 767px) {
  body#product .kfs-main-toggle {
    min-height: 44px;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 14px;
  }
}


@media (max-width: 520px) {
  body#product .kfs-option {
    grid-template-columns: auto 64px minmax(0, 1fr) 60px;
  }

  body#product .kfs-option__media,
  body#product .kfs-thumb {
    width: 64px;
    height: 48px;
  }

  body#product .kfs-option__price {
    min-width: 56px;
    font-size: 12px;
  }
}


/* ETAP 2.10 — dopłata widoczna inline przy nazwie, bez rozpychania karty opcji */
body#product .kfs-option {
  grid-template-columns: auto 42px minmax(0, 1fr) !important;
}

body#product .kfs-option__content {
  min-width: 0;
}

body#product .kfs-option__title {
  display: flex !important;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

body#product .kfs-option__title > span:first-child {
  min-width: 0;
}

body#product .kfs-option__price {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0;
  padding: 1px 6px;
  border: 1px solid #d6b46b;
  border-radius: 999px;
  background: #fff7e6;
  color: #7c4a03 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.35;
  text-align: left !important;
  white-space: nowrap;
}

body#product .kfs-option__price:empty {
  display: none !important;
}

@media (max-width: 520px) {
  body#product .kfs-option {
    grid-template-columns: auto 42px minmax(0, 1fr) !important;
  }

  body#product .kfs-option__title {
    gap: 6px;
  }

  body#product .kfs-option__price {
    padding: 1px 5px;
    font-size: 10px !important;
  }
}


/* ETAP 2.11 — korekta badge dopłat i czytelne wyróżnienie grup zależnych */
body#product .kfs-option__title {
  align-items: center !important;
  flex-wrap: wrap;
  gap: 6px;
}

body#product .kfs-option__price {
  position: relative;
  top: 0;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 18px;
  min-height: 18px !important;
  padding: 0 7px !important;
  border: 1px solid #d8b261 !important;
  border-radius: 9px !important;
  background: #fff8e8 !important;
  color: #7a4a00 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 18px !important;
  box-sizing: border-box;
  white-space: nowrap;
  vertical-align: middle;
}

body#product .kfs-dependent-group--inline {
  background: #fff8ee !important;
  border: 1px solid #ead6b8 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}

body#product .kfs-dependent-group--inline .kfs-dependent-group__head {
  background: #fff4e4;
  margin: -12px -12px 10px -12px;
  padding: 10px 12px 9px 12px;
  border-bottom: 1px solid #ead6b8 !important;
  border-radius: 11px 11px 0 0;
}

body#product .kfs-dependent-group--inline .kfs-option {
  background: #ffffff !important;
}

body#product .kfs-dependent-group--inline .kfs-option:hover {
  background: #fffdf9 !important;
}

@media (max-width: 520px) {
  body#product .kfs-option__price {
    height: 17px;
    min-height: 17px !important;
    padding: 0 6px !important;
    border-radius: 9px !important;
    font-size: 10px !important;
    line-height: 17px !important;
  }
}


/* ETAP 2.12 — miniaturki wybranych wariantów w podsumowaniu */
body#product .kfs-summary-visual {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

body#product .kfs-summary-visual[hidden] {
  display: none !important;
}

body#product .kfs-summary-visual__row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid #e3dcd3;
  border-radius: 10px;
  background: #ffffff;
}

body#product .kfs-summary-visual__media {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #e0d8cf;
  border-radius: 8px;
  background: #faf8f5;
  overflow: hidden;
  cursor: default;
}

body#product button.kfs-summary-visual__media {
  cursor: zoom-in;
}

body#product .kfs-summary-visual__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body#product button.kfs-summary-visual__media::after {
  content: '⌕';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.42);
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  opacity: 0;
  transition: opacity .14s ease;
  pointer-events: none;
}

body#product button.kfs-summary-visual__media:hover::after,
body#product button.kfs-summary-visual__media:focus-visible::after {
  opacity: 1;
}

body#product .kfs-summary-visual__text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

body#product .kfs-summary-visual__label {
  color: #777;
  font-size: 11px;
  line-height: 1.2;
}

body#product .kfs-summary-visual__text strong {
  color: #222;
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

body#product .kfs-summary-visual__price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 7px;
  border: 1px solid #d8b261;
  border-radius: 9px;
  background: #fff8e8;
  color: #7a4a00;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  body#product .kfs-summary-visual__row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px;
  }

  body#product .kfs-summary-visual__media {
    width: 38px;
    height: 38px;
  }

  body#product .kfs-summary-visual__price {
    height: 17px;
    padding: 0 6px;
    font-size: 10px;
    line-height: 17px;
  }
}


/* ETAP 2.13 — kwadratowe miniaturki w podsumowaniu + lupa i podgląd po kliknięciu */
body#product .kfs-summary-visual__media:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

/* ETAP 2.14 — podgląd miniaturki w podsumowaniu zamykany po opuszczeniu miniaturki i preview */
body#product .kfs-preview-popover.is-interactive,
.kfs-preview-popover.is-interactive {
  pointer-events: auto;
}


/* ETAP 2.15 — cache-safe frontend UX fixes */
body#product .kfs-input-action {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

body#product .kfs-input-action input {
  flex: 1 1 auto;
  min-width: 0;
}

body#product .kfs-input-action .kfs-btn {
  flex: 0 1 auto;
  white-space: nowrap;
  max-width: 48%;
}

body#product .kfs-thumb,
body#product .kfs-thumb:focus,
body#product .kfs-thumb:active,
body#product .kfs-thumb:focus-visible,
body#product button.kfs-summary-visual__media,
body#product button.kfs-summary-visual__media:focus,
body#product button.kfs-summary-visual__media:active,
body#product button.kfs-summary-visual__media:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

body#product button.kfs-summary-visual__media:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
}

@media (max-width: 520px) {
  body#product .kfs-card {
    padding-left: 12px;
    padding-right: 12px;
    overflow: hidden;
  }

  body#product .kfs-input-action {
    gap: 8px;
  }

  body#product .kfs-input-action input {
    flex-basis: 0;
    height: 40px;
    min-height: 40px;
    padding-left: 10px;
    padding-right: 10px;
  }

  body#product .kfs-input-action .kfs-btn {
    min-height: 40px;
    padding-left: 9px;
    padding-right: 9px;
    font-size: 12px;
    line-height: 1.1;
    max-width: 44%;
  }
}

@media (max-width: 380px) {
  body#product .kfs-input-action .kfs-btn {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 11px;
    max-width: 43%;
  }
}

/* ETAP 2.16 — realne poprawki mobile + wymuszony brak ramek miniaturek */
html body#product #kfs-configurator,
html body#product #kfs-configurator * {
  box-sizing: border-box;
}

html body#product #kfs-configurator .kfs-card {
  max-width: 100%;
  overflow: hidden;
}

html body#product #kfs-configurator .kfs-dimension-grid {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

html body#product #kfs-configurator .kfs-input-action {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(108px, auto) !important;
  gap: 8px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

html body#product #kfs-configurator .kfs-input-action input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: none !important;
}

html body#product #kfs-configurator .kfs-input-action .kfs-btn {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 118px !important;
  flex: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

html body#product #kfs-configurator .kfs-thumb,
html body#product #kfs-configurator .kfs-thumb:hover,
html body#product #kfs-configurator .kfs-thumb:focus,
html body#product #kfs-configurator .kfs-thumb:active,
html body#product #kfs-configurator .kfs-thumb:focus-visible,
html body#product #kfs-configurator .kfs-thumb:visited,
html body#product #kfs-configurator button.kfs-summary-visual__media,
html body#product #kfs-configurator button.kfs-summary-visual__media:hover,
html body#product #kfs-configurator button.kfs-summary-visual__media:focus,
html body#product #kfs-configurator button.kfs-summary-visual__media:active,
html body#product #kfs-configurator button.kfs-summary-visual__media:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

html body#product #kfs-configurator .kfs-option:hover .kfs-thumb::after,
html body#product #kfs-configurator .kfs-thumb::after {
  display: none !important;
  content: none !important;
  box-shadow: none !important;
}

@media (max-width: 520px) {
  html body#product #kfs-configurator {
    max-width: 100% !important;
    overflow: hidden !important;
  }

  html body#product #kfs-configurator .kfs-card {
    padding: 12px !important;
  }

  html body#product #kfs-configurator .kfs-field label {
    font-size: 12px !important;
    line-height: 1.25 !important;
    margin-bottom: 5px !important;
  }

  html body#product #kfs-configurator .kfs-input-action {
    grid-template-columns: minmax(0, 1fr) 92px !important;
    gap: 7px !important;
  }

  html body#product #kfs-configurator .kfs-input-action input {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 9px !important;
    font-size: 14px !important;
  }

  html body#product #kfs-configurator .kfs-input-action .kfs-btn {
    max-width: none !important;
    min-height: 40px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    letter-spacing: -0.01em !important;
  }

  html body#product #kfs-configurator .kfs-btn[data-kfs-change].is-confirmed::before {
    margin-right: 4px !important;
  }
}

@media (max-width: 380px) {
  html body#product #kfs-configurator .kfs-input-action {
    grid-template-columns: minmax(0, 1fr) 82px !important;
    gap: 6px !important;
  }

  html body#product #kfs-configurator .kfs-input-action .kfs-btn {
    font-size: 10px !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
}


/* ETAP 2.17 — pełne nazwy przycisków wymiarów mobile/desktop */
html body#product #kfs-configurator .kfs-input-action {
  grid-template-columns: minmax(0, 1fr) 158px !important;
}

html body#product #kfs-configurator .kfs-input-action .kfs-btn {
  max-width: none !important;
  min-width: 150px !important;
  width: 158px !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  font-size: 12px !important;
  letter-spacing: 0 !important;
}

@media (min-width: 768px) {
  html body#product #kfs-configurator .kfs-input-action {
    grid-template-columns: minmax(0, 1fr) 170px !important;
  }
  html body#product #kfs-configurator .kfs-input-action .kfs-btn {
    width: 170px !important;
    min-width: 170px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 520px) {
  html body#product #kfs-configurator .kfs-input-action {
    grid-template-columns: minmax(0, 1fr) 150px !important;
    gap: 7px !important;
  }
  html body#product #kfs-configurator .kfs-input-action .kfs-btn {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 380px) {
  html body#product #kfs-configurator .kfs-input-action {
    grid-template-columns: minmax(0, 1fr) 142px !important;
    gap: 6px !important;
  }
  html body#product #kfs-configurator .kfs-input-action .kfs-btn {
    width: 142px !important;
    min-width: 142px !important;
    max-width: 142px !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
    font-size: 10.5px !important;
  }
}

/* ETAP 2.18 — mobile preview jako stały podgląd w viewport, bez przewijania strony */
@media (max-width: 767px) {
  body#product .kfs-mobile-preview,
  .kfs-mobile-preview {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
    left: 12px !important;
    right: 12px !important;
    z-index: 9999 !important;
    display: none;
    margin: 0 !important;
    max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px));
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body#product .kfs-mobile-preview.is-visible,
  .kfs-mobile-preview.is-visible {
    display: block !important;
  }

  body#product .kfs-mobile-preview img,
  .kfs-mobile-preview img {
    width: 100%;
    max-height: min(46vh, 420px);
    object-fit: contain;
  }

  body#product .kfs-mobile-preview__close,
  .kfs-mobile-preview__close {
    position: absolute;
    right: 10px;
    bottom: 10px;
  }
}


/* ETAP 2.22 — przycisk zamykania mobilnego preview w prawym dolnym rogu obrazka */
.kfs-mobile-preview__image-wrap {
  position: relative;
  display: block;
}

@media (max-width: 767px) {
  body#product .kfs-mobile-preview__image-wrap,
  .kfs-mobile-preview__image-wrap {
    position: relative !important;
    display: block !important;
  }

  body#product .kfs-mobile-preview__close,
  .kfs-mobile-preview__close {
    position: absolute !important;
    right: 8px !important;
    bottom: 8px !important;
    left: auto !important;
    top: auto !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    transform: none !important;
    opacity: 0.82 !important;
    background: rgba(0, 0, 0, 0.82) !important;
  }

  body#product .kfs-mobile-preview__close:hover,
  body#product .kfs-mobile-preview__close:focus,
  .kfs-mobile-preview__close:hover,
  .kfs-mobile-preview__close:focus {
    opacity: 0.95 !important;
    background: rgba(0, 0, 0, 0.9) !important;
  }
}

/* ETAP 2.23 — mobile preview: krzyżyk w prawym dolnym rogu całej ramki preview */
@media (max-width: 767px) {
  body#product .kfs-mobile-preview,
  .kfs-mobile-preview {
    position: fixed !important;
  }

  body#product .kfs-mobile-preview__image-wrap,
  .kfs-mobile-preview__image-wrap {
    position: static !important;
  }

  body#product .kfs-mobile-preview__close,
  .kfs-mobile-preview__close {
    position: absolute !important;
    right: 10px !important;
    bottom: 10px !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    z-index: 3 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 24px !important;
    background: rgba(0, 0, 0, .78) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18) !important;
  }

  body#product .kfs-mobile-preview__caption,
  .kfs-mobile-preview__caption {
    padding-right: 48px !important;
    min-height: 34px !important;
    display: flex !important;
    align-items: center !important;
  }
}


/* ETAP 2.24 — blok Dopłaty ukryty w konfiguratorze; architektura zostaje pod kolejne etapy */
.kfs-surcharge--hidden,
[data-kfs-section="surcharge"].kfs-surcharge--hidden {
  display: none !important;
}


/* ETAP 2.25 CLEAN-SAFE — utrwalenie końcowego UX Etapu 2 */
html body#product #kfs-configurator .kfs-input-action {
  grid-template-columns: minmax(0, 1fr) 170px !important;
}
html body#product #kfs-configurator .kfs-input-action .kfs-btn {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
@media (max-width: 520px) {
  html body#product #kfs-configurator .kfs-input-action {
    grid-template-columns: minmax(0, 1fr) 150px !important;
  }
  html body#product #kfs-configurator .kfs-input-action .kfs-btn {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    font-size: 11px !important;
  }
}
@media (max-width: 380px) {
  html body#product #kfs-configurator .kfs-input-action {
    grid-template-columns: minmax(0, 1fr) 142px !important;
  }
  html body#product #kfs-configurator .kfs-input-action .kfs-btn {
    width: 142px !important;
    min-width: 142px !important;
    max-width: 142px !important;
    font-size: 10.5px !important;
  }
}
html body#product #kfs-configurator [data-kfs-section="surcharge"] {
  display: none !important;
}

/* ETAP 3 — kalkulacja, walidacja inline i dynamiczne podsumowanie */
.kfs-field-error {
  display: block;
  flex: 0 0 100%;
  order: 10;
  margin: -2px 0 0;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  color: #d71920;
}

.kfs-field-error[hidden] {
  display: none !important;
}

.kfs-calculation {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.kfs-calculation p {
  margin: 4px 0;
}

.kfs-calculation span {
  font-weight: 500;
}


/* ETAP 3 v1.2.7 — dymki przy wymiarach jak w konfigurator_firany_new, poprawka desktop */
body#product #kfs-configurator .kfs-field-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
  max-width: 100%;
  line-height: 1.35;
}

body#product #kfs-configurator .kfs-field-label > span:first-child {
  display: inline;
}

body#product #kfs-configurator .kfs-field-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  border-radius: 999px;
  background: #eef2ff;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  outline: none;
  vertical-align: middle;
  flex: 0 0 18px;
  z-index: 20;
}

body#product #kfs-configurator .kfs-field-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

body#product #kfs-configurator .kfs-field-tooltip-box {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 9999;
  width: max-content;
  max-width: min(300px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

body#product #kfs-configurator .kfs-field-tooltip-box::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-right: 1px solid #dbe4f0;
  border-bottom: 1px solid #dbe4f0;
  transform: translate(-50%, -5px) rotate(45deg);
}

body#product #kfs-configurator .kfs-field-tooltip:hover .kfs-field-tooltip-box,
body#product #kfs-configurator .kfs-field-tooltip:focus .kfs-field-tooltip-box,
body#product #kfs-configurator .kfs-field-tooltip:focus-within .kfs-field-tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}


@media (min-width: 577px) {
  html body#product #kfs-configurator .kfs-card {
    overflow: visible !important;
  }

  body#product #kfs-configurator .kfs-field-tooltip-box {
    position: fixed !important;
    left: var(--kfs-tooltip-desktop-left, 50vw) !important;
    top: var(--kfs-tooltip-desktop-top, 0px) !important;
    right: auto !important;
    bottom: auto !important;
    width: 280px;
    max-width: calc(100vw - 24px);
    transform: translate(-50%, 4px);
  }

  body#product #kfs-configurator .kfs-field-tooltip:hover .kfs-field-tooltip-box,
  body#product #kfs-configurator .kfs-field-tooltip:focus .kfs-field-tooltip-box,
  body#product #kfs-configurator .kfs-field-tooltip:focus-within .kfs-field-tooltip-box,
  body#product #kfs-configurator .kfs-field-tooltip.is-desktop-active .kfs-field-tooltip-box {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  body#product #kfs-configurator .kfs-field-tooltip-box::after {
    left: var(--kfs-tooltip-arrow-left, 50%) !important;
  }

  body#product #kfs-configurator .kfs-field-tooltip.kfs-tooltip-below .kfs-field-tooltip-box::after {
    top: 0 !important;
    bottom: auto !important;
    transform: translate(-50%, -5px) rotate(225deg) !important;
    border-right: 1px solid #dbe4f0;
    border-bottom: 1px solid #dbe4f0;
    border-left: 0;
    border-top: 0;
  }

  body#product #kfs-configurator .kfs-field-tooltip.kfs-tooltip-above .kfs-field-tooltip-box::after {
    top: 100% !important;
    bottom: auto !important;
    transform: translate(-50%, -5px) rotate(45deg) !important;
    border-right: 1px solid #dbe4f0;
    border-bottom: 1px solid #dbe4f0;
    border-left: 0;
    border-top: 0;
  }
}

@media (max-width: 576px) {
  body#product #kfs-configurator .kfs-field-label {
    text-align: left;
    line-height: 1.25;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
  }

  body#product #kfs-configurator .kfs-field-tooltip {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    flex-basis: 28px;
    margin-left: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  body#product #kfs-configurator .kfs-field-tooltip-icon {
    width: 18px;
    height: 18px;
    font-size: 12px;
    border-radius: 999px;
  }

  body#product #kfs-configurator .kfs-field-tooltip:hover .kfs-field-tooltip-box,
  body#product #kfs-configurator .kfs-field-tooltip:focus .kfs-field-tooltip-box,
  body#product #kfs-configurator .kfs-field-tooltip:focus-within .kfs-field-tooltip-box {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body#product #kfs-configurator .kfs-field-tooltip-box {
    position: fixed !important;
    left: var(--kfs-tooltip-mobile-left, 50vw) !important;
    right: auto !important;
    top: var(--kfs-tooltip-mobile-top, 96px) !important;
    bottom: auto !important;
    width: max-content !important;
    max-width: calc(100vw - 32px) !important;
    min-width: 0 !important;
    z-index: 99999 !important;
    transform: translate(-50%, 0) !important;
    pointer-events: none !important;
  }

  body#product #kfs-configurator .kfs-field-tooltip.is-mobile-active .kfs-field-tooltip-box {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, 0) !important;
    pointer-events: auto !important;
  }

  body#product #kfs-configurator .kfs-field-tooltip.is-mobile-active .kfs-field-tooltip-box::after {
    display: block !important;
    left: var(--kfs-tooltip-arrow-left, 50%) !important;
  }

  body#product #kfs-configurator .kfs-field-tooltip.kfs-tooltip-above .kfs-field-tooltip-box::after {
    top: 100% !important;
    bottom: auto !important;
    transform: translate(-50%, -5px) rotate(45deg) !important;
    border-right: 1px solid #dbe4f0;
    border-bottom: 1px solid #dbe4f0;
    border-left: 0;
    border-top: 0;
  }

  body#product #kfs-configurator .kfs-field-tooltip.kfs-tooltip-below .kfs-field-tooltip-box::after {
    top: 0 !important;
    bottom: auto !important;
    transform: translate(-50%, -5px) rotate(225deg) !important;
    border-right: 1px solid #dbe4f0;
    border-bottom: 1px solid #dbe4f0;
    border-left: 0;
    border-top: 0;
  }
}


/* ETAP 3 v1.2.8 — mikro-polishing UX: podsumowanie, desktop spacing, debounce AJAX wariantu */
body#product #kfs-configurator .kfs-summary-box {
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease, background-color .18s ease;
}

body#product #kfs-configurator .kfs-summary-box:not(.is-calculated) {
  opacity: .96;
}

body#product #kfs-configurator .kfs-summary-box.is-calculated {
  opacity: 1;
  transform: translateY(0);
  animation: kfsSummarySoftEnter .22s ease both;
}

@keyframes kfsSummarySoftEnter {
  from { opacity: .72; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
  body#product #kfs-configurator .kfs-dimensions__row,
  body#product #kfs-configurator .kfs-dimension-row {
    gap: 10px;
    align-items: flex-start;
  }

  body#product #kfs-configurator .kfs-section {
    scroll-margin-top: 18px;
  }

  body#product #kfs-configurator .kfs-summary-box {
    padding: 14px;
  }
}

body#product #kfs-configurator.is-variant-updating #kfs-width,
body#product #kfs-configurator.is-variant-updating #kfs-height,
body#product #kfs-configurator.is-variant-updating [data-kfs-confirm],
body#product #kfs-configurator.is-variant-updating [data-kfs-change] {
  pointer-events: none;
}

/* ETAP 3 v1.2.10 — opis jednostkowy dopłaty w podsumowaniu */
body#product .kfs-summary-visual__price-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  justify-self: end;
}

body#product .kfs-summary-visual__price-note {
  display: block;
  max-width: 96px;
  color: #8b8f98;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  text-align: right;
  white-space: normal;
}

@media (max-width: 520px) {
  body#product .kfs-summary-visual__price-wrap {
    align-items: flex-end;
  }

  body#product .kfs-summary-visual__price-note {
    max-width: 84px;
    font-size: 9px;
  }
}

/* ETAP 4 — stan przycisku modułu i komunikat koszyka. Bez zmian w UX accordionów. */
.kfs-btn.is-loading {
  pointer-events: none;
  opacity: .72;
}
.kfs-module-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff3f3;
  border: 1px solid #f0c6c6;
  color: #7a1f1f;
  font-size: 13px;
  line-height: 1.35;
}

/* ETAP 4 v1.3.3 — ukrycie technicznego pola personalizacji PrestaShop dla produktu konfiguratora */
.product-customization,
.product-customization-line,
.product-customization-item,
.product-information .product-customization,
.product-add-to-cart .product-customization,
.js-product-customization,
#product_customization_id,
section.product-customization,
.card.product-customization {
  display: none !important;
}


/* ETAP 4 v1.3.10 — Uwagi klienta jak w konfigurator_firany_new */
body#product #kfs-configurator .kfs-notes {
  margin-top: 14px;
}

body#product #kfs-configurator .kfs-notes-label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  color: #1f2937;
}

body#product #kfs-configurator .kfs-notes-label span {
  font-weight: 600;
  color: #6b7280;
}

body#product #kfs-configurator .kfs-notes-input {
  display: block;
  width: 100%;
  max-width: 520px;
  min-height: 86px;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
  box-shadow: none;
}

body#product #kfs-configurator .kfs-notes-input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
  opacity: 1;
}

body#product #kfs-configurator .kfs-notes-input:focus {
  border-color: #94a3b8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .08);
}

/* ETAP 4 v1.3.11 — poprawka pola Uwagi klienta */
#kfs-configurator .kfs-notes,
body#product #kfs-configurator .kfs-notes,
html body#product #kfs-configurator section.kfs-notes {
  display: block !important;
  width: 100% !important;
  margin-top: 14px !important;
  padding-top: 14px !important;
  border-top: 1px solid #e5e7eb !important;
}

#kfs-configurator .kfs-notes-label,
body#product #kfs-configurator .kfs-notes-label,
html body#product #kfs-configurator .kfs-notes-label {
  display: block !important;
  width: 100% !important;
  margin: 0 0 8px 0 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  color: #111827 !important;
}

#kfs-configurator .kfs-notes-label span,
body#product #kfs-configurator .kfs-notes-label span {
  font-weight: 600 !important;
  color: #6b7280 !important;
}

#kfs-configurator textarea.kfs-notes-input,
body#product #kfs-configurator textarea.kfs-notes-input,
html body#product #kfs-configurator textarea.kfs-notes-input {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 84px !important;
  margin: 0 !important;
  padding: 11px 13px !important;
  border: 1px solid #cfd8e3 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  resize: vertical !important;
  opacity: 1 !important;
  cursor: text !important;
  pointer-events: auto !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

#kfs-configurator textarea.kfs-notes-input:disabled,
body#product #kfs-configurator textarea.kfs-notes-input:disabled {
  background: #ffffff !important;
  color: #111827 !important;
  cursor: text !important;
  opacity: 1 !important;
}

#kfs-configurator textarea.kfs-notes-input:focus,
body#product #kfs-configurator textarea.kfs-notes-input:focus {
  border-color: #0f172a !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .08) !important;
}

/* ETAP 4 v1.3.13 — blokada technicznej pozycji Dopłaty w koszyku */
.kfs-surcharge-cart-line .kfs-cart-control-hidden,
.kfs-surcharge-cart-line .remove-from-cart,
.kfs-surcharge-cart-line .cart-line-product-actions,
.kfs-surcharge-cart-line .bootstrap-touchspin,
.kfs-surcharge-cart-line .touchspin,
.kfs-surcharge-cart-line .btn-touchspin {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.kfs-surcharge-cart-line input[type="number"],
.kfs-surcharge-cart-line input.js-cart-line-product-quantity,
.kfs-surcharge-cart-line .js-cart-line-product-quantity {
  display: none !important;
}

/* ETAP 4 v1.3.17 — quantity produktu konfiguratora zachowuje standardowy wygląd koszyka.
   JS blokuje wyłącznie próbę zmiany ilości i pokazuje komunikat. */
.kfs-configured-cart-line input.js-cart-line-product-quantity,
.kfs-configured-cart-line input[name="product-quantity-spin"],
.kfs-configured-cart-line input[type="number"].kfs-cart-qty-locked-input {
  cursor: pointer !important;
}

.kfs-quantity-lock-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}

.kfs-quantity-lock-modal.is-visible {
  display: flex !important;
}

.kfs-quantity-lock-modal__backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, .48) !important;
}

.kfs-quantity-lock-modal__dialog {
  position: relative !important;
  z-index: 1 !important;
  width: min(440px, 100%) !important;
  padding: 24px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28) !important;
  color: #111827 !important;
  text-align: left !important;
}

.kfs-quantity-lock-modal__dialog h3 {
  margin: 0 34px 12px 0 !important;
  font-size: 22px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  color: #111827 !important;
}

.kfs-quantity-lock-modal__dialog p {
  margin: 0 0 20px 0 !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  color: #374151 !important;
}

.kfs-quantity-lock-modal__x {
  position: absolute !important;
  top: 14px !important;
  right: 16px !important;
  width: 28px !important;
  height: 28px !important;
  border: 0 !important;
  background: transparent !important;
  color: #6b7280 !important;
  font-size: 26px !important;
  line-height: 28px !important;
  cursor: pointer !important;
}

.kfs-quantity-lock-modal__button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}


/* ETAP 4 v1.3.27 — izolowany wygląd idempotentnego modala personalizacji KFS. */
body#cart .modal[data-kfs-modal-rendered="1"] .modal-body {
  padding: 22px 24px 24px !important;
  background: #f7f8fb !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-card {
  display: block !important;
  width: 100% !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-row {
  display: grid !important;
  grid-template-columns: minmax(160px, 38%) 1fr !important;
  gap: 18px !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid #edf0f5 !important;
  align-items: start !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-row:last-child {
  border-bottom: 0 !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-label {
  color: #667085 !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-value {
  color: #101828 !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-section-title {
  padding: 14px 16px 8px !important;
  color: #101828 !important;
  font-weight: 900 !important;
  border-bottom: 1px solid #edf0f5 !important;
  background: #fbfcfe !important;
}

@media (max-width: 576px) {
  body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-row {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
}

/* ETAP 4 v1.3.30 — bezpieczny scroll dla modala Dopłat/KFS.
   Izolacja: tylko modale renderowane przez konfigurator_szycia (data-kfs-modal-rendered="1"). */
body#cart .modal[data-kfs-modal-rendered="1"] .modal-dialog {
  max-height: calc(100vh - 36px) !important;
  margin-top: 18px !important;
  margin-bottom: 18px !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .modal-content {
  max-height: calc(100vh - 36px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .modal-header {
  flex: 0 0 auto !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .modal-body {
  flex: 1 1 auto !important;
  max-height: calc(100vh - 130px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-card--surcharge .kfs-modal-safe-section-title:not(:first-child) {
  margin-top: 10px !important;
  border-top: 1px solid #e2e8f0 !important;
}

@media (max-width: 576px) {
  body#cart .modal[data-kfs-modal-rendered="1"] .modal-dialog {
    max-height: calc(100vh - 20px) !important;
    margin: 10px !important;
  }

  body#cart .modal[data-kfs-modal-rendered="1"] .modal-content {
    max-height: calc(100vh - 20px) !important;
  }

  body#cart .modal[data-kfs-modal-rendered="1"] .modal-body {
    max-height: calc(100vh - 118px) !important;
    padding: 16px !important;
  }
}


/* ETAP 4 v1.3.30 — mocniejszy scroll i brak ucinania sekcji Dopłat. */
html body#cart .modal[data-kfs-modal-rendered="1"] {
  overflow-y: auto !important;
}
html body#cart .modal[data-kfs-modal-rendered="1"] .modal-dialog,
html body#cart .modal.show[data-kfs-modal-rendered="1"] .modal-dialog,
html body#cart .modal.in[data-kfs-modal-rendered="1"] .modal-dialog {
  max-width: 640px !important;
  max-height: calc(100vh - 32px) !important;
  margin-top: 16px !important;
  margin-bottom: 16px !important;
}
html body#cart .modal[data-kfs-modal-rendered="1"] .modal-content {
  max-height: calc(100vh - 32px) !important;
  overflow: hidden !important;
}
html body#cart .modal[data-kfs-modal-rendered="1"] .modal-body {
  display: block !important;
  max-height: calc(100vh - 128px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin !important;
}
html body#cart .modal[data-kfs-modal-rendered="1"] .kfs-modal-safe-card--surcharge {
  overflow: visible !important;
}

/* v1.3.31: modal Dopłat zasilany JSON z tabeli modułu, bez parsera tekstu personalizacji. */
