/** Shopify CDN: Minification failed

Line 109:3 Cannot use type selector "--active" directly after nesting selector "&"
Line 113:3 Cannot use type selector "--unavailable" directly after nesting selector "&"

**/
/* Product Variant Selector Component */

.product-variant-selector {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-m, 16px);
  /* Allow tooltips to overflow */
  overflow: visible;
}

/* Header */
.product-variant-selector__header {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs, 8px);
}

.product-variant-selector__label {
  font-family: var(--font-body-family, sans-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary-darkest, #313329);
}

.product-variant-selector__current-color {
  font-family: var(--font-body-family, sans-serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-primary-darkest, #313329);
}

.product-variant-selector__help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: var(--color-primary-darkest, #313329);
  border-radius: 50%;
  color: var(--neu-background, #ffffff);
  cursor: pointer;
  transition: opacity 0.2s ease;

  &:hover {
    opacity: 0.8;
  }

  &:focus-visible {
    outline: 2px solid var(--color-primary-darkest, #313329);
    outline-offset: 2px;
  }

  & svg {
    width: 100%;
    height: 100%;
  }
}

/* Explicit selectors to ensure broad engine support (no nesting reliance) */
.product-variant-selector__color-link[data-available="false"] {
  display: none;
}

/* Colors List */
.product-variant-selector__colors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs, 8px);
  align-items: flex-start;
  /* Allow tooltips to overflow */
  overflow: visible;
}

.product-variant-selector__color-item {
  display: flex;
  /* Allow tooltips to overflow */
  overflow: visible;
}

.product-variant-selector__color-link {
  display: block;
  position: relative;
  width: 30px;
  height: 30px;
  overflow: visible;
  transition: transform 0.2s ease;
  cursor: pointer;

  &:hover {
    transform: scale(1.1);
    z-index: 10;
  }

  &:focus-visible {
    outline: 2px solid var(--color-primary-darkest, #313329);
    outline-offset: 2px;
  }

  &--active {
    cursor: default;
  }

  &--unavailable,
  &[data-available="false"] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);

    /* Diagonal slash overlay */
    &::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 34px;
      height: 2px;
      background: var(--color-primary-darkest, #313329);
      opacity: 0.6;
      transform: translate(-50%, -50%) rotate(45deg);
      z-index: 5;
      pointer-events: none;
    }

    &:hover {
      transform: none;
    }
  }
}

.product-variant-selector__color-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;

  /* Inner color square - 16x16px centered */
  &::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background-color: var(--swatch-background, var(--neu-hellgrau, #f6f6f6));
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  /* Border - 23.957px with offset */
  &::after {
    content: '';
    position: absolute;
    top: 0.04px;
    left: 0.44px;
    width: 30px;
    height: 30px;
    border: 1px solid var(--color-primary-darkest, #313329);
    opacity: 0.1;
  }

  /* Active state border */
  .product-variant-selector__color-link--active & {
    &::after {
      opacity: 1;
    }
  }
}

/* Color name tooltip overlay */
.product-variant-selector__color-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--spacing-xs, 8px) var(--spacing-s, 12px);
  background-color: var(--color-primary-darkest, #313329);
  color: var(--neu-background, #ffffff);
  font-family: var(--font-body-family, sans-serif);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 100;

  /* Tooltip arrow */
  &::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--color-primary-darkest, #313329);
  }
}

/* Show tooltip on hover for all variants (including unavailable) */
.product-variant-selector__color-link:hover .product-variant-selector__color-tooltip {
  opacity: 1;
}

/* Empty state */
.product-variant-selector__empty {
  font-family: var(--font-body-family, sans-serif);
  font-size: 14px;
  color: var(--color-foreground-subtle, #666);
  margin: 0;
}

/* Loading state - prevent interaction and show wait cursor */
.variant-selector--loading .product-variant-selector__color-link {
  cursor: wait;
  pointer-events: all; /* Keep pointer events to show wait cursor */
}

.variant-selector--loading .product-variant-selector__color-link:hover {
  transform: none; /* Disable hover transform during loading */
}

/* Visually hidden utility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
