/* KickRebel size dropdown — replaces the #kr-size-swatches button grid.
   Does not restyle color swatches, checkout, or prices. */

#kr-size-swatches:has(.kr-size-dd) {
  display: block;
  width: 100%;
  flex-wrap: unset;
  gap: 0;
}

#kr-size-swatches .kr-swatch {
  display: none !important;
}

.kr-size-dd {
  position: relative;
  width: 100%;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.3;
  color: #111;
  -webkit-tap-highlight-color: transparent;
}

.kr-size-dd__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 16px;
  border: 2px solid #c8c8c8;
  border-radius: 12px;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.kr-size-dd__toggle:hover {
  border-color: #111;
}

.kr-size-dd.is-open .kr-size-dd__toggle {
  border-color: #111;
}

.kr-size-dd__toggle:focus {
  outline: 2px solid rgba(0, 0, 0, 0.12);
  outline-offset: 1px;
}

.kr-size-dd.is-open .kr-size-dd__toggle {
  border-color: #111;
}

.kr-size-dd__value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.55em;
  min-width: 0;
}

.kr-size-dd__value.is-placeholder {
  color: #9ca3af;
  font-weight: 500;
}

.kr-size-dd__value-eu,
.kr-size-dd__value-us,
.kr-size-dd__value-cm {
  color: #111;
  font-weight: 600;
  white-space: nowrap;
}

.kr-size-dd__value-dot {
  color: #111;
  font-weight: 600;
  user-select: none;
}

.kr-size-dd__chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #111;
  transition: transform 0.15s ease;
}

.kr-size-dd.is-open .kr-size-dd__chevron {
  transform: rotate(180deg);
}

.kr-size-dd__list {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: min(420px, 70vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 2px solid #111;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.kr-size-dd.is-open .kr-size-dd__list {
  display: block;
}

.kr-size-dd__option {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.kr-size-dd__option + .kr-size-dd__option {
  box-shadow: 0 -1px 0 #f3f4f6;
}

.kr-size-dd__option.is-clothing {
  display: block;
  font-weight: 700;
}

.kr-size-dd__eu {
  font-weight: 700;
  text-align: left;
  color: #111;
}

.kr-size-dd__us {
  font-weight: 500;
  text-align: center;
  color: #6b7280;
}

.kr-size-dd__cm {
  font-weight: 500;
  text-align: right;
  color: #6b7280;
}

.kr-size-dd__option:hover:not(.is-disabled):not(.is-selected) {
  background: #f9fafb;
}

.kr-size-dd__option.is-selected {
  background: #111;
  color: #fff;
  box-shadow: none;
}

.kr-size-dd__option.is-selected .kr-size-dd__eu,
.kr-size-dd__option.is-selected .kr-size-dd__us,
.kr-size-dd__option.is-selected .kr-size-dd__cm {
  color: #fff;
}

.kr-size-dd__option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.kr-size-dd__option:focus {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: -2px;
}

.kr-size-dd__option.is-selected:focus {
  outline-color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 768px) {
  .kr-size-dd__toggle {
    min-height: 50px;
    padding: 11px 14px;
  }

  .kr-size-dd__list {
    max-height: min(360px, 60vh);
    padding: 4px;
  }

  .kr-size-dd__option {
    min-height: 44px;
    padding: 8px 12px;
  }
}
