/* Konfigüratör altındaki interaktif Renk Stüdyosu.
   Renk listesi ve ürün fotoğrafları js/colors-data.js'ten gelir; renk doğruluğunun
   kaynağı her zaman gerçek ip fotoğrafıdır, dekoratif hex değeri değildir. */

.config-colors {
  scroll-margin-top: 88px;
  padding-bottom: var(--space-9);
}

.color-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr);
  align-items: end;
  gap: var(--space-7);
  margin-bottom: var(--space-7);
}

.color-intro-copy h2 {
  max-width: 17ch;
  margin-bottom: var(--space-3);
}

.color-intro-copy p {
  max-width: 58ch;
  margin: 0;
  color: var(--color-ink-soft);
  font-size: var(--text-md);
}

.color-proof-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.color-proof-list span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink-soft);
  box-shadow: var(--shadow-sm);
}

.color-proof-list svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--color-brand-coral);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.color-proof-list b {
  font-size: 12px;
  line-height: 1.2;
}

.color-studio {
  display: grid;
  grid-template-columns: minmax(360px, .84fr) minmax(0, 1.16fr);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.color-stage {
  --palette-1: #f0dd23;
  --palette-2: #f75c14;
  --palette-3: #4d3878;
  --palette-4: #2c8580;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: var(--space-7);
  background:
    linear-gradient(160deg, rgba(255,255,255,.06), transparent 42%),
    var(--color-brand-navy-deep);
  color: var(--color-on-navy);
}

.color-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 78%);
}

.color-stage-glow {
  position: absolute;
  z-index: -1;
  width: 250px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: .38;
  filter: blur(72px);
  pointer-events: none;
  transition: background-color var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.glow-one { top: 18%; left: -24%; background: var(--palette-1); }
.glow-two { right: -28%; bottom: 8%; background: var(--palette-2); }
.glow-three { right: 18%; top: 42%; width: 180px; background: var(--palette-3); opacity: .3; }
.glow-four { left: 18%; bottom: -12%; width: 170px; background: var(--palette-4); opacity: .28; }

.color-stage-head {
  position: relative;
  z-index: 2;
}

.color-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-2);
  color: var(--color-brand-yellow);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.color-stage-head h3 {
  margin: 0 0 var(--space-2);
  color: inherit;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.color-stage-head p {
  max-width: 38ch;
  margin: 0;
  color: rgba(253,246,227,.75);
  font-size: var(--text-xs);
}

.palette-ropes {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: var(--space-5) 0 var(--space-3);
}

.palette-rope {
  position: relative;
  width: clamp(64px, 6.2vw, 86px);
  min-height: 340px;
  padding: 0 7px 46px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-on-navy);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--duration-base) var(--ease-out), filter var(--duration-base) var(--ease-out);
}

.palette-rope:nth-child(1) { transform: rotate(-8deg) translateY(16px); }
.palette-rope:nth-child(2) { z-index: 2; transform: rotate(-3deg) translateY(-8px); }
.palette-rope:nth-child(3) { z-index: 2; transform: rotate(3deg) translateY(-8px); }
.palette-rope:nth-child(4) { transform: rotate(8deg) translateY(16px); }

.palette-rope:hover { filter: brightness(1.08); }
.palette-rope:nth-child(1):hover { transform: rotate(-8deg) translateY(8px); }
.palette-rope:nth-child(2):hover { transform: rotate(-3deg) translateY(-16px); }
.palette-rope:nth-child(3):hover { transform: rotate(3deg) translateY(-16px); }
.palette-rope:nth-child(4):hover { transform: rotate(8deg) translateY(8px); }

.palette-rope img {
  display: block;
  width: 100%;
  height: 278px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-pill);
  box-shadow: 0 18px 36px rgba(0,0,0,.3);
}

.palette-rope.is-active img {
  outline: 4px solid var(--color-brand-yellow);
  outline-offset: 4px;
}

.palette-rope:focus-visible {
  outline: 3px solid var(--color-brand-yellow);
  outline-offset: 5px;
}

.palette-rope-number {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: rgba(11,30,56,.72);
  font-size: 10px;
  font-weight: 800;
}

.palette-rope-name {
  position: absolute;
  right: -10px;
  bottom: 4px;
  left: -10px;
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.palette-rope-name small {
  display: block;
  margin-top: 2px;
  color: rgba(253,246,227,.62);
  font-size: 9px;
  font-weight: 600;
}

.palette-help {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: rgba(253,246,227,.62);
  font-size: 11px;
  font-weight: 600;
}

.palette-help-line {
  width: 36px;
  height: 1px;
  background: rgba(253,246,227,.35);
}

.color-picker {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-7);
}

.color-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.color-picker .color-eyebrow { color: var(--color-brand-coral); }

.color-picker-head h3 {
  margin: 0;
  font-size: var(--text-xl);
}

.color-selection-count {
  display: grid;
  min-width: 56px;
  min-height: 44px;
  place-items: center;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-surface-alt);
  color: var(--color-ink-soft);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
}

.color-swatch {
  position: relative;
  min-width: 0;
  min-height: 76px;
  padding: 5px 3px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.color-swatch:hover { transform: translateY(-2px); background: var(--color-surface-alt); }
.color-swatch:active { transform: scale(.96); }
.color-swatch.is-selected { border-color: var(--color-border-strong); background: var(--color-surface-alt); }
.color-swatch:focus-visible { outline: 3px solid var(--color-brand-coral); outline-offset: 2px; }

.color-swatch-texture {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 4px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--swatch-color);
  box-shadow: var(--shadow-sm);
}

.color-swatch-texture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.color-swatch-check {
  position: absolute;
  top: -1px;
  right: -1px;
  display: none;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-brand-coral);
  color: var(--color-chip-active-text);
  font-size: 11px;
  font-weight: 900;
}

.color-swatch.is-selected .color-swatch-check { display: grid; }

.color-swatch-code {
  display: block;
  overflow: hidden;
  color: var(--color-ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-swatch-name {
  display: block;
  overflow: hidden;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1040px) {
  .color-intro { grid-template-columns: 1fr; gap: var(--space-5); }
  .color-proof-list { justify-content: flex-start; }
  .color-studio { grid-template-columns: 1fr; }
  .color-stage { min-height: 590px; }
  .palette-ropes { min-height: 350px; }
  .color-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .config-colors { padding-inline: var(--space-5); }
}

@media (max-width: 720px) {
  .config-colors { padding-bottom: var(--space-7); }
  .color-intro { margin-bottom: var(--space-5); }
  .color-intro-copy p { font-size: var(--text-sm); }
  .color-proof-list { display: grid; grid-template-columns: 1fr; }
  .color-proof-list span { width: 100%; }
  .color-studio { border-radius: var(--radius-lg); }
  .color-stage,
  .color-picker { padding: var(--space-5); }
  .color-stage { min-height: 520px; }
  .palette-ropes { min-height: 330px; }
  .palette-rope { width: clamp(62px, 19vw, 84px); min-height: 314px; }
  .palette-rope img { height: 250px; }
  .palette-help { justify-content: center; }
  .color-picker-head h3 { font-size: var(--text-lg); }
  .color-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 390px) {
  .config-colors { padding-inline: var(--space-4); }
  .color-stage,
  .color-picker { padding: var(--space-4); }
  .color-stage { min-height: 500px; }
  .palette-rope { width: 24%; padding-inline: 4px; }
  .palette-rope img { height: 238px; }
  .color-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .palette-rope,
  .palette-rope:hover,
  .palette-rope:nth-child(1),
  .palette-rope:nth-child(1):hover,
  .palette-rope:nth-child(2),
  .palette-rope:nth-child(2):hover,
  .palette-rope:nth-child(3),
  .palette-rope:nth-child(3):hover,
  .palette-rope:nth-child(4),
  .palette-rope:nth-child(4):hover,
  .color-swatch,
  .color-swatch:hover {
    transform: none;
  }
}
