/* Dedicated storefront skin. Scoped to this module so it cannot alter the
   homepage configurator or product pages. */
#global-configurator {
  --kc-ink: #111827;
  --kc-muted: #687181;
  --kc-line: #e5e7eb;
  --kc-red: #df1f26;
  --kc-red-soft: #fff6f6;
  padding: clamp(34px, 5vw, 74px) 0 clamp(48px, 7vw, 96px);
  background: #f8f9fb;
}

#global-configurator .cs-container__inner {
  width: min(1320px, calc(100% - 40px));
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}

#global-configurator .section-header {
  margin: 0 0 clamp(28px, 4vw, 52px);
  text-align: center;
}

#global-configurator .configurator-title {
  margin: 0;
  color: var(--kc-ink);
  font-size: clamp(30px, 3.1vw, 48px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.08;
}

#kc-configurator .step {
  overflow: visible;
  padding: clamp(24px, 3.2vw, 46px);
  background: #fff;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(17, 24, 39, .07);
}

#kc-configurator .the_box {
  width: 100%;
  max-width: none;
  margin: 0;
}

#kc-configurator h2 {
  margin: 0 0 24px;
  color: var(--kc-ink);
  font-size: clamp(23px, 2vw, 31px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.15;
}

/* Manufacturers: fixed-size logo tiles that wrap naturally as brands grow. */
#kc-configurator .kc-manufacturer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 260px));
  justify-content: flex-start;
  gap: 18px;
  width: 100%;
  margin: 0;
}

#kc-configurator .kc-manufacturer-card {
  position: relative;
  display: block !important;
  width: 100%;
  height: auto !important;
  min-height: 132px;
  padding: 0 !important;
  background: transparent;
  border: 0 !important;
  border-radius: 10px;
  box-shadow: none !important;
}

#kc-configurator .kc-manufacturer-card label {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  width: 100%;
  min-height: 132px;
  margin: 0;
  padding: 24px !important;
  align-items: center;
  justify-content: center;
  background: #f7f8fa;
  border: 1px solid transparent !important;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: none !important;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

#kc-configurator .kc-manufacturer-card label:hover,
#kc-configurator .kc-manufacturer-card:has(input:checked) label {
  background: #fff;
  border-color: rgba(223, 31, 38, .42) !important;
  box-shadow: 0 12px 28px rgba(17, 24, 39, .1) !important;
  transform: translateY(-3px);
}

#kc-configurator .kc-manufacturer-card:has(input:checked) {
  border: 0 !important;
  box-shadow: none !important;
}

#kc-configurator .kc-manufacturer-card label:focus-within {
  outline: 3px solid rgba(223, 31, 38, .16);
  outline-offset: 3px;
}

#kc-configurator .kc-manufacturer-card img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 68px;
  margin: 0;
  object-fit: contain;
}

#kc-configurator .kc-manufacturer-input,
#kc-configurator .kc-family-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Families: compact catalogue tiles, never one stretched empty billboard. */
#kc-configurator .step_family {
  position: relative;
}

#kc-configurator .step_family .cs-products-carousel__nav {
  display: none !important;
}

#kc-configurator .kc-system-back {
  margin: 24px 0 0 !important;
}

#kc-configurator .step_family .slider {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 380px));
  justify-content: center;
  gap: 22px;
  width: 100%;
  margin: 0;
  padding: 4px !important;
  overflow: visible;
  transform: none !important;
}

#kc-configurator .kc-system-card {
  position: relative;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff;
  border: 1px solid var(--kc-line) !important;
  border-radius: 12px;
  box-shadow: 0 7px 22px rgba(17, 24, 39, .05);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

#kc-configurator .kc-system-card:hover {
  background: #fff !important;
  border-color: #cfd4dc !important;
  box-shadow: 0 13px 32px rgba(17, 24, 39, .09) !important;
  transform: translateY(-3px);
}

#kc-configurator .kc-system-card > label {
  display: flex !important;
  height: 100%;
  margin: 0;
  padding: 24px;
  flex-direction: column;
  align-items: stretch !important;
  cursor: pointer;
}

#kc-configurator .kc-system-card h2,
#kc-configurator .kc-system-card:hover h2 {
  width: auto;
  margin: 0 0 18px !important;
  padding: 0 !important;
  color: var(--kc-ink) !important;
  background: transparent !important;
  font-size: 21px !important;
  line-height: 1.2;
}

#kc-configurator .kc-system-card .content-image {
  display: grid !important;
  min-height: 220px;
  margin: 0 0 18px;
  padding: 0 !important;
  place-items: center;
  background: #fff !important;
}

#kc-configurator .kc-system-card .main_pic {
  display: block;
  width: 100%;
  height: 220px !important;
  margin: 0 !important;
  object-fit: contain;
}

#kc-configurator .kc-system-card__description,
#kc-configurator .kc-system-card__bullets {
  margin: 0 0 16px;
  padding: 0 !important;
  color: var(--kc-muted);
  font-size: 13px;
  line-height: 1.55;
}

#kc-configurator .kc-system-card__bullets li {
  margin-bottom: 7px;
  padding-left: 15px;
}

#kc-configurator .kc-system-card__bullets li::before {
  top: .58em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

#kc-configurator .kc-system-card .btn-container {
  display: flex;
  width: 100%;
  margin: auto 0 0;
  padding-top: 10px;
  justify-content: flex-start;
}

/* Shared actions. */
#kc-configurator .button,
#kc-configurator .show_results {
  display: inline-flex;
  min-height: 46px;
  margin: 0 !important;
  padding: 11px 19px !important;
  gap: 9px;
  align-items: center;
  justify-content: center;
  border-radius: 7px !important;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .025em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#kc-configurator .kc-action-icon {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#kc-configurator .btn-config,
#kc-configurator .show_results {
  color: #fff;
  background: var(--kc-red);
  border: 1px solid var(--kc-red);
}

#kc-configurator .btn-config:hover,
#kc-configurator .show_results:hover {
  color: #fff;
  background: #c9181f;
  border-color: #c9181f;
  box-shadow: 0 8px 18px rgba(223, 31, 38, .2);
  transform: translateY(-2px);
}

#kc-configurator .btn_back {
  color: #4b5563 !important;
  background: #f3f4f6 !important;
  border: 1px solid transparent !important;
}

#kc-configurator .btn_back:hover {
  color: var(--kc-ink) !important;
  background: #e9ebef !important;
  border-color: transparent !important;
  box-shadow: none;
  transform: translateX(-2px);
}

#kc-configurator .button:focus-visible,
#kc-configurator .show_results:focus-visible {
  outline: 3px solid rgba(223, 31, 38, .2);
  outline-offset: 3px;
}

/* Dynamic option step. The successful option hover is intentionally kept. */
#kc-configurator .step_dynamic .the_box {
  display: grid;
  grid-template-columns: minmax(210px, .7fr) minmax(360px, 1.35fr) minmax(250px, .8fr);
  align-items: stretch;
  gap: clamp(26px, 3.2vw, 48px);
}

#kc-configurator .step_dynamic .img_box,
#kc-configurator .step_dynamic .inputs_box,
#kc-configurator .step_dynamic .results_box {
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
}

#kc-configurator .step_dynamic .img_box {
  display: flex;
  min-height: 330px;
  padding: 0 clamp(20px, 2vw, 34px) 0 0;
  align-items: center;
  justify-content: center;
  background: #fff !important;
  border-right: 1px solid #edf0f3;
  border-radius: 0;
}

#kc-configurator .step_dynamic .img_komin {
  width: 100%;
  height: auto !important;
  max-height: none !important;
}

#kc-configurator .step_dynamic .img_komin img {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: 350px !important;
  margin: 0 auto;
  object-fit: contain;
}

#kc-configurator .step_dynamic .inputs_box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#kc-configurator .step_dynamic .inputs_box .title {
  margin: -12px 0 20px;
  color: var(--kc-muted);
  font-size: 13px;
}

#kc-configurator .inputs_box__content {
  display: grid !important;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  float: none !important;
}

#kc-configurator .inputs_box__item {
  margin: 0 !important;
  float: none !important;
}

#kc-configurator .inputs_box__item input {
  position: absolute;
  opacity: 0;
}

#kc-configurator .inputs_box__item label {
  display: flex !important;
  min-width: 0 !important;
  min-height: 48px;
  margin: 0 !important;
  padding: 11px 13px !important;
  align-items: center;
  justify-content: center;
  color: var(--kc-ink);
  background: #fff;
  border: 1px solid #dce1e7 !important;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

#kc-configurator .inputs_box__item label:hover,
#kc-configurator .inputs_box__item input:checked + label {
  color: var(--kc-red);
  background: var(--kc-red-soft);
  border-color: var(--kc-red) !important;
  box-shadow: 0 5px 14px rgba(223, 31, 38, .09);
}

/* Only the "Typ komina" values with an assigned graphic become image tiles. */
#kc-configurator .kc-type-options {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

#kc-configurator .kc-type-option label {
  min-height: 154px;
  padding: 12px !important;
  flex-direction: column;
  gap: 10px;
}

#kc-configurator .kc-type-option__image {
  display: block;
  width: 100%;
  height: 104px;
  object-fit: contain;
}

#kc-configurator .config-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

#kc-configurator .config-btns .show_results {
  min-width: 154px;
}

#kc-configurator .results_box {
  display: block;
  padding: 22px !important;
  background: #172033;
  border: 0 !important;
  border-radius: 10px;
  color: #fff;
}

#kc-configurator .results_box h3 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  opacity: .72 !important;
}

#kc-configurator .results_box p {
  display: flex;
  width: 100%;
  margin: 0 !important;
  padding: 9px 0 !important;
  justify-content: space-between;
  gap: 14px;
  color: #cbd2dc;
  border-top: 1px solid rgba(255,255,255,.13) !important;
  font-size: 10px !important;
  line-height: 1.3;
  text-transform: uppercase;
}

#kc-configurator .results_box p span {
  display: block;
  margin: 0;
  color: #fff;
  font-weight: 750;
  text-align: right;
}

/* Results page. */
.kh-config-results {
  width: min(1220px, calc(100% - 40px));
  max-width: none;
  margin: 36px auto 72px;
  padding: 0;
}

.kh-config-results__criteria {
  margin-bottom: 30px;
  padding: clamp(22px, 3vw, 34px);
  background: #fff;
  border: 1px solid var(--kc-line, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(17,24,39,.06);
}

@media (max-width: 980px) {
  #kc-configurator .step_dynamic .the_box {
    grid-template-columns: minmax(180px, .7fr) 1.3fr;
  }
  #kc-configurator .step_dynamic .results_box {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  #global-configurator {
    padding: 26px 0 50px;
  }
  #global-configurator .cs-container__inner,
  .kh-config-results {
    width: calc(100% - 24px);
  }
  #global-configurator .section-header {
    margin-bottom: 26px;
  }
  #kc-configurator .step {
    padding: 20px 16px;
    border-radius: 10px;
    box-shadow: 0 9px 24px rgba(17,24,39,.06);
  }
  #kc-configurator .kc-manufacturer-grid,
  #kc-configurator .step_family .slider,
  #kc-configurator .step_dynamic .the_box {
    grid-template-columns: 1fr;
  }
  #kc-configurator .kc-manufacturer-card,
  #kc-configurator .kc-manufacturer-card label {
    min-height: 108px;
  }
  #kc-configurator .kc-manufacturer-card img {
    max-height: 58px;
  }
  #kc-configurator .step_dynamic .img_box {
    min-height: 210px;
    padding: 0 0 20px;
    border-right: 0;
    border-bottom: 1px solid #edf0f3;
  }
  #kc-configurator .step_dynamic .img_komin img {
    max-height: 230px !important;
  }
  #kc-configurator .inputs_box__content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #kc-configurator .config-btns {
    position: static !important;
    display: grid !important;
    width: 100% !important;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 8px;
    margin: 18px 0 0 !important;
    transform: none !important;
  }
  #kc-configurator .config-btns .button,
  #kc-configurator .config-btns .show_results {
    position: static !important;
    display: inline-flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px;
    margin: 0 !important;
    padding: 10px 12px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transform: none !important;
  }
  #kc-configurator .config-btns .show_results[style*="display:none"],
  #kc-configurator .config-btns .show_results[style*="display: none"] {
    display: none !important;
  }
  #kc-configurator .config-btns:has(.show_results[style*="display:none"]),
  #kc-configurator .config-btns:has(.show_results[style*="display: none"]) {
    grid-template-columns: 1fr;
  }
  #kc-configurator .config-btns .kc-action-icon {
    position: static !important;
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
    transform: none !important;
  }
  #kc-configurator .step_dynamic .inputs_box {
    display: flex !important;
    flex-direction: column !important;
  }
  #kc-configurator .step_dynamic .inputs_box > h2 {
    order: 1;
    margin: 0 0 10px !important;
    scroll-margin-top: 92px;
  }
  #kc-configurator .step_dynamic .inputs_box > .title { order: 2; margin: 0 0 16px !important; }
  #kc-configurator .step_dynamic .inputs_box > .inputs_box__content { order: 3; }
  #kc-configurator .step_dynamic .inputs_box > .config-btns { order: 4; }
  #kc-configurator .kc-height-step .inputs_box__content {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  #kc-configurator .kc-height-step .inputs_box__item label {
    min-height: 42px !important;
    padding: 7px 2px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    white-space: nowrap;
  }
  #kc-configurator .kc-diameter-step .inputs_box__content {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #kc-configurator .kc-diameter-step .inputs_box__item label {
    min-height: 58px !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
  }
  #kc-configurator .kc-type-options {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
    gap: 8px !important;
  }
  #kc-configurator .kc-type-option label {
    min-height: 132px !important;
    padding: 9px !important;
    gap: 7px;
    font-size: 12px !important;
  }
  #kc-configurator .kc-type-option__image {
    height: 86px;
  }
  #kc-configurator .results_box {
    display: block !important;
    grid-column: auto;
  }

  .kh-config-results {
    margin-top: 22px;
    margin-bottom: 42px;
  }
  .kh-config-results__criteria {
    margin-bottom: 20px;
    padding: 20px;
  }
  .kh-config-results .kh-tab-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
    align-items: start !important;
    gap: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .kh-config-results .kh-tab-grid > li,
  .kh-config-results .cs-products-carousel__product-tile,
  .kh-config-results .cs-product-tile,
  .kh-config-results .product-miniature,
  .kh-config-results .thumbnail-container,
  .kh-config-results .product-description {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  .kh-config-results .cs-product-tile {
    aspect-ratio: auto !important;
  }
  .kh-config-results .cs-product-tile__container,
  .kh-config-results .cs-product-tile__content,
  .kh-config-results .cs-product-tile__main {
    height: auto !important;
    min-height: 0 !important;
  }
  .kh-config-results .cs-products-carousel__product-tile {
    padding-bottom: 22px !important;
  }
  .kh-config-results__back {
    display: inline-flex !important;
    width: 100%;
    min-height: 48px;
    margin-top: 18px;
    padding: 11px 18px;
    align-items: center;
    justify-content: center;
    color: #374151 !important;
    background: #f3f4f6;
    border: 1px solid #e2e5e9;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none !important;
  }
}
