/* =========================================================
   Interior Designer's Showroom — Editorial Design System
   Target: steelcase.com caliber — clean, confident, premium
   Refinement pass: consistency + edge states + mobile + a11y
   ========================================================= */

/* ---- Google Fonts (preconnect in layout, one family max) ---- */
/* DM Sans for UI + DM Serif Display for editorial headlines */

:root {
  /* Palette — warm bone/off-white, near-black ink, one quiet accent */
  --ink:     #16130f;
  --ink-80:  #3a3530;
  --muted:   #7a7168;
  --muted-lt:#b0a898;
  --line:    #e8e2d9;
  --line-lt: #f1ece5;
  --bg:      #faf8f5;
  --bg-warm: #f4f0e9;
  --card:    #ffffff;
  --accent:  #9b7b50;   /* single warm-gold accent */
  --accent-dk: #7a6038;

  /* Type */
  --serif: 'DM Serif Display', 'Didot', 'Georgia', serif;
  --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Grid */
  --cols: 260px;
  --max-w: 1280px;
  --pad: 28px;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: .22s;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--sans); cursor: pointer; }
h1, h2, h3 { line-height: 1.2; }

/* a11y: visible focus rings on all interactive elements */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Main container ---- */
main { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad) 96px; }
section { margin: 64px 0; }

/* ---- Disclosure bar ---- */
.disclosure {
  background: var(--ink);
  color: #d8cfc4;
  font-size: .72rem;
  font-family: var(--sans);
  letter-spacing: .04em;
  text-align: center;
  padding: 9px 20px;
  line-height: 1.5;
}
.disclosure a { color: #c9a96e; text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   HEADER — sticky, polished, editorial
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  padding: 0 var(--pad);
  height: 68px;
  background: rgba(250, 248, 245, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand-mark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: .95rem;
  letter-spacing: .12em;
  background: var(--ink);
  color: #faf8f5;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  flex-shrink: 0;
}
.brand-word {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--ink);
  /* prevent long name from crushing nav */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: .84rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.site-nav a {
  color: var(--muted);
  transition: color var(--dur);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.site-nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* =========================================================
   HERO — large, calm, editorial
   ========================================================= */
.hero {
  text-align: center;
  padding: 100px 40px 96px;
  background: var(--bg-warm);
  border-radius: 4px;
  margin: 32px 0 0;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(155,123,80,.06), transparent);
  pointer-events: none;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  letter-spacing: -.02em;
  margin: 0 0 20px;
  color: var(--ink);
}
.tagline {
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
  font-weight: 300;
}
.cta {
  display: inline-block;
  background: var(--ink);
  color: #faf8f5;
  padding: 14px 32px;
  border-radius: 2px;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur);
  border: none;
  cursor: pointer;
}
.cta:hover { background: var(--accent); color: #faf8f5; }
.cta:disabled,
.cta[disabled] {
  background: var(--muted-lt);
  color: var(--bg);
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================================================
   SECTION HEADINGS — refined editorial style
   ========================================================= */
section > h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.5vw, 3rem);
  letter-spacing: -.02em;
  margin: 0 0 8px;
  color: var(--ink);
}
section > h2,
h2 {
  font-family: var(--sans);
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 28px;
  padding-bottom: 0;
  border-bottom: none;
  position: relative;
}
section > h2::after,
h2.ruled::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--line);
  margin-top: 12px;
}
.section-eyebrow {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

/* =========================================================
   ROOM TILES — editorial grid
   ========================================================= */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px;
}
.room-tile {
  aspect-ratio: 5/4;
  background: var(--bg-warm);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--ink-80);
  letter-spacing: .01em;
  transition: background var(--dur), color var(--dur);
  border: 1px solid var(--line);
}
.room-tile:hover {
  background: var(--ink);
  color: #faf8f5;
}
.room-tile span { pointer-events: none; }

/* =========================================================
   GRID CONTROLS — refined
   ========================================================= */
.grid-controls {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.grid-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.grid-controls select,
.grid-controls input[type=range] {
  margin-left: 0;
}
.grid-controls select {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  font-size: .8rem;
  font-family: var(--sans);
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a7168' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
/* Count badge for grid results */
.grid-count {
  margin-left: auto;
  font-size: .72rem;
  color: var(--muted-lt);
  letter-spacing: .04em;
  text-transform: none;
}

/* =========================================================
   PRODUCT GRID — image-forward, no chrome
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cols), 1fr));
  gap: 2px;
}
/* Empty grid state */
.grid-empty {
  grid-column: 1/-1;
  padding: 64px 0;
  text-align: center;
  color: var(--muted);
  font-size: .96rem;
}
.grid-empty strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--ink-80);
}

.card {
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  border: 1px solid var(--line-lt);
  position: relative;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(22, 19, 15, .09);
  z-index: 1;
}
/* Consistent 4/5 aspect, no layout shift */
.card-img {
  aspect-ratio: 4/5;
  background: var(--bg-warm);
  display: block;
  overflow: hidden;
  position: relative;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
  /* prevent broken-img icon from showing a tiny broken box */
  min-height: 100%;
}
/* Broken image fallback: hide the broken icon, show warm bg */
.card-img img[src=""],
.card-img img:not([src]) {
  visibility: hidden;
}
.card:hover .card-img img { transform: scale(1.03); }
.noimg {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted-lt);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--bg-warm);
}
.card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card-brand {
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.card-title {
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 400;
  margin: 0;
  /* clamp to 2 lines — no overflow on long titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  color: var(--ink-80);
}
.card-title a:hover { color: var(--ink); }
.card-meta {
  margin-top: auto;
  padding-top: 8px;
  /* hide entire price block when empty — no bare "$" */
  min-height: 1.4em;
}
/* null price: .card-meta stays collapsed, not blank line */
.card-meta:empty { display: none; }
.price {
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .01em;
}
.price.sale { color: #8b3a3a; }
.price.was {
  text-decoration: line-through;
  color: var(--muted-lt);
  font-weight: 400;
  font-size: .8rem;
  margin-left: 4px;
}
/* Price-freshness trust chip: its own subtle line under the price. A small
   dot reads as "live/verified"; .stale flips it amber when the feed price is
   older than two weeks so drift is visible, not hidden. */
.price-fresh {
  display: block;
  margin-top: 3px;
  font-size: .66rem;
  letter-spacing: .02em;
  color: var(--muted-lt);
}
.price-fresh::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: #6f9f6f;   /* verified-green dot */
  vertical-align: middle;
}
.price-fresh.stale { color: #9a7b3a; }
.price-fresh.stale::before { background: #d3a24a; }
.buy {
  display: inline-block;
  margin-top: 10px;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color var(--dur), border-color var(--dur);
}
.buy:hover { color: var(--ink); border-bottom-color: var(--ink); }
.subtle, .dek { color: var(--muted); }

/* =========================================================
   GUIDE CARDS — editorial
   ========================================================= */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px;
}
.guide-card {
  background: var(--card);
  border: 1px solid var(--line-lt);
  overflow: hidden;
  display: block;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(22,19,15,.08);
}
.guide-card img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  transition: transform .5s var(--ease);
}
.guide-card:hover img { transform: scale(1.03); }
.guide-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  margin: 18px 20px 6px;
  color: var(--ink);
}
.guide-card p {
  margin: 0 20px 20px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.6;
}
/* Guides empty state */
.guide-grid > p {
  padding: 48px 0;
  color: var(--muted);
  font-size: .96rem;
  grid-column: 1/-1;
}

/* =========================================================
   GUIDE ARTICLE
   ========================================================= */
.guide { max-width: 760px; margin: 0 auto; }
.guide h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -.02em;
  margin: 0 0 12px;
}
.guide-hero { border-radius: 3px; margin: 24px 0; width: 100%; }
.guide-body { font-size: 1.05rem; line-height: 1.8; color: var(--ink-80); }
.guide-body h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  margin: 40px 0 12px;
  letter-spacing: -.01em;
  text-transform: none;
}
.guide-body h2::after { display: none; }
.guide-body h3 { font-family: var(--sans); font-weight: 600; font-size: 1rem; margin: 28px 0 8px; }

.legal { max-width: 720px; margin: 0 auto; }
.legal h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: -.02em;
}
.legal p { color: var(--ink-80); line-height: 1.8; }

/* =========================================================
   FACETED CATALOG
   ========================================================= */
.catalog {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
}
.facets {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.facet-group h4 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted-lt);
}
.facet {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-radius: 2px;
  font-size: .84rem;
  text-transform: capitalize;
  color: var(--ink-80);
  transition: background var(--dur), color var(--dur);
}
.facet:hover { background: var(--bg-warm); }
.facet.active { background: var(--ink); color: #faf8f5; }
.facet .fn {
  font-size: .68rem;
  color: var(--muted-lt);
  margin-left: 10px;
  font-weight: 400;
}
.facet.active .fn { color: rgba(250,248,245,.5); }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 4px 13px;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-80);
  transition: border-color var(--dur), color var(--dur);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.clear { font-weight: 600; }

/* =========================================================
   FOOTER — quiet editorial
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px var(--pad) 40px;
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.7;
  letter-spacing: .02em;
}
.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.site-footer a { border-bottom: 1px solid var(--line); transition: border-color var(--dur), color var(--dur); padding-bottom: 1px; }
.site-footer a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.site-footer .fine {
  font-size: .7rem;
  margin-top: 16px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted-lt);
}

/* =========================================================
   LOOKS GALLERY + ROOM PAGE
   ========================================================= */
.look-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px;
}
/* Empty looks state */
.look-grid > p {
  padding: 64px 0;
  color: var(--muted);
  grid-column: 1/-1;
}
.look-card {
  background: var(--card);
  border: 1px solid var(--line-lt);
  overflow: hidden;
  display: block;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.look-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(22,19,15,.08);
}
.look-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  aspect-ratio: 1/1;
  background: var(--line);
  overflow: hidden;
}
.look-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* no layout shift: grid already constrains size */
}
/* Look card with only 1 thumb */
.look-thumbs img:only-child { grid-column: 1/-1; }
/* Look card with no thumbs */
.look-thumbs .noimg {
  grid-column: 1/-1;
  aspect-ratio: 1/1;
  height: 100%;
  min-height: 140px;
}
.look-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  margin: 14px 16px 4px;
  /* clamp long room titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.look-card p { margin: 0 16px 16px; font-size: .82rem; color: var(--muted); }

/* =========================================================
   ROOM PAGE — editorial "shop this room"
   ========================================================= */
.room-page {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 24px;
}
.room-head {
  margin-bottom: 4px;
}
.room-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.5vw, 3rem);
  letter-spacing: -.02em;
  margin: 0 0 6px;
  color: var(--ink);
}
.room-scene {
  width: 100%;
  border-radius: 3px;
  margin: 20px 0;
  /* hero-caliber display for the AI render */
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
/* Scene + thumbnail rail: rail stacks to the RIGHT of the image on desktop,
   BELOW it on mobile. Each thumb is image-only; the item name shows on hover. */
.room-scene-row { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0; }
.room-scene-row .room-scene-wrap { flex: 1 1 auto; min-width: 0; margin: 0; }
.room-thumbs {
  display: flex; flex-direction: column; gap: 8px;
  flex: 0 0 60px; width: 60px; max-height: 78vh; overflow-y: auto; padding: 1px;
}
.room-thumb { position: relative; display: block; line-height: 0; flex: 0 0 auto; }
.room-thumb img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--line); transition: border-color .15s, transform .15s;
}
.room-thumb:hover img, .room-thumb:focus-visible img { border-color: var(--accent); transform: scale(1.06); }
.room-thumb-label {
  position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  background: rgba(34,30,25,.93); color: #f3ede3; font-size: .68rem; letter-spacing: .01em;
  padding: 4px 9px; border-radius: 4px; pointer-events: none; z-index: 10;
  opacity: 0; visibility: hidden; transition: opacity .14s;
}
.room-thumb:hover .room-thumb-label, .room-thumb:focus-visible .room-thumb-label { opacity: 1; visibility: visible; }
/* mobile: rail drops BELOW the image as a horizontal wrap; label appears above the thumb */
@media (max-width: 700px) {
  .room-scene-row { flex-direction: column; }
  .room-thumbs { flex-direction: row; flex-wrap: wrap; width: auto; flex: none; max-height: none; }
  .room-thumb-label { right: auto; left: 50%; top: auto; bottom: calc(100% + 8px); transform: translateX(-50%); }
}

/* Shoppable scene: show the render at its NATURAL ratio (no 16/9 crop) so the
   vision-located hotspot %-coordinates line up 1:1 with the visible pixels. */
.room-scene-wrap { position: relative; display: block; margin: 20px 0; line-height: 0; }
.room-scene-wrap .room-scene { margin: 0; aspect-ratio: auto; object-fit: contain; height: auto; }
.hotspot-layer { position: absolute; inset: 0; }
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 2;
}
.hotspot-dot {
  display: block; width: 14px; height: 14px; margin: 7px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(155,123,80,.35), 0 1px 5px rgba(0,0,0,.45);
  animation: hotspotPulse 2.4s ease-out infinite;
}
.hotspot:hover .hotspot-dot, .hotspot[aria-expanded="true"] .hotspot-dot { transform: scale(1.25); background: var(--accent); }
@keyframes hotspotPulse {
  0% { box-shadow: 0 0 0 0 rgba(155,123,80,.5), 0 1px 5px rgba(0,0,0,.45); }
  70% { box-shadow: 0 0 0 11px rgba(155,123,80,0), 0 1px 5px rgba(0,0,0,.45); }
  100% { box-shadow: 0 0 0 0 rgba(155,123,80,0), 0 1px 5px rgba(0,0,0,.45); }
}
.hotspot-card {
  position: absolute; z-index: 5; width: 210px; line-height: 1.4;
  transform: translate(-50%, -100%) translateY(-16px);
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 10px 34px rgba(0,0,0,.24); overflow: hidden;
}
.hotspot-card[hidden] { display: none; }
.hotspot-card.below { transform: translate(-50%, 0) translateY(16px); }
.hotspot-card.edge-left { transform: translate(-12%, -100%) translateY(-16px); }
.hotspot-card.edge-left.below { transform: translate(-12%, 0) translateY(16px); }
.hotspot-card.edge-right { transform: translate(-88%, -100%) translateY(-16px); }
.hotspot-card.edge-right.below { transform: translate(-88%, 0) translateY(16px); }
.hotspot-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.hotspot-card-body { padding: 10px 12px; }
.hotspot-card-title { font-size: .8rem; font-weight: 500; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hotspot-card-price { font-size: .82rem; color: var(--accent-dk); margin: 3px 0 7px; }
.scene-hint {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; pointer-events: none;
  background: rgba(34,30,25,.72); color: #f3ede3; font-size: .66rem; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 20px;
}
/* hotspots on the live Room Builder gallery tiles (smaller than the room page) */
.rb-gen-scene { position: relative; line-height: 0; }
.rb-hot { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 3; }
.rb-hot .hotspot-dot { width: 11px; height: 11px; margin: 5.5px; }
.room-paint {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px 18px;
  margin: 20px 0;
  max-width: 440px;
}
.room-paint img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.room-paint-info { display: flex; flex-direction: column; gap: 4px; }
.room-paint-label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.room-paint-name { font-size: .9rem; font-weight: 500; color: var(--ink-80); }
/* Shop this room heading — use editorial serif */
.room-page > h2.shop-heading {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 32px 0 20px;
}
.room-page > h2.shop-heading::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--line);
  margin-top: 12px;
}
/* 0 pieces state */
.room-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}
.room-cta { text-align: center; margin: 48px 0 24px; }
.room-cta .cta { display: inline-block; }

/* =========================================================
   ROOM BUILDER — tray / left tabs / mid gallery / right panel
   Preserve all existing layout logic; only elevate aesthetics
   ========================================================= */
.cta.sm {
  padding: 10px 20px;
  font-size: .72rem;
  letter-spacing: .1em;
}
.builder-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.builder-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 16px;
}
.builder-controls {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 20px;
}
.builder-controls label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.builder-controls select,
.builder-controls input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: .88rem;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
}
.builder-controls h4 {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted-lt);
}
.paint-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  padding: 10px 12px 12px;
}
.paint {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  transition: border-color var(--dur), transform var(--dur);
}
.paint:hover { transform: scale(1.08); }
.paint img { width: 100%; height: 100%; object-fit: cover; }
.paint.sel { border-color: var(--ink); }
.builder-save {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.builder-save input { padding: 9px; }
.mini { font-size: .75rem; color: var(--accent); margin: 0; min-height: 1em; }
.board {
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px;
  margin-bottom: 24px;
}
.board h3, .builder-main > h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  margin: 0 0 12px;
}
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.empty { color: var(--muted); font-size: .88rem; grid-column: 1/-1; }
.bitem {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bitem > img, .bitem .noimg {
  aspect-ratio: 1/1;
  object-fit: cover;
  width: 100%;
  background: var(--bg-warm);
}
.bitem-b { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.bitem-t { font-size: .8rem; line-height: 1.25; font-weight: 500; }
.bitem-m { font-size: .72rem; color: var(--muted); margin-top: auto; }
.bitem-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 2px;
  padding: 4px;
  font-size: .72rem;
  cursor: pointer;
  font-family: var(--sans);
}
.bitem-btn:hover { border-color: var(--accent); color: var(--accent); }

/* =========================================================
   ROOM BUILDER v2 — tray + left tabs + mid render + right products
   Preserve all layout / js hooks; polish aesthetics
   ========================================================= */
.rb { max-width: 1380px; margin: 0 auto; }
.rb-tray {
  position: sticky;
  top: 68px; /* below sticky header */
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #f0ebe3;
  padding: 11px 16px;
  border-radius: 3px;
  flex-wrap: wrap;
}
.rb-tray select, .rb-tray input[type="text"] {
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 2px;
  background: rgba(255,255,255,.08);
  color: #f0ebe3;
  font-size: .84rem;
  font-family: var(--sans);
  transition: border-color var(--dur);
}
.rb-tray select:hover,
.rb-tray input[type="text"]:hover { border-color: rgba(255,255,255,.32); }
.rb-tray select:focus,
.rb-tray input[type="text"]:focus {
  outline: none;
  border-color: #c9a96e;
  box-shadow: 0 0 0 2px rgba(201,169,110,.25);
}
/* Style the select option dropdown text for readability */
.rb-tray select option { background: var(--ink-80); color: #f0ebe3; }
.rb-tray.drop { outline: 2px dashed #c9a96e; }
.rb-chips {
  flex: 1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 30px;
  align-items: center;
}
.rb-hint { color: rgba(240,235,227,.5); font-size: .78rem; font-style: italic; }
.rb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.1);
  color: #f0ebe3;
  border-radius: 2px;
  padding: 3px 10px;
  font-size: .76rem;
  cursor: pointer;
  text-transform: capitalize;
  letter-spacing: .03em;
  transition: background var(--dur);
}
.rb-chip:hover { background: rgba(255,255,255,.18); }
.rb-chip.prod {
  background: rgba(255,255,255,.14);
  padding: 3px 10px 3px 3px;
  gap: 8px;
  font-size: .74rem;
}
.rb-chip.prod img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 3px;
}
/* GO button in tray */
.rb-tray .cta {
  background: #c9a96e;
  color: var(--ink);
  font-weight: 600;
  padding: 9px 24px;
  letter-spacing: .08em;
  border-radius: 2px;
  white-space: nowrap;
}
.rb-tray .cta:hover { background: #d4b87e; }
.rb-tray .cta:disabled { background: rgba(201,169,110,.5); cursor: not-allowed; pointer-events: none; }

/* Title input in tray */
.rb-tray input#rbTitle {
  min-width: 160px;
  max-width: 240px;
}
/* Room select */
.rb-tray select#rbRoom { min-width: 120px; }

.rb-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  margin-top: 16px;
  align-items: start;
  transition: grid-template-columns .28s;
}
.rb-left { display: flex; flex-direction: column; gap: 4px; }
.rb-tab {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  overflow: hidden;
}
.rb-tab > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: .82rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: .02em;
  user-select: none;
  transition: background var(--dur);
}
.rb-tab > summary:hover { background: var(--bg-warm); }
.rb-tab > summary::-webkit-details-marker { display: none; }
.rb-tab > summary::after { content: '+'; color: var(--muted-lt); font-size: 1rem; font-weight: 300; }
.rb-tab[open] > summary::after { content: '–'; }
.rb-tab[open] > summary { border-bottom: 1px solid var(--line); }
.rb-opts { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 12px 12px; }
.rb-opt {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 2px;
  padding: 4px 12px;
  font-size: .76rem;
  cursor: pointer;
  text-transform: capitalize;
  font-family: var(--sans);
  letter-spacing: .03em;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.rb-opt:hover { border-color: var(--accent); }
.rb-opt.sel { background: var(--ink); color: #faf8f5; border-color: var(--ink); }
.rb-opt.trend { background: var(--bg-warm); font-weight: 500; }
.rb-opt.trend:hover { border-color: var(--accent); background: #ede8e0; }

.rb-mid { min-height: 320px; }
/* Render bar: Generate button + cost */
.rb-render-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.rb-cost { font-size: .72rem; color: var(--muted); letter-spacing: .03em; font-style: italic; }
.rb-render {
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 3px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rb-render.drop, .rb-mid.drop { outline: 2px dashed var(--accent); }
.rb-render-ph {
  color: var(--muted);
  text-align: center;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---- rb-renders: responsive gallery grid for AI room cards ---- */
.rb-renders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  min-height: 260px;
}
/* Shared placeholder — shown before any generation AND in .rb-renders */
.rb-renders > .rb-render-ph,
.rb-render-ph {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 28px;
  line-height: 1.7;
}

/* ---- rb-gen: individual AI room card ---- */
.rb-gen {
  aspect-ratio: 4/3;
  border-radius: 3px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg-warm);
  position: relative;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
}
.rb-gen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rb-gen:hover { box-shadow: 0 8px 28px rgba(22,19,15,.14); }
.rb-gen.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
/* Loading state: pulsing warm bg + spinner text */
.rb-gen.loading {
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-bg 2s ease-in-out infinite;
}
@keyframes pulse-bg {
  0%, 100% { background: var(--bg-warm); }
  50% { background: #ebe5da; }
}

.rb-gen-spin {
  text-align: center;
  color: var(--muted);
  font-family: var(--serif);
  font-weight: 400;
  font-size: .92rem;
  line-height: 1.7;
}
.rb-gen-spin small { font-size: .76rem; display: block; margin-top: 4px; }

/* Spinner ring for "Painting…" */
.rb-gen-spin::before {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin .8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.rb-scene-img { width: 100%; border-radius: 3px; display: block; }
.rb-scene { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; width: 100%; }
.rb-scene.painted { padding: 16px; border-radius: 3px; }
.rb-scene-item {
  background: var(--card);
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 1/1;
  box-shadow: 0 2px 10px rgba(22,19,15,.08);
  cursor: default;
}
.rb-scene-item img { width: 100%; height: 100%; object-fit: cover; }
.rb-ideas-h { margin: 20px 0 10px; font-family: var(--serif); font-weight: 400; font-size: 1.05rem; }
.rb-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }

/* ---- rb-right: slide-in product panel ---- */
.rb-right {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 340px;
  z-index: 200;    /* above sticky header z-100 */
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 40px rgba(22, 19, 15, .12);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform .28s var(--ease);
  overflow: hidden;
}
.rb-right.collapsed { transform: translateX(110%); }
.rb-right-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
/* Close button — ✕ icon, needs aria-label in HTML */
.rb-ham-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  color: var(--muted);
  padding: 5px 7px;
  border-radius: 2px;
  transition: background var(--dur), color var(--dur);
  /* ensure tappable on mobile */
  min-width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
}
.rb-ham-close:hover { color: var(--ink); background: var(--bg-warm); }
/* Search input inside panel */
.rb-right > input[type="search"] {
  width: calc(100% - 32px);
  margin: 13px 16px 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: .86rem;
  font-family: var(--sans);
  flex-shrink: 0;
  color: var(--ink);
  background: var(--bg);
  transition: border-color var(--dur);
}
.rb-right > input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(155,123,80,.15);
}
.rb-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}
/* Loading state inside products panel */
.rb-products > .empty {
  padding: 32px 0;
  text-align: center;
  font-style: italic;
  color: var(--muted);
}
.rbp {
  background: var(--card);
  border: 1px solid var(--line-lt);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow var(--dur), transform var(--dur);
  position: relative;
}
.rbp:hover { box-shadow: 0 6px 20px rgba(22,19,15,.12); transform: translateY(-2px); }
/* right panel showing the products IN a generated room (shoppable) */
.rbp-roomhead {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 2px 2px 8px; margin-bottom: 2px; border-bottom: 1px solid var(--line-lt);
}
.rbp-browse { border: 0; background: none; color: var(--accent); font-size: .7rem; cursor: pointer; font-family: var(--sans); letter-spacing: .03em; }
.rbp-browse:hover { text-decoration: underline; }
.rbp.shop { text-decoration: none; color: inherit; }
.rbp:active { cursor: grabbing; }
.rbp > img, .rbp .noimg {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
  background: var(--bg-warm);
  display: block;
}
.rbp-t {
  font-size: .74rem;
  font-weight: 500;
  line-height: 1.25;
  padding: 7px 8px 3px;
  color: var(--ink-80);
  /* clamp to 2 lines in the narrow panel */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rbp-m { font-size: .68rem; color: var(--muted); padding: 0 8px; }
.rbp-add {
  margin: 6px 8px 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 2px;
  padding: 5px;
  font-size: .7rem;
  cursor: pointer;
  font-family: var(--sans);
  letter-spacing: .04em;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}
.rbp-add:hover { border-color: var(--accent); color: var(--accent); }
/* "Added" state — confirmed green-tinted */
.rbp-add[data-added="true"],
.rbp-add:contains("✓ Added") {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(155,123,80,.07);
}

/* ---- rb-ham hamburger pill ---- */
.rb-ham {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 101;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #f0ebe3;
  border: none;
  border-radius: 2px;
  padding: 10px 20px;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(22,19,15,.22);
  transition: opacity .2s, background .2s;
  font-family: var(--sans);
  white-space: nowrap;
}
.rb-ham:hover { background: var(--accent); }
.rb-right:not(.collapsed) ~ .rb-ham,
body:has(.rb-right:not(.collapsed)) .rb-ham { opacity: 0; pointer-events: none; }

/* ---- product popup ---- */
.rb-pop {
  position: fixed;
  z-index: 300; /* above rb-right */
  width: 252px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 14px 40px rgba(22,19,15,.18);
  overflow: hidden;
  pointer-events: none;
  font-size: .8rem;
}
.rb-pop img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--bg-warm); }
.rb-pop-b { padding: 10px 13px; }
.rb-pop-b b { font-size: .84rem; line-height: 1.3; display: block; font-weight: 500; color: var(--ink); }
.rb-pop-p { color: var(--ink); font-weight: 500; margin-top: 5px; }
.rb-pop-t { color: var(--muted); font-size: .7rem; text-transform: capitalize; margin-top: 3px; letter-spacing: .04em; }

/* ---- color swatches ---- */
.rb-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform var(--dur), box-shadow var(--dur);
}
.rb-swatch:hover { transform: scale(1.15); }
.rb-swatch.sel { box-shadow: 0 0 0 2px var(--ink); }
.rb-swatch.sel::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: .78rem;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.sw-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35);
  flex-shrink: 0;
}

/* Room pieces grid (below the generated render) */
.rb-pieces-h {
  margin: 26px 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
}
.rb-pieces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.rb-piece {
  background: var(--card);
  border: 1px solid var(--line-lt);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  color: inherit;
}
.rb-piece:hover { box-shadow: 0 6px 20px rgba(22,19,15,.1); transform: translateY(-2px); }
.rb-piece img {
  aspect-ratio: 1/1;
  object-fit: cover;
  width: 100%;
  background: var(--bg-warm);
}
.rb-piece-b { padding: 8px 9px 10px; }
.rb-piece-t {
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rb-piece-m { font-size: .72rem; color: var(--muted); margin-top: 3px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Desktop: persistent 3-column Room Builder —
   LEFT = select words (filters) · MIDDLE = images & room settings (centered) · RIGHT = select products */
@media (min-width: 981px) {
  .rb-body { grid-template-columns: 210px minmax(0, 1fr) 300px; }
  /* products become a real in-grid column instead of an off-canvas drawer */
  .rb-right {
    position: sticky; top: 96px; height: auto; max-height: calc(100vh - 116px);
    width: auto; z-index: 1; box-shadow: none; transform: none;
    border: 1px solid var(--line); border-radius: 6px;
  }
  .rb-right.collapsed { transform: none; }        /* always visible on desktop */
  .rb-ham, .rb-ham-close { display: none; }        /* no hamburger needed */
  /* center the middle column's generated images + room settings */
  .rb-mid { text-align: center; }
  .rb-render-bar { justify-content: center; }
  .rb-renders { grid-template-columns: repeat(auto-fill, 320px); justify-content: center; }
  .rb-pieces { grid-template-columns: repeat(auto-fill, 160px); justify-content: center; }
}

/* 980px: builder collapses to single column */
@media (max-width: 980px) {
  .rb-body { grid-template-columns: 1fr; }
  .rb-left { position: static; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .rb-tab { min-width: 140px; flex: 1 1 140px; }
  /* Products panel goes full-width overlay on mobile */
  .rb-right {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .rb-products { grid-template-columns: 1fr 1fr; }
  .rb-ham { top: 14px; right: 14px; padding: 9px 16px; font-size: .74rem; }
}

/* 840px: catalog facets become horizontal scroll */
@media (max-width: 840px) {
  .catalog { grid-template-columns: 1fr; }
  .facets { position: static; flex-flow: row wrap; }
  .facet-group { min-width: 140px; }
}

/* 820px: header & main layout  */
@media (max-width: 820px) {
  :root { --pad: 18px; }
  .site-header { padding: 0 var(--pad); }
  /* On small screens, brand word can shrink but not hide */
  .brand-word { font-size: .92rem; }
  /* Tray wraps — each row stays legible */
  .rb-tray { gap: 8px; }
  .rb-tray select#rbRoom { min-width: 100px; }
  .rb-tray input#rbTitle { min-width: 110px; max-width: 180px; }
}

/* 760px: builder side-by-side collapses */
@media (max-width: 760px) {
  .builder-grid { grid-template-columns: 1fr; }
  .builder-controls { position: static; top: auto; }
  :root { --pad: 16px; }
}

/* 640px: mobile header, hero */
@media (max-width: 640px) {
  .site-nav { gap: 16px; font-size: .75rem; }
  .brand-word { display: none; }
  .hero { padding: 64px 20px 56px; }
  .hero h1 { font-size: 2.2rem; }
  .tagline { font-size: .96rem; }
  .cta { padding: 12px 24px; }
  /* Room page single-column */
  .room-page { padding-top: 16px; }
  .room-paint { flex-direction: column; align-items: flex-start; max-width: 100%; }
  .room-paint img { width: 100%; height: 160px; }
  /* Looks grid single column */
  .look-grid { grid-template-columns: 1fr; }
  /* Pieces grid in room builder */
  .rb-pieces { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  /* Products panel 1 col */
  .rb-products { grid-template-columns: 1fr; }
  /* Tray stacks */
  .rb-tray { flex-direction: column; align-items: stretch; }
  .rb-tray select,
  .rb-tray input { width: 100%; }
  .rb-tray .cta { width: 100%; text-align: center; }
}

/* 480px: very small phones */
@media (max-width: 480px) {
  section { margin: 40px 0; }
  .room-grid { grid-template-columns: 1fr 1fr; }
  .rb-renders { grid-template-columns: 1fr; }
  /* Keep guide grid readable */
  .guide-grid { grid-template-columns: 1fr; }
}
