.product-3d-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #8e6e52;
  cursor: pointer;
  display: inline-flex;
  height: 31px;
  justify-content: center;
  padding: 0;
  width: 25px;
}

.product-3d-button svg {
  display: block;
  height: 25px;
  width: 25px;
}

.product__buttons .product-3d-button svg {
  height: 32px;
  width: 32px;
  flex-shrink: 0;
}

.product__buttons .product-3d-button svg polygon,
.product__buttons .product-3d-button svg polyline,
.product__buttons .product-3d-button svg line {
  fill: transparent !important;
  stroke: var(--ui-orange-1, #F68E1E);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1;
  transition: stroke var(--ui-speed) var(--ui-ease);
}

.product__buttons .product-3d-button:hover svg polygon,
.product__buttons .product-3d-button:hover svg polyline,
.product__buttons .product-3d-button:hover svg line {
  stroke: var(--ui-orange-2, #8e6e52);
}

.product__buttons .product-3d-button svg text {
  fill: var(--ui-orange-1, #F68E1E);
  stroke: none;
  font-family: Arial, sans-serif;
  font-size: 8px;
  font-weight: 400;
  transition: fill var(--ui-speed) var(--ui-ease);
}

.product__buttons .product-3d-button:hover svg text {
  fill: var(--ui-orange-2, #8e6e52);
}

.product__buttons .product-3d-button:active svg polygon,
.product__buttons .product-3d-button:active svg polyline,
.product__buttons .product-3d-button:active svg line {
  stroke: var(--ui-orange-2, #8e6e52);
}

.product-3d-modal {
  background: rgba(20, 24, 28, 0.72);
  bottom: 0;
  display: none;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1060;
}

.product-3d-modal.is-open {
  display: flex;
}

.product-3d-modal__dialog {
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  margin: auto;
  max-height: 92vh;
  max-width: 1120px;
  min-height: 520px;
  width: min(100%, 1120px);
}

.product-3d-modal__header {
  align-items: center;
  border-bottom: 1px solid #e4e0dc;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 18px;
}

.product-3d-modal__actions {
  align-items: center;
  display: inline-flex;
  gap: 12px;
}

.product-3d-modal__parts-toggle {
  background: #8e6e52;
  border: 1px solid #8e6e52;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 8px 12px;
}

.product-3d-modal__parts-toggle:hover,
.product-3d-modal__parts-toggle[aria-expanded="true"] {
  background: #6f553f;
  border-color: #6f553f;
}

.product-3d-modal__title {
  color: #2f2a25;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.product-3d-modal__close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #8e6e52;
  cursor: pointer;
  display: inline-flex;
  font-size: 30px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 36px;
}

.product-3d-modal__body {
  background: #f8f7f5;
  flex: 1;
  min-height: 420px;
  overflow: hidden;
  position: relative;
}

.product-3d-modal canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.product-3d-modal__status {
  background: rgba(255, 255, 255, 0.92);
  color: #55483d;
  left: 16px;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  position: absolute;
  top: 16px;
}

.product-3d-modal__status.is-error {
  color: #b3261e;
}

.product-3d-parts {
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid #e4e0dc;
  bottom: 0;
  box-shadow: -12px 0 28px rgba(47, 42, 37, 0.14);
  display: grid;
  gap: 12px;
  grid-template-rows: auto auto auto 1fr;
  max-width: 320px;
  padding: 16px;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  width: min(34%, 320px);
  z-index: 2;
}

.product-3d-modal.is-parts-open .product-3d-parts {
  transform: translateX(0);
}

.product-3d-parts__head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.product-3d-parts__head strong {
  color: #2f2a25;
  font-size: 15px;
  line-height: 1.25;
}

.product-3d-parts__head span {
  color: #74675b;
  font-size: 13px;
  white-space: nowrap;
}

.product-3d-parts__search {
  border: 1px solid #d8cec4;
  color: #2f2a25;
  font: inherit;
  font-size: 14px;
  min-height: 36px;
  padding: 0 10px;
  width: 100%;
}

.product-3d-parts__actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-3d-parts__actions button {
  background: #fff;
  border: 1px solid #d8cec4;
  color: #55483d;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  min-height: 34px;
}

.product-3d-parts__actions button:hover {
  border-color: #8e6e52;
  color: #2f2a25;
}

.product-3d-parts__list {
  display: grid;
  gap: 8px;
  max-height: 100%;
  overflow: auto;
  padding-right: 2px;
}

.product-3d-parts__empty {
  color: #74675b;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.product-3d-part {
  align-items: flex-start;
  color: #2f2a25;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr;
  line-height: 1.25;
}

.product-3d-part input {
  height: 16px;
  margin: 1px 0 0;
  width: 16px;
}

.product-3d-part span {
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
}

body.product-3d-modal-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .product-3d-modal {
    padding: 10px;
  }

  .product-3d-modal__dialog {
    min-height: 78vh;
  }

  .product-3d-modal__body {
    min-height: 64vh;
  }

  .product-3d-parts {
    border-left: 0;
    border-top: 1px solid #e4e0dc;
    bottom: 0;
    box-shadow: 0 -12px 28px rgba(47, 42, 37, 0.14);
    max-height: 46%;
    max-width: none;
    top: auto;
    transform: translateY(100%);
    width: 100%;
  }

  .product-3d-modal.is-parts-open .product-3d-parts {
    transform: translateY(0);
  }
}

/* Shared on-page viewer: toolbar -> disclosure -> full screen/details/close. */
.product-3d-panel--video-frame {
  border-width: 1px !important;
  border-color: var(--ui-orange-1, #f58b20) !important;
  background: #fff !important;
  padding: 0 20px !important;
  scroll-margin-top: 100px;
}

.product-3d-panel__summary {
  align-items: center;
  color: #4d463d;
  cursor: pointer;
  display: flex;
  gap: 14px;
  list-style: none;
  min-height: 76px;
  outline: none;
  padding: 18px 0;
}

.product-3d-panel__summary::-webkit-details-marker {
  display: none;
}

.product-3d-panel__summary:focus-visible {
  outline: 2px solid var(--ui-orange-1, #f58b20);
  outline-offset: 4px;
}

.product-3d-panel__icon {
  align-items: center;
  color: var(--ui-orange-1, #f58b20);
  display: inline-flex;
  flex: 0 0 32px;
  justify-content: center;
}

.product-3d-panel__icon svg {
  height: 32px;
  width: 32px;
}

.product-3d-panel__title {
  flex: 1 1 auto;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.product-3d-panel__chevron {
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  color: var(--ui-orange-1, #f58b20);
  flex: 0 0 11px;
  height: 11px;
  margin-right: 4px;
  transform: rotate(45deg) translateY(-3px);
  transition: transform .2s ease;
}

.product-3d-panel[open] .product-3d-panel__chevron {
  transform: rotate(225deg) translate(-2px, -1px);
}

.product-3d-panel__body {
  border-top: 1px solid #e2ded8;
  padding: 20px 0 24px;
}


.product-3d-panel--video-frame { border-style: solid; margin: 4px -12px; }
.product-3d-panel__body { min-width: 0; }
.product-3d-modal.is-inline { position: static; inset: auto; padding: 0; background: transparent; z-index: auto; }
.product-3d-modal.is-inline .product-3d-modal__dialog { width: 100%; max-width: none; max-height: none; min-height: 0; margin: 0; box-shadow: none; }
.product-3d-modal.is-inline .product-3d-modal__header { flex-wrap: wrap; gap: 12px; padding: 0 0 14px; }
.product-3d-modal.is-inline .product-3d-modal__actions { flex-wrap: wrap; gap: 8px; }
.product-3d-modal.is-inline .product-3d-modal__body { flex: none; min-height: 300px; height: clamp(300px, 48vw, 600px); }
.product-3d-modal.is-inline.is-expanded { position: fixed; inset: 0; z-index: 1100; width: 100%; height: 100%; padding: 16px; background: #fff; }
.product-3d-modal.is-inline:fullscreen { background: #fff; padding: 16px; }
.product-3d-modal.is-inline.is-expanded .product-3d-modal__dialog,
.product-3d-modal.is-inline:fullscreen .product-3d-modal__dialog { height: 100%; }
.product-3d-modal.is-inline.is-expanded .product-3d-modal__body,
.product-3d-modal.is-inline:fullscreen .product-3d-modal__body { flex: 1; height: auto; min-height: 0; }
.product-3d-modal__parts-toggle { min-height: 36px; }
.product-3d-modal__parts-toggle[hidden] { display: none; }
.product-3d-modal__parts-toggle:focus-visible,
.product-3d-modal__close:focus-visible { outline: 2px solid var(--ui-orange-1, #f58b20); outline-offset: 3px; }
@media (max-width: 575px) {
  .product-3d-panel--video-frame { padding: 0 12px !important; }
  .product-3d-panel__title { font-size: 20px; }
  .product-3d-panel__summary { gap: 10px; }
  .product-3d-modal.is-inline .product-3d-modal__body { height: 420px; }
  .product-3d-modal.is-inline .product-3d-modal__actions { width: 100%; }
  .product-3d-modal.is-inline .product-3d-modal__close { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .product-3d-panel__chevron, .product-3d-parts { transition: none; }
}
