/* =========================================================
   RING FINDER  guided alternative to "Shop by Category"
   Homepage section right under Shop by Category: a stepper card that asks
   for shape, metal, budget and style, then links to the shop with those
   filters pre-applied. Built with the theme's own tokens (--fm-*) and the
   same dark / light palette as the Shop by Category section.

   Every rule is anchored to .rf-section or uses an rf- prefixed class.
   ========================================================= */
.rf-section {
  --rf-bg: var(--fm-black);
  --rf-ink: var(--fm-cream);
  --rf-muted: var(--fm-cream-dim);
  --rf-accent: var(--fm-gold);
  --rf-on-accent: var(--fm-black);
  --rf-card-bg: rgba(255, 255, 255, 0.03);
  --rf-line: rgba(var(--fm-rgb-gold), 0.25);
  --rf-tile-bg: rgba(255, 255, 255, 0.04);
  --rf-tile-line: rgba(var(--fm-rgb-gold), 0.3);

  position: relative;
  background: var(--rf-bg);
  padding: 8px 24px 76px;
}
.rf-section *,
.rf-section *::before,
.rf-section *::after { box-sizing: border-box; }
:where(.rf-section) button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.rf-wrap { max-width: 900px; margin: 0 auto; }
.rf-lede {
  margin: 0 0 30px;
  text-align: center;
  font-family: var(--fm-font-serif);
  font-size: clamp(15px, 1.4vw, 19px);
  color: var(--rf-muted);
}

/* ---------------- card ---------------- */
.rf-card {
  overflow: hidden;
  background: var(--rf-card-bg);
  border: 1px solid var(--rf-line);
  border-radius: var(--fm-radius-md);
  box-shadow: 0 1px 2px rgba(60, 40, 15, 0.04), 0 8px 24px rgba(60, 40, 15, 0.05);
}

/* ---------------- stepper ---------------- */
.rf-steps {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 24px 28px 0;
  list-style: none;
}
.rf-steps li { position: relative; flex: 1; text-align: center; }
.rf-steps li::before {
  content: '';
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--rf-line);
}
.rf-steps li:first-child::before { display: none; }
.rf-steps li.is-done::before,
.rf-steps li.is-now::before { background: var(--rf-accent); }
.rf-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: var(--fm-radius-circle);
  border: 2px solid var(--rf-line);
  background: var(--rf-bg);
  font-family: var(--fm-font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--rf-muted);
  transition: background var(--fm-duration-base) var(--fm-ease), border-color var(--fm-duration-base) var(--fm-ease), color var(--fm-duration-base) var(--fm-ease);
}
.rf-steps .is-now .rf-dot { border-color: var(--rf-accent); color: var(--rf-accent); }
.rf-steps .is-done .rf-dot { background: var(--rf-accent); border-color: var(--rf-accent); color: var(--rf-on-accent); }
.rf-steps button {
  display: block;
  width: 100%;
  font-family: var(--fm-font-serif);
  font-size: 14px;
  color: var(--rf-muted);
}
.rf-steps .is-now button { color: var(--rf-ink); font-weight: 600; }
.rf-steps button:hover { color: var(--rf-accent); }
.rf-steps button:focus-visible,
.rf-tile:focus-visible,
.rf-btn:focus-visible,
.rf-rev button:focus-visible { outline: 2px solid var(--rf-accent); outline-offset: 3px; border-radius: var(--fm-radius-sm); }

/* ---------------- question ---------------- */
.rf-body {
  padding: 34px clamp(18px, 5vw, 56px) 12px;
  animation: rf-in 0.35s var(--fm-ease) both;
}
@keyframes rf-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.rf-q {
  margin: 0 0 6px;
  text-align: center;
  font-family: var(--fm-font-serif);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.2;
  color: var(--rf-ink);
}
.rf-hint {
  margin: 0 0 28px;
  text-align: center;
  font-family: var(--fm-font-serif);
  font-size: 16px;
  color: var(--rf-muted);
}
.rf-hint a { color: var(--rf-accent); }

/* ---------------- tiles ---------------- */
.rf-grid {
  display: grid;
  grid-template-columns: repeat(var(--rf-cols, 3), minmax(0, 1fr));
  gap: 14px;
}
.rf-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; margin: 0 auto; }
.rf-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 150px;
  padding: 16px 10px;
  text-align: center;
  font-family: var(--fm-font-serif);
  font-size: 16px;
  line-height: 1.25;
  color: var(--rf-ink);
  background: var(--rf-tile-bg);
  border: 1px solid var(--rf-tile-line);
  border-radius: var(--fm-radius-lg);
  transition: background var(--fm-duration-base) var(--fm-ease), color var(--fm-duration-base) var(--fm-ease), border-color var(--fm-duration-base) var(--fm-ease), transform var(--fm-duration-med) var(--fm-ease), box-shadow var(--fm-duration-med) var(--fm-ease);
}
.rf-tile:hover {
  border-color: var(--rf-accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(168, 117, 42, 0.16);
}
.rf-tile[aria-pressed="true"] {
  background: var(--rf-accent);
  border-color: var(--rf-accent);
  color: var(--rf-on-accent);
}
.rf-ico { width: 56px; height: 56px; color: var(--rf-accent); transition: color var(--fm-duration-base) var(--fm-ease); }
.rf-ico--style { width: 76px; height: 76px; }
.rf-tile[aria-pressed="true"] .rf-ico { color: var(--rf-on-accent); }
.rf-sw {
  width: 60px;
  height: 60px;
  border-radius: var(--fm-radius-circle);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 8px 14px -8px rgba(0, 0, 0, 0.4);
}
.rf-tile--price { min-height: 96px; font-size: 21px; }

/* ---------------- footer buttons ---------------- */
.rf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 5vw, 56px) 28px;
}
.rf-next { margin-left: auto; }
.rf-btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--fm-radius-pill);
  font-family: var(--fm-font-serif);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--fm-duration-base) var(--fm-ease), color var(--fm-duration-base) var(--fm-ease), opacity var(--fm-duration-base) var(--fm-ease);
}
.rf-btn--ghost { color: var(--rf-muted); }
.rf-btn--ghost:hover { color: var(--rf-ink); }
.rf-btn--main { background: var(--rf-accent); color: var(--rf-on-accent); }
.rf-btn--main:hover { opacity: 0.85; }
.rf-btn[hidden] { display: none; }

/* ---------------- review ---------------- */
.rf-rev {
  max-width: 560px;
  margin: 0 auto 6px;
  border-top: 1px solid var(--rf-line);
}
.rf-rev > div {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rf-line);
}
.rf-rev dt { font-family: var(--fm-font-serif); font-size: 15px; color: var(--rf-muted); }
.rf-rev dd { margin: 0; font-family: var(--fm-font-serif); font-size: 20px; color: var(--rf-ink); }
.rf-rev dd.is-none { font-style: italic; font-size: 17px; color: var(--rf-muted); }
.rf-rev button {
  font-family: var(--fm-font-serif);
  font-size: 15px;
  color: var(--rf-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- responsive ---------------- */
@media (max-width: 700px) {
  .rf-section { padding: 0 16px 52px; }
  .rf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .rf-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-tile { min-height: 120px; font-size: 14px; }
  .rf-tile--price { font-size: 17px; }
  .rf-ico { width: 44px; height: 44px; }
  .rf-ico--style { width: 58px; height: 58px; }
  .rf-sw { width: 46px; height: 46px; }
  .rf-steps { padding: 18px 10px 0; }
  .rf-steps button { font-size: 11px; }
  .rf-rev > div { grid-template-columns: 80px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  .rf-body { animation: none; }
  .rf-tile, .rf-dot, .rf-btn, .rf-ico { transition: none; }
  .rf-tile:hover { transform: none; }
}

/* ---------------- LIGHT THEME ----------------
   Same palette as the Shop by Category section above it. */
html[data-theme="light"] .rf-section {
  --rf-bg: #F5EDE6;
  --rf-ink: #1a1714;
  --rf-muted: #5b554d;
  --rf-accent: #a8752a;
  --rf-on-accent: #ffffff;
  --rf-card-bg: rgba(255, 255, 255, 0.75);
  --rf-line: #eadfcf;
  --rf-tile-bg: linear-gradient(180deg, #fffdf9 0%, #faf5ee 100%);
  --rf-tile-line: #e6d9c6;
}
