/* Approved Variant A: dark fullscreen dialog, independent of site gallery CSS. */
.as-product-lightbox {
  position: fixed; inset: 0; margin: 0; border: 0; padding: 0;
  width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100vh; max-height: 100dvh;
  background: #181716; color: #fff; box-sizing: border-box;
  font-family: Inter, Arial, sans-serif; line-height: 1.6;
}
.as-product-lightbox::backdrop { background: #181716e8; }
.as-product-lightbox[open] { display: flex; flex-direction: column; }
.as-product-lightbox *, .as-product-lightbox *::before, .as-product-lightbox *::after { box-sizing: border-box; }
.as-lightbox-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 26px; border-bottom: 1px solid #ffffff26; gap: 20px; min-height: 78px; flex-shrink: 0;
}
.as-product-lightbox .as-lightbox-title { font: 600 17px/1.4 Inter, Arial, sans-serif; margin: 0; color: inherit; }
.as-product-lightbox .as-lightbox-button {
  width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center;
  font: 400 28px/1 Inter, Arial, sans-serif; padding: 0;
  background: transparent; color: inherit; border: 1px solid #ffffff70; border-radius: 50%;
  cursor: pointer; touch-action: manipulation;
}
.as-product-lightbox .as-lightbox-button:hover { background: #ffffff14; }
.as-product-lightbox .as-lightbox-button:disabled { opacity: .45; cursor: default; }
.as-product-lightbox :focus-visible { outline: 3px solid #c9a063; outline-offset: 4px; }
.as-lightbox-stage {
  flex: 1; min-height: 0; position: relative; display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; padding: 20px 24px; gap: 16px;
}
.as-lightbox-image-wrap {
  min-height: 0; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; position: relative;
}
.as-product-lightbox .as-lightbox-image {
  display: block; width: 100%; height: 100%; object-fit: contain; min-height: 0;
  max-width: 100%; max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px);
}
.as-lightbox-status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; text-align: center; padding: 24px; gap: 16px;
}
.as-product-lightbox .as-lightbox-status p { color: inherit; margin: 0; }
.as-product-lightbox .as-lightbox-retry {
  width: auto; height: auto; min-height: 48px; padding: 10px 18px; border-radius: 8px; font: 600 14px/1.6 Inter, Arial, sans-serif;
}
.as-lightbox-bottom {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 20px 20px; min-height: 75px; flex-shrink: 0;
}
.as-product-lightbox .as-lightbox-counter { color: inherit; margin: 0; font-size: 14px; }
.as-lightbox-bottom small { color: inherit; opacity: .8; }
.as-product-lightbox [hidden] { display: none !important; }

/* Bedding galleries are opt-in and retain ordinary image links without JavaScript. */
.as-bedding-gallery { min-width: 0; width: 100%; }
.as-gallery-main {
  display: block; width: 100%; position: relative; padding: 0; border: 0;
  background: #ebe6dd; color: #1a1a1a;
}
.as-gallery-main img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
.as-gallery-enlarge {
  position: absolute; right: 12px; bottom: 12px; background: #faf7f2; border: 1px solid #e8e2d5;
  border-radius: 4px; padding: 8px 12px; font: 400 13px/1.6 Inter, Arial, sans-serif;
  min-height: 44px; display: flex; align-items: center; gap: 7px;
}
.as-gallery-thumbs { display: flex; gap: 8px; padding: 12px; overflow-x: auto; }
.as-gallery-thumbs a {
  display: block; border: 1px solid #e8e2d5; background: #fff; padding: 0; flex: 0 0 62px; height: 64px;
}
.as-gallery-thumbs a:hover { border-color: #8b6f47; }
.as-gallery-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.as-bedding-gallery a:focus-visible { outline: 3px solid #6e5538; outline-offset: 3px; }

@media (max-width: 700px) {
  .as-lightbox-top { padding: 12px 16px; min-height: 76px; gap: 16px; }
  .as-product-lightbox .as-lightbox-title { font-size: 14px; }
  .as-product-lightbox .as-lightbox-button { width: 44px; height: 44px; }
  .as-lightbox-stage { display: flex; position: static; padding: 12px 8px; width: 100%; }
  .as-lightbox-stage > .as-lightbox-button { position: absolute; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 1; }
  .as-lightbox-stage > .as-lightbox-prev { left: calc(50% - 130px); }
  .as-lightbox-stage > .as-lightbox-next { right: calc(50% - 130px); }
  .as-product-lightbox .as-lightbox-image { max-height: calc(100vh - 164px); max-height: calc(100dvh - 164px); }
  .as-lightbox-bottom { min-height: 64px; padding: 12px 54px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .as-product-lightbox .as-lightbox-counter { font-size: 13px; }
  .as-lightbox-hint { display: none; }
  .as-product-lightbox .as-lightbox-retry { width: auto; height: auto; min-height: 48px; }
}

/* Match the approved card composition without changing commercial content. */
.cotton-variant > .as-bedding-gallery { width: calc(100% + 68px); margin: -34px -34px 24px; }
.sleep-selection img[data-bedding-card], .sleep-related-card img[data-bedding-card] {
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain;
}
.as-kare-zoom { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.as-kare-zoom:focus-visible { outline: 3px solid #6e5538; outline-offset: -3px; }
@media (max-width: 700px) {
  .cotton-variant > .as-bedding-gallery { width: calc(100% + 48px); margin: -24px -24px 24px; }
}
