.megashop-configurator {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
}

.megashop-configurator *,
.megashop-configurator *::before,
.megashop-configurator *::after {
  box-sizing: border-box;
}

.megashop-configurator__header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.megashop-configurator__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.megashop-configurator__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

.megashop-configurator__sku {
  margin: 0.5rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  color: #94a3b8;
}

.megashop-configurator__params {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.megashop-configurator__param-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.megashop-configurator__param-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
}

.megashop-configurator__param--number-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.megashop-configurator__param--number-stepper .megashop-configurator__param-label-row {
  margin-bottom: 0;
  min-width: 0;
  flex: 1;
}

.megashop-configurator__param--number-stepper .megashop-configurator__param-footnote {
  flex-basis: 100%;
}

.megashop-configurator__number-stepper {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
}

.megashop-configurator__number-stepper-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.megashop-configurator__number-stepper-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

.megashop-configurator__number-stepper-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.megashop-configurator__number-stepper-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 2rem;
  padding: 0 0.375rem;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  text-align: center;
}

.megashop-configurator__param-groups {
  margin-bottom: 0.5rem;
}

.megashop-configurator__param-groups + .megashop-configurator__dropdown {
  margin-top: 0;
}

.megashop-configurator__group-select-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.megashop-configurator__group-select-row > .megashop-configurator__param-groups,
.megashop-configurator__group-select-row > .megashop-configurator__dropdown {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin-bottom: 0;
}

.megashop-configurator__group-select-row > .megashop-configurator__param-groups + .megashop-configurator__dropdown {
  margin-top: 0;
}

.megashop-configurator__param-footnote {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

.megashop-configurator__checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.megashop-configurator__checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  cursor: pointer;
}

.megashop-configurator__param--checkbox .megashop-configurator__param-label {
  margin-bottom: 0;
}

.megashop-configurator__checkbox {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: #0f172a;
}

.megashop-configurator__radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.megashop-configurator__choice-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
}

.megashop-configurator__choice-row:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.megashop-configurator__radio {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: #0f172a;
}

.megashop-configurator__option-content {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.megashop-configurator__option-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 0.125rem;
}

.megashop-configurator__option-label {
  color: #334155;
  line-height: 1.35;
}

.megashop-configurator__option-comment {
  font-size: 0.6875rem;
  line-height: 1.3;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.megashop-configurator__option-comment * {
  font-size: inherit;
}

.megashop-configurator__option-price {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}

.megashop-configurator__option-price-deltas {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
  flex-shrink: 0;
}

.megashop-configurator__option-price-deltas--push-end {
  margin-left: auto;
}

.megashop-configurator__option-price-delta {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.megashop-configurator__option-price-delta--up {
  color: #16a34a;
}

.megashop-configurator__option-price-delta--down {
  color: #dc2626;
}

.megashop-configurator__badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.megashop-configurator__option-thumbnail {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  overflow: visible;
}

.megashop-configurator__option-thumbnail-img,
.megashop-configurator__option-swatch {
  display: block;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  object-fit: cover;
  background: #f8fafc center / cover no-repeat;
}

.megashop-configurator__option-thumbnail-preview {
  position: absolute;
  left: calc(100% + 0.5rem);
  top: 50%;
  z-index: 30;
  display: none;
  width: 8rem;
  height: 8rem;
  padding: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  transform: translateY(-50%);
  pointer-events: none;
}

.megashop-configurator__option-thumbnail-preview img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0.375rem;
  object-fit: cover;
}

.megashop-configurator__option-thumbnail--has-preview:hover .megashop-configurator__option-thumbnail-preview,
.megashop-configurator__option-thumbnail--has-preview:focus-within .megashop-configurator__option-thumbnail-preview {
  display: block;
}

.megashop-configurator__option-info,
.megashop-configurator__option-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.megashop-configurator__option-info {
  font-style: italic;
}

.megashop-configurator__option-help {
  font-style: normal;
}

.megashop-configurator__option-info:hover,
.megashop-configurator__option-info--open,
.megashop-configurator__option-help:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.megashop-configurator__option-info-popper {
  position: absolute;
  left: calc(100% + 0.375rem);
  top: 50%;
  z-index: 40;
  width: max-content;
  max-width: 14rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  color: #334155;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  transform: translateY(-50%);
}

.megashop-configurator__dropdown {
  position: relative;
}

.megashop-configurator__bed-size-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.megashop-configurator__bed-size-control > .megashop-configurator__dropdown {
  flex: 1;
  min-width: 0;
}

.megashop-configurator__bed-size-separator {
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 2rem;
  line-height: 1;
  user-select: none;
}

.megashop-configurator__bed-size-sleeping {
  flex-shrink: 0;
  min-width: 5.5rem;
  height: 50px;
  padding: 0 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  display: grid;
  align-content: center;
  justify-content: center;
}

.megashop-configurator__dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #0f172a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.megashop-configurator__dropdown-trigger:hover,
.megashop-configurator__dropdown--open .megashop-configurator__dropdown-trigger {
  border-color: #94a3b8;
}

.megashop-configurator__dropdown-trigger:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 1px;
}

.megashop-configurator__dropdown-trigger-content {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 2rem;
  flex: 1;
}

.megashop-configurator__dropdown-trigger-content[hidden] {
  display: none;
}

.megashop-configurator__dropdown-trigger-content > .megashop-configurator__option-content {
  width: 100%;
  min-height: 2rem;
}

.megashop-configurator__dropdown-search-input {
  flex: 1;
  min-width: 0;
  min-height: 2rem;
  margin: 0;
  padding: 0.25rem 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: inherit;
  font: inherit;
  outline: none;
}

.megashop-configurator__dropdown-search-input:focus {
  border-color: #94a3b8;
}

.megashop-configurator__dropdown-search-input[hidden] {
  display: none;
}

.megashop-configurator__dropdown-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
}

.megashop-configurator__dropdown-search-toggle:hover,
.megashop-configurator__dropdown-search-toggle:focus-visible {
  color: #0f172a;
}

.megashop-configurator__dropdown-search-toggle[hidden] {
  display: none;
}

.megashop-configurator__dropdown-caret {
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.15s ease;
}

.megashop-configurator__dropdown--open .megashop-configurator__dropdown-caret {
  transform: rotate(225deg) translateY(1px);
}

.megashop-configurator__dropdown-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  max-height: 16rem;
  padding: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  overflow: auto;
}

.megashop-configurator__dropdown-menu[hidden] {
  display: none;
}

.megashop-configurator__dropdown-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.megashop-configurator__dropdown-option > .megashop-configurator__option-content {
  width: 100%;
  min-width: 0;
}

.megashop-configurator__dropdown-option[hidden],
.megashop-configurator__dropdown-option--filtered {
  display: none !important;
}

.megashop-configurator__dropdown-option:hover,
.megashop-configurator__dropdown-option--selected {
  background: #f8fafc;
}

.megashop-configurator__dropdown-option:disabled,
.megashop-configurator__dropdown-option--disabled {
  color: #94a3b8;
  cursor: default;
  opacity: 0.55;
}

.megashop-configurator__dropdown-option:disabled:hover,
.megashop-configurator__dropdown-option--disabled:hover {
  background: transparent;
}

.megashop-configurator__dropdown-option--selected:disabled,
.megashop-configurator__dropdown-option--selected.megashop-configurator__dropdown-option--disabled,
.megashop-configurator__dropdown-option--selected:disabled:hover,
.megashop-configurator__dropdown-option--selected.megashop-configurator__dropdown-option--disabled:hover {
  background: #f8fafc;
}

.megashop-configurator__summary {
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.megashop-configurator__price-top {
  margin-bottom: 1rem;
}

.megashop-configurator__price-top .megashop-configurator__price-main {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.megashop-configurator__selected-title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.megashop-configurator__selected-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.megashop-configurator__selected-item {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

.megashop-configurator__selected-item-label {
  color: #64748b;
}

.megashop-configurator__selected-item-value {
  color: #0f172a;
  font-weight: 500;
}

.megashop-configurator__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.megashop-configurator__price-main {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.megashop-configurator__price-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  margin-left: auto;
  flex-wrap: wrap;
}

.megashop-configurator__action {
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25;
  min-height: 2rem;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.megashop-configurator__action:hover:not(:disabled) {
  border-color: #94a3b8;
  color: #0f172a;
}

.megashop-configurator__action:disabled {
  opacity: 0.45;
  cursor: default;
}

.megashop-configurator__action--cart {
  flex: 1 1 100%;
  width: 100%;
  padding: 0.75rem;
  border-color: #e2e8f0;
  border-radius: 0.375rem;
  background-color: #f8fafc;
  color: #94a3b8;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
}

.megashop-configurator__price-actions--cart {
  flex: 1 1 100%;
  width: 100%;
  margin-left: 0;
}

.megashop-configurator__action--cart:hover {
  border-color: #cbd5e1;
  background-color: #f1f5f9;
  color: #64748b;
}

.megashop-configurator__action--active {
  color: #e11d48;
}

.megashop-configurator__action--active:hover:not(:disabled) {
  color: #be123c;
}

.megashop-configurator__set-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0 0 0.75rem;
}

.megashop-configurator__qty {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
}

.megashop-configurator__qty-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.megashop-configurator__qty-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

.megashop-configurator__qty-btn:disabled {
  opacity: 0.4;
}

.megashop-configurator__qty-input {
  width: 2.25rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  border-radius: 0;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
}

.megashop-configurator__add-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.megashop-configurator__add-toggle input {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: #0f172a;
  cursor: pointer;
}

.megashop-configurator__param--readonly {
  opacity: 0.78;
}

.megashop-configurator__param--readonly .megashop-configurator__dropdown,
.megashop-configurator__param--readonly .megashop-configurator__radio-group,
.megashop-configurator__param--readonly .megashop-configurator__checkbox-row,
.megashop-configurator__param--readonly .megashop-configurator__number-stepper,
.megashop-configurator__param--readonly .megashop-configurator__group-select-row {
  pointer-events: none;
}

.megashop-configurator__price-old-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
}

.megashop-configurator__price-old {
  font-size: 1.125rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: line-through;
}

.megashop-configurator__keep-price {
  border: 0;
  padding: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.2;
  text-decoration: underline;
  cursor: pointer;
}

.megashop-configurator__keep-price:hover {
  color: #0f172a;
}

.megashop-configurator__price {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.megashop-configurator__reset-config {
  margin-left: auto;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 1.125rem;
  line-height: 1;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.megashop-configurator__reset-config:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.megashop-configurator__info-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.megashop-configurator__info-modal-panel {
  position: relative;
  width: min(100%, 28rem);
  max-height: min(80vh, 32rem);
  overflow: auto;
  padding: 1.5rem 1.75rem 1.25rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.megashop-configurator__info-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.megashop-configurator__info-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.megashop-configurator__info-modal-content {
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.5;
}

.megashop-configurator__info-materials {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.megashop-configurator__info-material-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.megashop-configurator__info-material-item img {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 0.375rem;
  object-fit: cover;
}

.megashop-configurator__info-material-item strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #0f172a;
}

.megashop-configurator__info-material-item p {
  margin: 0;
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.megashop-configurator__price--empty {
  color: #94a3b8;
}
