/* Atelier — "Find My Size" fit finder.
   Fully self-contained: every rule is scoped under .atelier-ff (or the widget's
   own modal), and nothing here depends on atelier.css. That's what lets the
   widget render on the default WooCommerce page, a Woodmart layout, or the
   Atelier layout without inheriting or leaking styles.

   The one exception is .size-pill.is-reco — the green "recommended" badge on
   the Atelier layout's own size buttons, which by definition lives outside the
   widget. */

.atelier-ff {
  --ff-ink: #1A1A1A;
  --ff-ink-soft: #6A645B;
  --ff-ink-faint: #9A938A;
  --ff-line: #E8E1D7;
  --ff-bg: #FAF8F5;
  --ff-surface: #FFFFFF;
  --ff-accent: #8B6F47;
  --ff-ok: #4B6B4F;

  display: block;
  margin: 14px 0;
  font-family: inherit;
}

/* ------------------------------------------------------------- trigger */

.atelier-ff-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 0 2px; border: 0; border-bottom: 1px solid var(--ff-line);
  background: none; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--ff-ink-soft);
  transition: color .2s, border-color .2s;
}
.atelier-ff-trigger:hover { color: var(--ff-accent); border-color: var(--ff-accent); }
.atelier-ff-trigger svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------- note */

.atelier-ff .ff-note {
  display: flex; gap: 8px; align-items: center; margin-top: 12px;
  font-size: 13px; color: var(--ff-ok);
}
.atelier-ff .ff-note[hidden] { display: none; }
.atelier-ff .ff-note svg { width: 15px; height: 15px; flex: none; }

/* Recommended badge on the Atelier layout's size pills (outside the widget). */
.size-pill.is-reco { position: relative; }
.size-pill.is-reco:not(.is-active) { border-color: #4B6B4F; box-shadow: 0 0 0 1px #4B6B4F; }
.size-pill.is-reco::before {
  content: "\2713"; position: absolute; top: -7px; right: -7px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #4B6B4F; color: #fff; font-size: 10px; line-height: 1;
  display: grid; place-items: center; border: 1.5px solid #FAF8F5;
}

/* -------------------------------------------------------------- modal */

.atelier-ff-modal {
  position: fixed; inset: 0; z-index: 100000;
  display: grid; place-items: center; padding: 24px;
  background: rgba(26,26,26,.45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.atelier-ff-modal.is-open { opacity: 1; pointer-events: auto; }

.atelier-ff-card {
  background: var(--ff-bg); color: var(--ff-ink);
  width: 560px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  border: 1px solid var(--ff-line);
  transform: translateY(14px); transition: transform .25s;
  text-align: left;
}
.atelier-ff-modal.is-open .atelier-ff-card { transform: translateY(0); }

.atelier-ff-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px; border-bottom: 1px solid var(--ff-line);
}
.atelier-ff-head h3 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.1; }
.atelier-ff-x {
  width: 36px; height: 36px; border: 0; background: none; cursor: pointer;
  border-radius: 50%; display: grid; place-items: center; color: var(--ff-ink);
}
.atelier-ff-x:hover { background: rgba(0,0,0,.05); }
.atelier-ff-x svg { width: 18px; height: 18px; }

.atelier-ff-body { padding: 24px 26px 30px; }
.atelier-ff .ff-lede { margin: 0 0 20px; font-size: 13.5px; color: var(--ff-ink-soft); }
.atelier-ff .ff-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ff-accent);
}

/* ------------------------------------------------------ measurements group

   One form, no tabs. The girth sliders sit in their own block so it reads as
   "here's what we worked out — correct it if you know better", rather than as
   a second set of questions. */

.atelier-ff .ff-measure {
  border: 1px solid var(--ff-line);
  padding: 16px 14px 6px;
  margin: 0 0 22px;
  background: rgba(0, 0, 0, 0.015);
}
.atelier-ff .ff-measure-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ff-ink);
}
.atelier-ff .ff-reset {
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: none; color: var(--ff-ink-faint);
  border-bottom: 1px solid var(--ff-line);
  transition: color .18s, border-color .18s;
}
.atelier-ff .ff-reset:hover { color: var(--ff-accent); border-color: var(--ff-accent); }
.atelier-ff .ff-reset[hidden] { display: none; }

/* Marks a slider that is still following the height/weight estimate. */
.atelier-ff .ff-est {
  font-style: normal; font-weight: 600; font-size: 9.5px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ff-ink-faint); margin-left: 5px;
}
.atelier-ff .ff-est[hidden] { display: none; }

.atelier-ff .ff-hint {
  margin: 2px 0 12px; font-size: 12px; line-height: 1.5; color: var(--ff-ink-faint);
}
.atelier-ff .ff-field[hidden] { display: none; }

/* -------------------------------------------------------------- fields */

.atelier-ff .ff-field { margin-bottom: 22px; }
.atelier-ff .ff-field label {
  display: flex; justify-content: space-between; align-items: baseline; margin: 0;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ff-ink);
}
.atelier-ff .ff-field .ff-val {
  color: var(--ff-accent); font-size: 14px; letter-spacing: .02em; font-weight: 700;
  text-transform: none;
}
.atelier-ff .ff-field input[type="range"] {
  display: block; width: 100%; height: 4px; margin: 16px 0 4px; padding: 0;
  border: 0; border-radius: 2px; background: var(--ff-line);
  outline: none; appearance: none; -webkit-appearance: none;
}
.atelier-ff .ff-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ff-accent); border: 3px solid var(--ff-bg);
  box-shadow: 0 0 0 1px var(--ff-line); cursor: pointer;
}
.atelier-ff .ff-field input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ff-accent); border: 3px solid var(--ff-bg);
  box-shadow: 0 0 0 1px var(--ff-line); cursor: pointer;
}

.atelier-ff .ff-choices { display: flex; gap: 9px; margin-top: 10px; }
.atelier-ff .ff-choices button {
  flex: 1; height: 48px; padding: 0; cursor: pointer;
  border: 1px solid var(--ff-line); background: var(--ff-surface); color: var(--ff-ink);
  font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
  transition: all .18s;
}
.atelier-ff .ff-choices button:hover { border-color: var(--ff-ink); }
.atelier-ff .ff-choices button.is-active {
  background: var(--ff-ink); color: #fff; border-color: var(--ff-ink);
}

/* ------------------------------------------------------------- buttons */

.atelier-ff .ff-btn {
  height: 50px; cursor: pointer; font: inherit;
  font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
}
.atelier-ff .ff-btn-primary {
  flex: 1; border: 0; background: var(--ff-ink); color: #fff;
}
.atelier-ff .ff-btn-primary:hover { background: var(--ff-accent); }
.atelier-ff .ff-btn-ghost {
  flex: none; width: 150px;
  border: 1px solid var(--ff-line); background: transparent; color: var(--ff-ink);
}
.atelier-ff .ff-btn-ghost:hover { border-color: var(--ff-ink); }
.atelier-ff .ff-cta { width: 100%; margin-top: 6px; }

/* -------------------------------------------------------------- result */

.atelier-ff .ff-reco {
  text-align: center; padding: 6px 0 22px;
  border-bottom: 1px solid var(--ff-line); margin-bottom: 22px;
}
.atelier-ff .ff-reco-size { font-size: 68px; font-weight: 500; line-height: 1; margin: 10px 0 6px; }
.atelier-ff .ff-reco-verdict {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--ff-ok);
  letter-spacing: .06em; text-transform: uppercase;
}
.atelier-ff .ff-reco-verdict svg { width: 15px; height: 15px; }
.atelier-ff .ff-reco-note {
  font-size: 12.5px; color: var(--ff-ink-soft); margin: 10px auto 0; max-width: 42ch;
}

.atelier-ff .ff-scores { display: grid; gap: 9px; margin-bottom: 26px; }
.atelier-ff .ff-score-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--ff-ink-soft);
}
.atelier-ff .ff-score-row .sz { width: 40px; font-weight: 700; color: var(--ff-ink); }
.atelier-ff .ff-score-row .track {
  flex: 1; height: 5px; background: var(--ff-line); border-radius: 3px; overflow: hidden;
}
.atelier-ff .ff-score-row .fill {
  display: block; height: 100%; background: var(--ff-ink-faint); border-radius: 3px;
}
.atelier-ff .ff-score-row.is-best .fill { background: var(--ff-ok); }
.atelier-ff .ff-score-row.is-best .vd { color: var(--ff-ok); font-weight: 700; }
.atelier-ff .ff-score-row.is-out { opacity: .55; }
.atelier-ff .ff-score-row .vd { width: 96px; text-align: right; }

.atelier-ff .ff-actions { display: flex; gap: 10px; }

@media (max-width: 480px) {
  .atelier-ff .ff-actions { flex-direction: column; }
  .atelier-ff .ff-btn-ghost { width: 100%; }
  .atelier-ff .ff-reco-size { font-size: 56px; }
}
