/*
 * ---------------------------------------------------------
 * Base Three.js viewer
 * ---------------------------------------------------------
 */
.w3d-viewer {
  position: relative;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  background: #f7f7f7;
}

.w3d-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
}

.w3d-viewer canvas:active {
  cursor: grabbing;
}

.w3d-viewer__loading,
.w3d-viewer__error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: #333;
  z-index: 2;
}

.w3d-viewer__error {
  color: #9b1c1c;
  background: #fff5f5;
}

.w3d-viewer__loading[hidden],
.w3d-viewer__error[hidden] {
  display: none !important;
}

.w3d-viewer.is-loaded .w3d-viewer__loading {
  display: none;
}

.w3d-viewer.has-error canvas {
  display: none;
}

/*
 * ---------------------------------------------------------
 * Hidden server-rendered source
 * ---------------------------------------------------------
 */
.w3d-gallery-viewer-source {
  display: none !important;
}

/*
 * ---------------------------------------------------------
 * WooCommerce / Astra product gallery integration
 * ---------------------------------------------------------
 */
.single-product .woocommerce-product-gallery .flex-viewport {
  position: relative;
}

/*
 * This is moved by frontend.js directly into
 * WooCommerce's .flex-viewport.
 */
.w3d-gallery-viewer-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  z-index: 20;
}

.w3d-gallery-viewer-layer[hidden] {
  display: none !important;
}

/*
 * Force the viewer to occupy the exact large-image
 * dimensions instead of the admin-configured pixel height.
 */
.w3d-gallery-viewer-layer .w3d-viewer--product-gallery {
  width: 100%;
  height: 100% !important;
  min-height: 100%;
  border-radius: 0;
}

/*
 * WooCommerce normally shows its zoom/magnifier button
 * on top of the gallery. It makes no sense while the
 * interactive 3D viewer is selected.
 */
.woocommerce-product-gallery.w3d-viewer-active .woocommerce-product-gallery__trigger {
  display: none !important;
}

/*
 * ---------------------------------------------------------
 * First 3D thumbnail
 * ---------------------------------------------------------
 */
.woocommerce-product-gallery .flex-control-thumbs .w3d-gallery-thumb {
  position: relative;
}

.woocommerce-product-gallery .flex-control-thumbs .w3d-gallery-thumb__button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 0;
}

.woocommerce-product-gallery .flex-control-thumbs .w3d-gallery-thumb__image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  aspect-ratio: 1/1;
  object-fit: cover;
  opacity: 0.5;
  transition: opacity 0.2s ease, outline-color 0.2s ease;
}

.woocommerce-product-gallery .flex-control-thumbs .w3d-gallery-thumb__button:hover .w3d-gallery-thumb__image {
  opacity: 1;
}

/*
 * flex-active is intentionally applied by JS because
 * Astra/WooCommerce already use this class for the
 * currently selected thumbnail.
 */
.woocommerce-product-gallery .flex-control-thumbs .w3d-gallery-thumb__image.flex-active {
  opacity: 1;
}

/*
 * Fallback active border in case Astra doesn't style
 * flex-active itself.
 */
.woocommerce-product-gallery .flex-control-thumbs .w3d-gallery-thumb.is-active .w3d-gallery-thumb__image {
  opacity: 1;
  outline: 2px solid var(--ast-global-color-0, #c79a43);
  outline-offset: -2px;
}

/*
 * Keyboard accessibility.
 */
.woocommerce-product-gallery .flex-control-thumbs .w3d-gallery-thumb__button:focus-visible {
  outline: 2px solid var(--ast-global-color-0, #c79a43);
  outline-offset: 2px;
}

/*
 * ---------------------------------------------------------
 * Material target selector
 * Cushion / Frame / Pillows
 * ---------------------------------------------------------
 */
.w3d-material-selector {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: calc(100% - 28px);
  padding: 6px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(8px);
}

.w3d-material-selector__button {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.15);
  border-radius: 999px;
  background: #ffffff;
  color: #202020;
  padding: 8px 12px;
  min-height: 34px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.w3d-material-selector__button:hover {
  border-color: #b98224;
}

.w3d-material-selector__button.is-active,
.w3d-material-selector__button[aria-pressed=true] {
  border-color: #c58a26;
  background: #171717;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(197, 138, 38, 0.18);
}

@media (max-width: 767px) {
  .w3d-material-selector {
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
  }
  .w3d-material-selector__button {
    padding: 7px 10px;
    font-size: 11px;
  }
}
/*
 * Make sure viewer keeps filling the main product
 * image area on phones.
 */
@media (max-width: 767px) {
  .w3d-gallery-viewer-layer .w3d-viewer--product-gallery {
    min-height: 300px;
  }
}

/*# sourceMappingURL=frontend.css.map */
