/* Native radio controls share one frame-color choice across the product and offers. */
.frame-color-selector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 10px;
  min-inline-size: 0;
  padding: 0;
  border: 0;
  color: #111;
}

.frame-color-selector .frame-color-label {
  float: left;
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 44px;
  text-align: left;
  white-space: nowrap;
}

/* The package heading's decorative lines must not reach this nested legend. */
.frame-color-selector .frame-color-label::before,
.frame-color-selector .frame-color-label::after {
  content: none;
}

.frame-color-options {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.frame-color-choice {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.frame-color-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.frame-color-swatch {
  display: block;
  width: 32px;
  height: 32px;
  border: 1px solid #d9d9d9;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
}

.frame-color-swatch[data-color="black"] {
  border-color: #090909;
  background: #050505;
}

.frame-color-swatch[data-color="gold"] {
  border-color: #c49d3a;
  background: linear-gradient(135deg, #d8b64c, #caa139);
}

.frame-color-swatch[data-color="white"] {
  border-color: #d9d9d9;
  background: #fff;
}

.frame-color-choice input:checked + .frame-color-swatch {
  outline: 1px solid #1f1d18;
  outline-offset: 2px;
}

.frame-color-choice input:focus-visible + .frame-color-swatch {
  outline: 3px solid #245e8b;
  outline-offset: 3px;
}

.frame-color-selector--product {
  width: 400px;
  max-width: calc(100% - 10px);
  min-height: 58px;
  justify-content: space-between;
  margin: -9px 5px 18px;
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px #ededed40;
}

.frame-color-selector--product + .ugc-videos {
  margin-top: 24px;
}

.frame-color-selector--offer {
  margin: 0 16px;
  padding: 7px 0 9px;
  border: 0;
}

.frame-color-popular {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 32px;
  margin-left: 3px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #f2e9dd;
  color: #754913;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
}

.offer:not(.selected) .frame-color-selector--offer {
  display: none;
}

/* Keep the chosen frame shade directly below the mirror names in the cart. */
.cart-drawer .cart-item-copy .cart-item-frame-color {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  color: #777;
  font-size: 13px;
  line-height: 1.45;
}

.cart-item-frame-color .cart-item-frame-swatch {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
}

@media (max-width: 480px) {
  .cart-drawer .cart-item-copy .cart-item-frame-color {
    font-size: 12px;
  }
}

@media (hover: hover) {
  .frame-color-choice:hover input:not(:checked):not(:focus-visible) + .frame-color-swatch {
    outline: 1px solid #898989;
    outline-offset: 3px;
  }
}

@media (max-width: 760px) {
  .gallery-note {
    display: none;
  }

  .gallery > .frame-color-selector--product {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .frame-color-selector--product {
    margin: -7px 2px 16px;
    max-width: calc(100% - 4px);
    padding-inline: 10px;
    gap: 2px 8px;
  }

  .frame-color-selector--product + .ugc-videos {
    margin-top: 16px;
  }

  .frame-color-selector--offer {
    margin-top: -8px;
    padding-top: 0;
  }

  .frame-color-options {
    gap: 2px;
  }

  .frame-color-popular {
    min-width: 0;
    margin-left: 2px;
    padding-inline: 9px;
    font-size: 13px;
  }
}

@container (max-width: 500px) {
  .frame-color-selector--offer {
    margin-inline: 14px;
    gap: 2px 8px;
  }
}

@container (max-width: 340px) {
  .frame-color-selector--offer {
    margin-inline: 10px;
  }
}

@media (forced-colors: active) {
  .frame-color-swatch {
    forced-color-adjust: none;
  }

  .frame-color-choice input:checked + .frame-color-swatch {
    outline-color: CanvasText;
  }

  .frame-color-choice input:focus-visible + .frame-color-swatch {
    outline-color: Highlight;
  }
}
