/* =========================================================
   3D STONE GALLERY ROOM — stone-showroom.css
   Apple-style cinematic luxury showroom section.
   Scoped entirely under .stone-showroom-3d to avoid collisions.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..600&family=Manrope:wght@400;500;600;700&display=swap');

.stone-showroom-3d {
  --sw-void: #221c15;
  --sw-floor: #16130f;
  --sw-floor-2: #0e0c0a;
  --sw-wall: #201c17;
  --sw-wall-2: #100e0b;
  --sw-ivory: #ede8dd;
  --sw-mute: #948c7d;
  --sw-line: rgba(237, 232, 221, 0.1);
  --sw-brass: #b8905a;
  --sw-brass-light: #e9c48a;
  --sw-glow: rgba(255, 205, 140, 0.4);
  --sw-shadow: rgba(0, 0, 0, 0.65);
  --sw-display: 'Fraunces', Georgia, serif;
  --sw-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  position: relative;
  background: radial-gradient(ellipse at 50% -10%, #362c20 0%, var(--sw-void) 68%);
  color: var(--sw-ivory);
  font-family: var(--sw-body);
  padding: 2.4rem 6vw 1.2rem;
  overflow: hidden;
  isolation: isolate;
}

.stone-showroom-3d * { box-sizing: border-box; }

/* ---------- Intro ---------- */
.showroom-intro {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 1.1rem;
  opacity: 0;
  transform: translateY(14px);
}

.showroom-eyebrow {
  display: inline-block;
  font-family: var(--sw-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sw-brass-light);
  margin-bottom: 0.6rem;
}

.showroom-title {
  font-family: var(--sw-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.08;
  margin: 0 0 0.5rem;
  color: var(--sw-ivory);
}

.showroom-sub {
  font-size: 0.92rem;
  color: var(--sw-mute);
  margin: 0;
  font-weight: 500;
}

/* ---------- Stage layout ---------- */
.showroom-stage {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: stretch;
}

/* ---------- Category rail ---------- */
.category-rail {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.55rem;
  border-right: 1px solid var(--sw-line);
  padding-right: 1.5rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--sw-mute);
  text-align: left;
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-family: var(--sw-body);
  position: relative;
  opacity: 0;
  transform: translateX(-18px);
  transition: background 0.35s ease;
}

.category-index {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--sw-brass);
  transition: color 0.35s ease;
}

.category-name {
  font-family: var(--sw-display);
  font-size: 1.3rem;
  font-weight: 400;
  transition: color 0.35s ease, letter-spacing 0.35s ease;
}

.category-underline {
  position: absolute;
  left: 1rem;
  bottom: 0.55rem;
  height: 1px;
  width: 0%;
  background: var(--sw-brass-light);
  transition: width 0.45s cubic-bezier(.16,.84,.44,1);
}

.category-item:hover {
  background: rgba(233, 196, 138, 0.06);
}

.category-item.is-active {
  background: rgba(233, 196, 138, 0.12);
}

.category-item:hover .category-name,
.category-item.is-active .category-name {
  color: var(--sw-ivory);
  letter-spacing: 0.01em;
}

.category-item.is-active .category-name {
  font-weight: 600;
}

.category-item:hover .category-index,
.category-item.is-active .category-index {
  color: var(--sw-brass-light);
}

.category-item.is-active .category-underline,
.category-item:hover .category-underline {
  width: calc(100% - 2rem);
}

/* ---------- 3D Room ---------- */
.room-3d {
  position: relative;
  height: 300px;
  perspective: 1600px;
  perspective-origin: 50% 40%;
}

.room-perspective {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(3deg) rotateY(-6deg) scale(0.94);
  opacity: 0;
  will-change: transform;
}

/* Background box + color removed per request — products now sit
   directly on the section's own background, no card/panel behind them. */
.room-wall-back,
.wall-vignette {
  display: none;
}

/* Background photo removed for a cleaner look — layers are kept in the
   DOM (still switched by JS per category) but not shown visually. */
.wall-texture-layer {
  display: none;
}

.wall-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 210, 150, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* Room shell removed per request — floor, ceiling, side wall, and the
   ceiling light/spotlight sweep are no longer shown. Only the flat
   backdrop panel (.room-wall-back) remains as a simple background. */
.room-floor,
.room-ceiling,
.room-wall-side,
.ceiling-light {
  display: none;
}

.light-fixture {
  width: 70px;
  height: 6px;
  margin: 0 auto;
  background: var(--sw-brass-light);
  border-radius: 3px;
  box-shadow: 0 0 24px 6px var(--sw-glow);
}

.light-cone {
  width: 100%;
  height: 100%;
  background: conic-gradient(from 180deg at 50% 0%, transparent 40%, rgba(255, 214, 150, 0.14) 50%, transparent 60%);
  filter: blur(2px);
}

.light-sweep {
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 224, 170, 0.18), transparent);
  filter: blur(6px);
}

/* ---------- Product stage ---------- */
.product-stage {
  position: absolute;
  inset: 0;
}

.product-room {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.85rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateZ(0);
  transition: opacity 0.6s ease;
}

.product-room.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.product-panels {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.6rem;
  width: 100%;
  margin: 0 auto;
  transform-style: preserve-3d;
}

.product-panel {
  position: relative;
  background: var(--sw-wall);
  border: 1px solid var(--sw-line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 18px 34px var(--sw-shadow);
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

.panel-hero,
.panel-sample {
  width: 200px;
  height: 270px;
}

.panel-image {
  width: 100%;
  height: 68%;
  background-size: cover;
  background-position: center;
}

.panel-info {
  padding: 0.7rem 0.85rem 0.9rem;
}

.panel-name {
  font-family: var(--sw-display);
  font-size: 0.98rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
  color: var(--sw-ivory);
}

.panel-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.panel-meta li {
  font-size: 0.72rem;
  color: var(--sw-mute);
}

.panel-meta li span {
  color: var(--sw-brass-light);
  margin-right: 0.35rem;
  font-weight: 600;
}

.panel-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--sw-brass);
  color: #1a1510;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
}

.product-empty {
  color: var(--sw-mute);
  font-size: 0.9rem;
  padding-bottom: 3rem;
}

/* ---------- Caption ---------- */
.showroom-caption {
  grid-column: 2;
  text-align: center;
  margin-top: 0.6rem;
}

.showroom-caption h3 {
  font-family: var(--sw-display);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 0.3rem;
}

.showroom-caption p {
  color: var(--sw-mute);
  font-size: 0.9rem;
  max-width: 520px;
  margin: 0 auto;
}

.showroom-empty {
  text-align: center;
  color: var(--sw-mute);
}

/* ============================================================
   MOBILE — horizontal slider fallback
   ============================================================ */
.showroom-mobile { display: none; }

@media (max-width: 880px) {
  .stone-showroom-3d { padding: 4.5rem 5vw 4rem; }
  .showroom-stage { display: none; }
  .showroom-mobile { display: block; }

  .mobile-chip-row {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.9rem;
    margin-bottom: 1.2rem;
    scrollbar-width: none;
  }
  .mobile-chip-row::-webkit-scrollbar { display: none; }

  .mobile-chip {
    flex: none;
    background: rgba(237,232,221,0.06);
    border: 1px solid var(--sw-line);
    color: var(--sw-mute);
    font-family: var(--sw-body);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
  }

  .mobile-chip.is-active {
    background: var(--sw-brass);
    color: #1a1510;
    border-color: var(--sw-brass);
  }

  .mobile-panel { display: none; }
  .mobile-panel.is-active { display: block; animation: swFadeUp 0.5s ease; }

  @keyframes swFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .mobile-hero {
    position: relative;
    height: 220px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    margin-bottom: 0.9rem;
  }

  .mobile-hero-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,12,0.1) 40%, rgba(10,10,12,0.85) 100%);
  }

  .mobile-hero-name {
    position: absolute;
    left: 1rem;
    bottom: 0.8rem;
    font-family: var(--sw-display);
    font-size: 1.3rem;
    color: var(--sw-ivory);
  }

  .mobile-desc {
    color: var(--sw-mute);
    font-size: 0.88rem;
    margin: 0 0 1.2rem;
  }

  .mobile-product-track {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
  }

  .mobile-product-card {
    flex: none;
    scroll-snap-align: start;
    width: 62vw;
    max-width: 240px;
    background: var(--sw-wall);
    border: 1px solid var(--sw-line);
    border-radius: 8px;
    overflow: hidden;
  }

  .mobile-product-image {
    height: 140px;
    background-size: cover;
    background-position: center;
  }

  .mobile-product-card h4 {
    font-family: var(--sw-display);
    font-weight: 500;
    font-size: 0.95rem;
    margin: 0.7rem 0.8rem 0.4rem;
    color: var(--sw-ivory);
  }

  .mobile-product-card .panel-meta { padding: 0 0.8rem 0.8rem; }
}

/* ------------------------------------------------------------
   Safety net: if JS never runs at all (blocked script, 404,
   console error before init), these elements would stay at
   opacity:0 forever. This delayed animation guarantees they
   become visible on their own after a short delay; GSAP's JS
   animation (which starts near-instantly on scroll-into-view)
   simply overrides it first in the normal case.
   ------------------------------------------------------------ */
@keyframes swForceReveal {
  to { opacity: 1; transform: none; }
}
.showroom-intro,
.room-perspective,
.category-item {
  animation: swForceReveal 0.01ms 2.5s forwards;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .stone-showroom-3d *,
  .stone-showroom-3d *::before,
  .stone-showroom-3d *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}