.rc8-room-gallery-button{
  position:absolute;z-index:7;right:16px;bottom:16px;display:flex;align-items:center;justify-content:center;
  min-height:38px;padding:0 13px;border:1px solid rgba(20,20,20,.14);border-radius:12px;
  background:rgba(20,20,20,.72);color:#fff;font:inherit;font-size:12px;font-weight:650;
  box-shadow:0 6px 18px rgba(0,0,0,.14);backdrop-filter:blur(12px)
}
.rc8-room-gallery-overlay{
  position:fixed;z-index:2147483647!important;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;
  margin:0;padding:0;border:0;background:#fff;color:#171717;overflow:hidden
}
.rc8-room-gallery-overlay::backdrop{background:#fff}
.rc8-room-gallery-overlay[hidden]{display:none!important}
.rc8-room-gallery-shell{
  width:100%;height:100svh;min-height:100svh;margin:0;background:#fff;overflow:hidden
}
.rc8-room-gallery-topbar{
  position:absolute;top:0;left:0;right:0;z-index:8;height:calc(112px + env(safe-area-inset-top));
  display:grid;grid-template-columns:58px minmax(0,1fr) 58px;align-items:end;gap:10px;
  padding:max(12px,env(safe-area-inset-top)) 20px 14px;background:#fff
}
.rc8-room-gallery-heading{text-align:center;align-self:end;display:grid;gap:4px}
.rc8-room-gallery-heading strong{font-size:17px;font-weight:650;line-height:1.1;letter-spacing:-.01em}
.rc8-room-gallery-heading small{color:#6f6b66;font-size:14px;font-weight:450;line-height:1.2}
.rc8-room-gallery-close,.rc8-room-gallery-overview{
  width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:50%;
  background:transparent;color:#171717;font:inherit;-webkit-tap-highlight-color:transparent
}
.rc8-room-gallery-close{justify-self:end;font-size:34px;font-weight:300;line-height:1}
.rc8-room-gallery-overview{justify-self:start;position:relative}
.rc8-room-gallery-overview span,.rc8-room-gallery-overview span::after{
  width:17px;height:17px;border:2px solid #222;border-radius:4px;box-sizing:border-box
}
.rc8-room-gallery-overview span{position:relative;display:block}
.rc8-room-gallery-overview span::after{content:"";position:absolute;left:-6px;top:5px;background:#fff}
.rc8-room-gallery-stage{
  position:absolute;inset:calc(112px + env(safe-area-inset-top)) 0 0;
  display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain
}
.rc8-room-gallery-stage::-webkit-scrollbar{display:none}
.rc8-room-gallery-slide{
  flex:0 0 100vw;height:100%;position:relative;display:grid;place-items:center;
  scroll-snap-align:center;scroll-snap-stop:always;background:#fff
}
.rc8-room-gallery-photo-frame{
  width:100%;height:100%;display:grid;place-items:center;padding:18px 16px 28px;box-sizing:border-box
}
.rc8-room-gallery-photo-frame img{
  display:block;width:auto;height:auto;max-width:100%;max-height:68svh;object-fit:contain;
  border-radius:30px;background:#f2f1ee
}
.rc8-room-gallery-grid{
  display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
  padding:calc(132px + env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom))
}
.rc8-room-gallery-grid button{
  position:relative;border:0;padding:0;overflow:hidden;border-radius:18px;background:#f1f0ed;aspect-ratio:4/3
}
.rc8-room-gallery-grid img{width:100%;height:100%;display:block;object-fit:cover}
.rc8-room-gallery-overlay.is-overview{overflow:auto}
.rc8-room-gallery-overlay.is-overview .rc8-room-gallery-shell{height:auto;min-height:100svh;overflow:visible}
.rc8-room-gallery-overlay.is-overview .rc8-room-gallery-topbar{position:fixed}
.rc8-room-gallery-overlay.is-overview .rc8-room-gallery-stage{display:none}
.rc8-room-gallery-overlay.is-overview .rc8-room-gallery-grid{display:grid}
.rc8-room-gallery-missing{position:relative;background:linear-gradient(145deg,#f4f2ee,#ebe8e2)}
.rc8-room-gallery-missing::before{content:"📷";position:absolute;inset:0;display:grid;place-items:center;font-size:48px;color:#77736d}
.rc8-room-gallery-missing img{display:none!important}

@media(min-width:760px){
  .rc8-room-gallery-topbar{padding-left:32px;padding-right:32px}
  .rc8-room-gallery-photo-frame{padding-left:40px;padding-right:40px}
  .rc8-room-gallery-photo-frame img{max-width:min(920px,88vw);max-height:72svh}
  .rc8-room-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr));max-width:980px;margin:0 auto}
}


/* Mobile 9:16 viewer — keep title/counter above the photo and let portrait media
   use almost the full remaining viewport instead of the old 68svh cap. */
@media(max-width:759px){
  .rc8-room-gallery-topbar{
    height:calc(92px + env(safe-area-inset-top));
    padding:max(10px,env(safe-area-inset-top)) 14px 8px;
    grid-template-columns:48px minmax(0,1fr) 48px;
    gap:8px;
  }

  .rc8-room-gallery-stage{
    inset:calc(92px + env(safe-area-inset-top)) 0 0;
  }

  .rc8-room-gallery-photo-frame{
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding:4px 6px max(8px,env(safe-area-inset-bottom));
  }

  .rc8-room-gallery-photo-frame img{
    width:100%;
    height:100%;
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    border-radius:22px;
    background:#fff;
  }

  .rc8-room-gallery-grid{
    padding:calc(108px + env(safe-area-inset-top)) 8px calc(18px + env(safe-area-inset-bottom));
  }
}

/* Multi-image product hero: subtle crossfade while auto-rotating. */
.sheet-image .product-photo{transition:opacity .22s ease}
.sheet-image .product-photo.rc8-product-hero-changing{opacity:.35}
@media (prefers-reduced-motion: reduce){.sheet-image .product-photo{transition:none}}
