/* Renk swatch — PDP + ürün kartı (myt-product-variations.js)
 * Premium: yüzey ölçeği .myt-pv__swatch-face, dış halka ::after, tooltip ::before + data-title */

.myt-pv__hidden {
  display: none !important;
}

.myt-pv__group-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #444;
}

.myt-pv__swatch-row {
  min-height: 32px;
  gap: 0.35rem !important;
}

/* Ortak: yüzey taşıyıcı */
.myt-pv__swatch-face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  transition: transform 0.3s ease;
  will-change: transform;
}

a.myt-pv__swatch--pdp,
a.myt-pv__swatch--card,
span.myt-pv__swatch--pdp,
span.myt-pv__swatch--card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}

a.myt-pv__swatch--pdp:focus-visible,
a.myt-pv__swatch--card:focus-visible {
  outline: none;
}

a.myt-pv__swatch--pdp:focus-visible,
a.myt-pv__swatch--card:focus-visible,
.myt-pv__swatch:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0d6efd;
}

/* —— Tooltip (üst) —— */
.myt-pv__swatch[data-title]::before {
  content: attr(data-title);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 5;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: #fff;
  background: rgba(15, 15, 15, 0.92);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

@media (hover: hover) and (pointer: fine) {
  .myt-pv__swatch[data-title]:hover:not(.is-oos)::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.myt-pv__swatch[data-title]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— Dış halka (ring) ::after —— */
.myt-pv__swatch::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid transparent;
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.myt-pv__swatch .myt-pv__swatch-face {
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .myt-pv__swatch:hover:not(.is-oos)::after {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) inset, 0 2px 12px rgba(0, 0, 0, 0.08);
  }

  .myt-pv__swatch:hover:not(.is-oos) .myt-pv__swatch-face {
    transform: scale(1.15);
  }
}

.myt-pv__swatch:active:not(.is-oos) .myt-pv__swatch-face {
  transform: scale(1.08);
}

/* PDP: daha büyük dokunma alanı */
.myt-pv__swatch--pdp {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: #fff;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.myt-pv__swatch--pdp.is-active {
  border-color: rgba(0, 0, 0, 0.35);
}

.myt-pv__swatch--pdp.is-active::after {
  opacity: 1;
  transform: scale(1);
  border-color: rgba(26, 26, 26, 0.85);
  border-width: 2px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(26, 26, 26, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.12);
}

.myt-pv__swatch--pdp.is-active .myt-pv__swatch-face {
  transform: scale(1.1);
}

.myt-pv__swatch--pdp.is-oos {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.myt-pv__swatch--pdp.is-oos::after {
  opacity: 0 !important;
}

.myt-pv__swatch-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-sizing: border-box;
}

.myt-pv__swatch-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  color: #333;
}

.myt-pv__swatch-text--sm {
  font-size: 8px;
}

.myt-pv__swatch-strike {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  height: 2px;
  background: rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%) rotate(-42deg);
  pointer-events: none;
  border-radius: 1px;
  z-index: 2;
}

/* Kart swatch */
.myt-pv__swatch--card {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.myt-pv__swatch--card.is-active {
  border-color: rgba(0, 0, 0, 0.4);
}

.myt-pv__swatch--card.is-active::after {
  opacity: 1;
  transform: scale(1);
  border-color: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) inset, 0 2px 10px rgba(0, 0, 0, 0.1);
}

.myt-pv__swatch--card.is-active .myt-pv__swatch-face {
  transform: scale(1.1);
}

.myt-pv__swatch--card.is-oos {
  opacity: 0.45;
  cursor: default;
  filter: grayscale(0.2);
}

.myt-pv__swatch--card.is-oos::after {
  opacity: 0 !important;
}

.myt-pv__more {
  line-height: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .myt-pv__swatch-face,
  .myt-pv__swatch::after,
  .myt-pv__swatch[data-title]::before {
    transition-duration: 0.01ms;
  }

  @media (hover: hover) and (pointer: fine) {
    .myt-pv__swatch:hover:not(.is-oos) .myt-pv__swatch-face {
      transform: none;
    }
  }

  .myt-pv__swatch--pdp.is-active .myt-pv__swatch-face,
  .myt-pv__swatch--card.is-active .myt-pv__swatch-face {
    transform: none;
  }
}
