/* BOXOO Phase 6 / R32 mobile-only, browser-injected prototype. No production changes. */
@media (max-width: 720px) {
  /* Respect the existing four-step sliding workflow, but prevent nested min-content
     widths from enlarging an individual slide beyond the actual mobile viewport. */
  #configuratorStudio .studio-viewport-v3813,
  #configuratorStudio .studio-slide,
  #configuratorStudio .slide-pad,
  #configuratorStudio .construction-workspace-v3813,
  #configuratorStudio .construction-picker-v3813,
  #configuratorStudio .construction-list-v3813,
  #configuratorStudio .visual-inspector-v3813,
  #configuratorStudio .visual-copy-v3813,
  #configuratorStudio .visual-gallery-v32339,
  #configuratorStudio .material-layout-v3813,
  #configuratorStudio .material-buy-zone-v3813,
  #configuratorStudio .checkout-layout-v3813,
  #configuratorStudio .checkout-form-v3813,
  #configuratorStudio .checkout-section-v3813 {
    min-width: 0;
    box-sizing: border-box;
  }
  #configuratorStudio .construction-workspace-v3813 {
    grid-template-columns: minmax(0, 1fr);
  }
  /* A vertical list is reliably scannable at 360px, unlike 848px snap items. */
  #configuratorStudio .construction-list-v3813 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
    gap: 7px;
    width: 100%;
  }
  #configuratorStudio .construction-option-v3813 {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-basis: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content) 14px;
    gap: 5px 7px;
    padding: 11px 10px;
    overflow: hidden;
  }
  #configuratorStudio .construction-option-v3813 .construction-option-copy-v3813,
  #configuratorStudio .construction-option-v3813 .construction-price-v3232,
  #configuratorStudio .construction-option-v3813 .construction-discount-v3232 {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  #configuratorStudio .construction-option-v3813 .construction-price-v3232 > strong {
    white-space: normal;
    font-size: 13px;
    line-height: 1.3;
    text-align: right;
  }
  /* Keep the accepted Step 2 narrative, reduce its oversized mobile artwork. */
  #configuratorStudio .visual-inspector-v3813 {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "visuals" "cta";
    grid-template-rows: auto auto auto;
  }
  #configuratorStudio .visual-gallery-v32339 {
    height: auto;
    min-height: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 185px) minmax(0, 140px);
    gap: 8px;
  }
  #configuratorStudio .visual-gallery-v32339 > .visual-main-card-v3813 {
    width: 100%;
    height: 185px;
    min-height: 0;
  }
  #configuratorStudio .visual-gallery-v32339 > .dieline-card-v3813 {
    width: 100%;
    height: 140px;
    min-height: 0;
    overflow: hidden;
  }
  #configuratorStudio .visual-gallery-v32339 img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  #configuratorStudio .visual-features-v3813 {flex-wrap: wrap;}
  #configuratorStudio .visual-copy-v3813,
  #configuratorStudio .visual-inspector-v3813 p,
  #configuratorStudio .construction-insight-v32338,
  #configuratorStudio .visual-inspector-v3813 h3 {
    overflow-wrap: anywhere;
  }
  /* Four milestones must be visible instead of being clipped at the right edge. */
  #configuratorStudio .studio-header-v3813 {padding: 8px 7px;}
  #configuratorStudio .studio-progress-v3813 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
  }
  #configuratorStudio .studio-progress-v3813 > i {display: none;}
  #configuratorStudio .studio-progress-v3813 button {
    min-width: 0;
    padding: 3px 1px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    text-align: center;
  }
  #configuratorStudio .studio-progress-v3813 .progress-copy b {
    font-size: 9px;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  /* Reduce the picture footprint on Step 3 without altering dieline/quote JS. */
  #configuratorStudio .step3-product-panel-v32343 {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #configuratorStudio .step3-product-panel-v32343 .step3-product-image-v32343,
  #configuratorStudio .step3-product-panel-v32343 .step3-product-dieline-v32343 {
    min-width: 0;
    height: 120px;
  }
  #configuratorStudio .material-price-cards-v3813,
  #configuratorStudio .checkout-layout-v3813 {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }
  #configuratorStudio .checkout-slide-v3813 :is(input,select,textarea,button){max-width:100%;}
  #configuratorStudio .checkout-slide-v3813 :is(h2,h3,p,label,span,strong){overflow-wrap:anywhere;}
}
/* Keep chat completely functional, but dock a compact launcher away from mobile actions.
   The open panel keeps its existing approved dimensions and behavior. */
@media (max-width: 720px){
  body.shop-home:has(#studioProgress button[data-go-step="3"].active) .boxoo-support-widget:not(.is-open),
  body.shop-home:has(#studioProgress button[data-go-step="4"].active) .boxoo-support-widget:not(.is-open) {right:8px;bottom:8px;}
  body.shop-home:has(#studioProgress button[data-go-step="3"].active) .boxoo-support-widget:not(.is-open) .support-launcher,
  body.shop-home:has(#studioProgress button[data-go-step="4"].active) .boxoo-support-widget:not(.is-open) .support-launcher {width:44px;height:44px;min-height:44px;padding:0;justify-content:center;border-radius:12px;gap:0;}
  body.shop-home:has(#studioProgress button[data-go-step="3"].active) .boxoo-support-widget:not(.is-open) .support-launcher>span:not(.support-launcher-icon),
  body.shop-home:has(#studioProgress button[data-go-step="4"].active) .boxoo-support-widget:not(.is-open) .support-launcher>span:not(.support-launcher-icon){display:none;}
}

/* R34 mobile-only header docking: avoids important CTA and material-card occlusion.
   Only active wizard Steps 3–4 on 360–480px. Desktop remains unchanged. */
@media (min-width: 360px) and (max-width: 480px) {
  body.shop-home:has(#studioProgress button[data-go-step="3"].active) .boxoo-support-widget:not(.is-open),
  body.shop-home:has(#studioProgress button[data-go-step="4"].active) .boxoo-support-widget:not(.is-open) {
    top: 14px;
    right: 150px;
    bottom: auto;
  }
  /* The mobile cart drawer is modal and must own its complete viewport. */
  body.shop-home:has(#orderCartDrawer[aria-hidden="false"]) .boxoo-support-widget:not(.is-open) {
    display: none;
  }
}
