/* Color swapper palettes. Only the ambience tokens move; text (--_colors---dark--*) stays put.
   Selector html[data-palette] (0,1,1) beats webflow.css :root (0,1,0).
   Each palette is also scoped to its swatch so the button previews it. */

.cs-swatch[data-key="origine"] {
  --_colors---kaki--base: #faf9f5;
  --_colors---kaki--dark: #97968d;
  --_colors---cream--base: #f0eee6;
  --_colors---brown--base: #5f4242;
}

html[data-palette="terra"], .cs-swatch[data-key="terra"] {
  --_colors---kaki--base: #e4d2c0;
  --_colors---kaki--dark: #b5765a;
  --_colors---cream--base: #fdf5ec;
  --_colors---brown--base: #9a4f31;
}

html[data-palette="beige"], .cs-swatch[data-key="beige"] {
  --_colors---kaki--base: #e6dccb;
  --_colors---kaki--dark: #a8987f;
  --_colors---cream--base: #fffaf1;
  --_colors---brown--base: #6e5641;
}

html[data-palette="sauge"], .cs-swatch[data-key="sauge"] {
  --_colors---kaki--base: #d2d8c7;
  --_colors---kaki--dark: #8a977f;
  --_colors---cream--base: #f8faf2;
  --_colors---brown--base: #4d5b45;
}

/* Sage grounds with clay mid-tones: the classic pairing for sage */
html[data-palette="sauge-argile"], .cs-swatch[data-key="sauge-argile"] {
  --_colors---kaki--base: #d5dacb;
  --_colors---kaki--dark: #b06d4f;
  --_colors---cream--base: #faf7ef;
  --_colors---brown--base: #8c4a30;
}

/* Swapper UI: round pen button fixed bottom-right, swatches in a pill that opens beside it */
.cs {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Interdisplay, Arial, sans-serif;
}

.cs-toggle {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--_colors---dark--base);
  color: var(--_colors---cream--base);
  box-shadow: 0 8px 24px rgba(20, 20, 22, 0.25);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.cs-toggle svg {
  width: 28px;
  height: 28px;
}

.cs-toggle:hover {
  transform: scale(1.05);
}

.cs-panel {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--_colors---cream--base);
  color: var(--_colors---dark--base);
  box-shadow: 0 8px 24px rgba(20, 20, 22, 0.18);
}

.cs[data-open] .cs-panel {
  display: flex;
}

.cs-swatches {
  display: flex;
  gap: 6px;
}

.cs-swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(20, 20, 22, 0.2);
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, var(--_colors---kaki--base) 50%, var(--_colors---kaki--dark) 50%);
}

.cs-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--_colors---cream--base), 0 0 0 3px var(--_colors---dark--base);
}

.cs-toggle:focus-visible,
.cs-swatch:focus-visible {
  outline: 2px solid var(--_colors---dark--base);
  outline-offset: 3px;
}

.cs-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .cs {
    right: 16px;
    bottom: 16px;
  }

  .cs-toggle {
    width: 56px;
    height: 56px;
  }

  .cs-label {
    display: none;
  }
}

/* Fiche pages: the 21oaks price card is fixed bottom-right (25vw desktop, 40vw tablet, centered on mobile
   with a free strip below it): the pen sits just left of it, or in that strip on mobile. */
body:has(.fixed_price) .cs {
  right: calc(25vw + 54px);
}

@media (max-width: 991px) {
  body:has(.fixed_price) .cs {
    right: calc(40vw + 39px);
    bottom: 23px;
  }
}

@media (max-width: 767px) {
  body:has(.fixed_price) .cs {
    right: 16px;
    bottom: 5px;
  }

  body:has(.fixed_price) .cs-toggle {
    width: 48px;
    height: 48px;
  }
}
