/* ------------------------------------------------------------
   product-3d-viewer.css
   Styles for components/product-3d-viewer.jinja
   Uses theme CSS variables (set in layout.jinja) so this matches
   whatever brand colors the store owner has configured.
   ------------------------------------------------------------ */

.product-3d-viewer-wrapper {
  position: relative;
  width: 100%;
  /* Real gallery images get their square shape implicitly (they carry
     width="359" height="359" HTML attributes, which browsers use to
     infer a 1:1 intrinsic aspect ratio even though CSS scales them to
     100%). model-viewer has no such attributes, so it needs an explicit
     aspect-ratio to match — a fixed min-height doesn't track the grid's
     actual (responsive) cell size. */
  aspect-ratio: 1 / 1;
  background-color: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.product-3d-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

.product-3d-ar-button {
  background-color: var(--primary-color, #111111);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 14px;
  font-family: inherit;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  white-space: nowrap;
}

.product-3d-ar-button:hover {
  opacity: 0.9;
}

.product-3d-progress-bar {
  display: block;
  width: 60%;
  height: 6px;
  max-width: 200px;
  border-radius: 3px;
  background-color: rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.product-3d-update-bar {
  background-color: var(--primary-color, #111111);
  width: 0%;
  height: 100%;
}

/* Hiding the progress bar on load is handled in JS (footer_scripts) —
   model-viewer's `loaded` is a JS property, not a reflected HTML
   attribute, so `model-viewer[loaded]` never matches as a CSS selector. */

/* RTL: mirror the AR button position, matching main.rtl.css conventions */
[dir="rtl"] .product-3d-ar-button {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

/* Mobile dot-nav "3D" badge (see customPaging in footer_scripts) — sized
   to match the real thumbnail rule in custom.css
   (`.products-details-page #product-images-slick .slick-dots li img`),
   since that rule targets <img> specifically and this is a <span>. */
.products-details-page #product-images-slick .slick-dots li .product-3d-dot-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 4px;
  border: 1px solid #eee;
  background-color: #f5f5f5;
  font-size: 11px;
  font-weight: bold;
}

.products-details-page #product-images-slick .slick-dots li.slick-active .product-3d-dot-badge {
  border-color: var(--primary-color, #111111);
}
