.fs-compact-variants {
  position: relative;
  max-width: 540px;
  margin: 18px 0;
  color: #111827;
  box-sizing: border-box;
  z-index: 20;
}

.fs-compact-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 14px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 10px 18px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff !important;
  color: #111827 !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.fs-compact-toggle:hover {
  border-color: #f6c400;
  background: #fffbea !important;
  box-shadow: 0 0 0 3px rgba(246, 196, 0, .22), 0 10px 24px rgba(15, 23, 42, .08);
}

.fs-compact-toggle-label {
  color: #111827 !important;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.fs-compact-toggle-value {
  min-width: 0;
  color: #64748b !important;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-compact-toggle b {
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid #111827;
  border-bottom: 2px solid #111827;
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.fs-compact-variants.is-open .fs-compact-toggle b {
  transform: rotate(-135deg);
}

.fs-compact-panel {
  display: none;
  margin-top: 10px;
  padding: 18px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .1);
  box-sizing: border-box;
}

.fs-compact-variants.is-open .fs-compact-panel {
  display: block;
}

.fs-compact-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.fs-compact-group {
  min-width: 0;
}

.fs-compact-group h3 {
  margin: 0 0 12px;
  color: #000;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 900;
  text-transform: uppercase;
}

.fs-compact-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.fs-compact-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  min-width: 44px;
  padding: 0 10px;
  border: 1px solid #dbe4ef !important;
  border-radius: 10px;
  background: #fff !important;
  color: #111827 !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
  text-shadow: none !important;
  box-shadow: 0 0 0 1px rgba(246, 196, 0, .18);
  cursor: pointer;
  text-align: center;
  font-family: inherit !important;
  font-size: 15px !important;
  line-height: 1 !important;
  font-weight: 850 !important;
  white-space: nowrap !important;
  box-sizing: border-box;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

.fs-compact-option::before {
  content: attr(data-size-label);
  display: none;
}

.fs-compact-option:hover:not(:disabled) {
  border-color: #f6c400;
  background: #fffbea !important;
  box-shadow: 0 0 0 2px rgba(246, 196, 0, .36);
  transform: translateY(-1px);
}

.fs-compact-option.is-selected {
  border-color: #111827 !important;
  background: #f6c400 !important;
  color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(246, 196, 0, .32), 0 10px 22px rgba(15, 23, 42, .13);
}

.fs-compact-option:disabled {
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none;
}

.fs-compact-option-text {
  display: block;
  min-width: 0;
}

.fs-compact-option-main {
  display: block;
  font-size: 15px;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-compact-thumb {
  display: none;
}

.fs-compact-selected {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid #eef2f7;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.fs-compact-selected strong {
  color: #111827;
  font-weight: 900;
}

.fs-native-select-hidden,
.fs-native-image-variants-hidden,
.fs-native-variant-label-hidden,
.fs-native-variant-block-hidden,
.fs-native-variant-trigger-hidden {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

@media (max-width: 767px) {
  .fs-compact-variants {
    position: relative;
    left: auto;
    right: auto;
    float: none;
    clear: both;
    transform: none;
    width: calc(100% - 28px);
    width: min(460px, calc(100% - 28px));
    max-width: 460px;
    min-width: 0;
    margin: 16px auto;
    box-sizing: border-box;
    overflow: visible;
  }

  .fs-compact-toggle {
    grid-template-columns: 1fr 14px;
    gap: 10px;
    min-height: 50px;
    padding: 10px 14px;
    border-radius: 13px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
  }

  .fs-compact-toggle-label,
  .fs-compact-toggle-value {
    grid-column: 1;
  }

  .fs-compact-toggle-value {
    white-space: normal;
  }

  .fs-compact-toggle b {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .fs-compact-panel {
    max-height: min(58vh, 440px);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
    border-radius: 13px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .1);
    box-sizing: border-box;
  }

  .fs-compact-groups {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .fs-compact-group h3 {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .fs-compact-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .fs-compact-option {
    width: 100%;
    height: 46px;
    min-width: 0;
    padding: 0 8px;
    border-radius: 10px;
    background: #fff !important;
    color: #111827 !important;
    font-size: 13px !important;
  }

  .fs-compact-option-main {
    font-size: 13px;
  }

  .fs-compact-option.is-selected {
    background: #f6c400 !important;
    color: #111827 !important;
  }

  .fs-compact-selected {
    margin-top: 11px;
    padding-top: 9px;
  }
}

@media (max-width: 420px) {
  .fs-compact-panel {
    padding: 11px;
  }

  .fs-compact-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fs-compact-option {
    height: 44px;
  }
}
