/* ══════════════════════════════════════════════════════════════
   XXL ART — Wandfarbe in der scaleBgZoom-Ansicht
   /css/wall_color.css

   Markup: content_inc/scale_bg_zoom/wall_color_box.php
   Optik 1:1 aus room_preview/v3/css/room_preview.css (.rp-colors, .rp-swatch,
   .rp-picker) übernommen — nur mit Prefix .wc- statt .rp-.
   Handy: Leiste, Farben horizontal wischen. Desktop (ab 1024px): Popover mit Raster.
   ══════════════════════════════════════════════════════════════ */

/* eingefärbte Wand: deckungsgleich über #bg_image (gleicher Container #wrapper_inner) */
.wc-painted {
  position: absolute;
  left: 0;
  top: 5px;              /* = #bg_image top (wird per JS nachgezogen) */
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;  /* Ziehen/Zoomen geht weiter ans Raumbild */
}
.wc-painted[hidden] { display: none; }

.wc {
  --wc-surface:  var(--color-surface, #fff);
  --wc-panel-bg: rgba(255, 255, 255, .7);
  --wc-text:     var(--color-text, #1c1a17);
  --wc-muted:    var(--color-text-subtle, rgba(28, 26, 23, .55));
  --wc-line:     var(--color-border-strong, rgba(28, 26, 23, .12));
  --wc-gold:     var(--gold, #a8873a);

  position: relative;
  display: inline-block;
  vertical-align: middle;
  font-family: var(--font-primary, "Inter", system-ui, sans-serif);
  color: var(--wc-text);
  text-align: left;
}

.wc button {
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
}

/* ── Button ── */
.wc .wc-btn {
  font-family: var(--font-display, "Antonio", "Arial Narrow", sans-serif);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--wc-panel-bg);
  color: var(--wc-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.wc .wc-btn:hover { background: rgba(255, 255, 255, .9); }
.wc .wc-btn.is-on { color: var(--wc-gold); }
.wc .wc-btn.has-wall svg { color: var(--wc-hex); }

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .wc .wc-btn,
  .wc-panel {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

.wc button:focus-visible {
  outline: 2px solid var(--wc-gold);
  outline-offset: 2px;
}

/* ── Panel (Handy: Leiste über dem Button, volle Breite) ── */
.wc-panel {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 0 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--wc-panel-bg);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .wc-panel { background: rgba(255, 255, 255, .95); }
}
.wc-panel[hidden] { display: none; }

.wc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 6px 16px;
}
.wc-kicker {
  font-family: var(--font-display, "Antonio", "Arial Narrow", sans-serif);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  color: var(--wc-muted);
}
.wc-current {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.wc .wc-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--wc-text);
  cursor: pointer;
}
.wc .wc-close:hover { color: var(--wc-gold); }

/* eine Zeile, horizontal wischen */
.wc-grid {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 16px 4px;
}
.wc-grid::-webkit-scrollbar { display: none; }
.wc-grid[hidden] { display: none; }

.wc-top {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}
.wc .wc-orig,
.wc .wc-custom {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 12px;
  margin: 0;
  border: 1px solid var(--wc-line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.wc .wc-orig.is-on,
.wc .wc-custom.is-on { border-color: var(--wc-gold); box-shadow: 0 0 0 1px var(--wc-gold); }
/* Punkt: Regenbogen, solange keine eigene Farbe gewählt ist — sonst die Farbe (wall_color.js mark) */
.wc-custom-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0897a, #e3cf74, #8fcf86, #7fb9d9, #b294d6);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.wc-family {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wc-family-name {
  display: block;
  font-size: 10px;
  letter-spacing: .04em;
  white-space: nowrap;
  opacity: .7;
}
.wc-row {
  display: flex;
  gap: 6px;
}
.wc .wc-swatch {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 2px solid var(--wc-surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--wc-line);
  cursor: pointer;
}
.wc .wc-swatch.is-on { box-shadow: 0 0 0 2px var(--wc-gold); }

/* ── Eigene Farbe: drei Regler (wall_color_picker.js) ── */
.wc-picker { padding: 2px 16px 0; }
.wc-picker[hidden] { display: none; }
.wc-picker-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.wc .wc-picker-back {
  padding: 8px 14px;
  margin: 0;
  border: 0;
  border-radius: 100px;
  background: rgba(0, 0, 0, .06);
  color: inherit;
  font-size: 13px;
  cursor: pointer;
}
.wc-picker-dot {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.wc-picker-row { display: block; margin-bottom: 12px; }
.wc-picker-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .7;
}
/* Verlauf liegt direkt auf dem Input (JS), Spur selbst unsichtbar */
.wc-picker-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 100px;
  outline: 0;
  cursor: pointer;
  touch-action: pan-y;
}
.wc-picker-range::-webkit-slider-runnable-track { height: 26px; background: transparent; border: 0; }
.wc-picker-range::-moz-range-track { height: 26px; background: transparent; border: 0; }
.wc-picker-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -2px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .1);
}
.wc-picker-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

/* ── Desktop: Popover mit Raster über dem Button ── */
@media (min-width: 1024px) {
  .wc-panel {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: calc(100% + 12px);
    width: 300px;
    margin-left: -150px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(20, 20, 19, .18);
  }
  .wc-head { padding: 0 0 10px; }
  .wc .wc-close { min-width: 28px; height: 28px; margin-right: -6px; }
  .wc-grid {
    display: block;
    overflow: visible;
    padding: 0;
  }
  .wc-grid[hidden] { display: none; }
  .wc-top { margin-bottom: 12px; }
  .wc .wc-orig,
  .wc .wc-custom { flex: 1 1 0; min-height: 34px; }
  .wc-family { display: block; }
  .wc-family + .wc-family { margin-top: 10px; }
  .wc-family-name { margin-bottom: 5px; font-size: 11px; }
  .wc-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    justify-items: center;
  }
  .wc .wc-swatch { width: 38px; height: 38px; }
  .wc-picker { padding: 0; }
}

/* ── Seitenaufbau mit gespeicherter Wandfarbe (Inline-Script in scale_bg_zoom_content.php) ──
   Raumbild unsichtbar, Fläche schon in der Wandfarbe — wall_color.js nimmt die Klasse weg,
   sobald die Wand gefärbt ist, und blendet das Canvas weich ein. */
.wc-pending #bg_image { opacity: 0; }
.wc-pending #wrapper,
.wc-pending #wrapper_inner { background: var(--wc-pending-hex) !important; }

/* ── Variante Icon (wall_color_box.php: .wc--icon in .product_img_main_icons bei Like/Zoom) ──
   Optik vom Button kommt aus scaleBgZoom_v3.css (#wrapper_outer .icon), hier nur Farbpunkt + Panel-Lage. */
.wc--icon {
  display: block;
  line-height: 0;
}
.wc--icon .wc-icon {
  position: relative;
}
.wc--icon .wc-panel { line-height: normal; }
/* kleiner Punkt unten rechts = aktuelle Wandfarbe (nur wenn eine gewählt ist) */
.wc--icon .wc-icon-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--wc-hex, transparent);
  display: none;
}
.wc--icon .wc-icon.has-wall .wc-icon-dot { display: block; }
.wc--icon .wc-icon.is-on { background: rgba(0, 0, 0, .95); }

@media (min-width: 1024px) {
  /* Panel geht links neben der Icon-Spalte auf (rechts sitzt die Cart-Box) */
  .wc--icon .wc-panel {
    left: auto;
    right: calc(100% + 14px);
    top: 0;
    bottom: auto;
    margin-left: 0;
    max-height: 50vh;   /* sitzt im #wrapper (overflow hidden) — nicht unten abschneiden */
  }
}
