/* Full-canvas single-product layout for products with the configurator enabled. */
body.w2d-enabled-product .woocommerce div.product div.images,
body.w2d-enabled-product .woocommerce-page div.product div.images,
body.w2d-enabled-product div.product div.images,
body.w2d-enabled-product .woocommerce-product-gallery,
body.w2d-enabled-product .woocommerce-product-gallery--without-images {
  display:none!important;
  width:0!important;
  height:0!important;
  margin:0!important;
  padding:0!important;
}

body.w2d-enabled-product .woocommerce div.product div.summary,
body.w2d-enabled-product .woocommerce-page div.product div.summary,
body.w2d-enabled-product div.product div.summary {
  float:none!important;
  clear:both!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}

/* Keep Woo's product information readable, but let the configurator break out to a canvas workspace. */
body.w2d-enabled-product form.cart {
  width:100%!important;
  max-width:none!important;
}

.w2d-configurator{
  --w2d-gutter:24px;
  display:grid;
  grid-template-columns:minmax(0,1.75fr) minmax(340px,.75fr);
  gap:22px;
  width:calc(100vw - (var(--w2d-gutter) * 2));
  max-width:none;
  margin:22px calc(50% - 50vw + var(--w2d-gutter)) 28px;
  align-items:start;
}

.w2d-preview-card,.w2d-controls{
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  box-sizing:border-box;
}

.w2d-preview-card{
  padding:14px;
  position:sticky;
  top:14px;
  align-self:start;
  min-width:0;
}

.w2d-model-title{
  font-size:13px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  text-align:center;
  margin:0 0 10px;
  color:#374151
}

.w2d-toolbar{display:flex;gap:8px;justify-content:center;margin-bottom:10px}
.w2d-view-btn,.w2d-design-btn{border:1px solid #d1d5db;background:#fff;border-radius:9px;cursor:pointer}
.w2d-view-btn{padding:8px 16px}
.w2d-view-btn.is-active,.w2d-design-btn.is-active{border-color:#111827;box-shadow:0 0 0 1px #111827 inset}

/* Main canvas. The jersey scales to the available viewport instead of a Woo product-image column. */
.w2d-stage{
  width:100%;
  min-height:clamp(560px,72vh,900px);
  height:calc(100vh - 175px);
  max-height:900px;
  display:grid;
  place-items:center;
  background:#ececec;
  border-radius:12px;
  overflow:hidden;
}

.w2d-shirt-svg{
  display:block;
  width:auto;
  height:96%;
  max-width:98%;
  max-height:96%;
  aspect-ratio:805/870;
}

.w2d-base-mockup{pointer-events:none}
.w2d-overlay-layer{mix-blend-mode:multiply;isolation:isolate}
.w2d-zone{stroke:none;fill-opacity:.92}
.w2d-trim-zone{fill-opacity:.95}
.w2d-design-layer{opacity:.82}
.w2d-controls{padding:20px;max-height:calc(100vh - 28px);overflow:auto}
.w2d-controls h3{margin:0 0 16px}
.w2d-section{border:0;border-top:1px solid #e5e7eb;padding:16px 0 4px;margin:0}
.w2d-section legend{font-weight:700;padding-right:10px}
.w2d-designs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.w2d-design-btn{padding:8px 5px;font-size:12px;display:flex;flex-direction:column;gap:6px;align-items:center}
.w2d-design-thumb{width:36px;height:42px;border:1px solid #9ca3af;border-radius:4px;background:#f5f5f5;display:block}
.w2d-thumb-diagonal{background:linear-gradient(105deg,#f5f5f5 0 38%,#e53935 39% 58%,#111 59% 66%,#f5f5f5 67%)}
.w2d-thumb-chevron{background:linear-gradient(145deg,transparent 42%,#e53935 43% 55%,transparent 56%),linear-gradient(215deg,transparent 42%,#e53935 43% 55%,transparent 56%),#f5f5f5}
.w2d-thumb-split{background:linear-gradient(90deg,#f5f5f5 0 50%,#e53935 50%)}
.w2d-thumb-racing{background:linear-gradient(90deg,#f5f5f5 0 38%,#e53935 38% 49%,#111 49% 55%,#f5f5f5 55%)}
.w2d-thumb-hoops{background:repeating-linear-gradient(0deg,#f5f5f5 0 8px,#e53935 8px 14px,#111 14px 20px)}
.w2d-thumb-sash{background:linear-gradient(55deg,#f5f5f5 0 40%,#e53935 40% 55%,#111 55% 60%,#f5f5f5 60%)}
.w2d-thumb-shoulders{background:linear-gradient(#e53935 0 30%,#111 30% 35%,#f5f5f5 35%)}
.w2d-thumb-gradient{background:linear-gradient(#f5f5f5,#e53935)}
.w2d-thumb-geo{background:conic-gradient(from 30deg,#e53935,#111,#f5f5f5,#e53935)}
.w2d-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.w2d-field-grid label,.w2d-full-field{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px}
.w2d-full-field{margin:10px 0;align-items:flex-start;flex-direction:column}
.w2d-full-field input[type=text],.w2d-full-field select{width:100%;box-sizing:border-box}
.w2d-full-field small{font-size:12px;color:#6b7280}
.w2d-price-line{display:flex;justify-content:space-between;align-items:center;font-size:18px;border-top:1px solid #e5e7eb;padding-top:16px;margin-top:12px}
.w2d-price-line strong{font-size:22px}
.w2d-custom-text{font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:1px}
.w2d-logo-image{pointer-events:none}

@media(max-width:1100px){
  .w2d-configurator{grid-template-columns:minmax(0,1.35fr) minmax(320px,.85fr)}
  .w2d-designs{grid-template-columns:repeat(3,1fr)}
}

@media(max-width:900px){
  .w2d-configurator{
    --w2d-gutter:14px;
    grid-template-columns:1fr;
  }
  .w2d-preview-card{position:static}
  .w2d-stage{height:auto;min-height:520px;max-height:none}
  .w2d-shirt-svg{width:min(100%,650px);height:auto;max-height:none}
  .w2d-controls{max-height:none;overflow:visible}
}

@media(max-width:520px){
  .w2d-configurator{--w2d-gutter:8px;gap:12px}
  .w2d-designs{grid-template-columns:repeat(2,1fr)}
  .w2d-field-grid{grid-template-columns:1fr}
  .w2d-stage{min-height:380px}
}

.w2d-custom-text{font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:2px;letter-spacing:.02em}
.w2d-logo-image{pointer-events:none;filter:drop-shadow(0 1px 2px rgba(0,0,0,.16))}

/* v0.8: SVG view switching must not rely on the HTML hidden attribute. */
.w2d-shirt-view{display:none}
.w2d-shirt-view.is-active{display:inline}

/* v1.0: one palette + explicit garment-area selector. */
.w2d-zone-selector{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:4px 0 14px}
.w2d-zone-btn{display:flex;align-items:center;justify-content:flex-start;gap:8px;min-height:38px;padding:7px 9px;border:1px solid #d1d5db;border-radius:9px;background:#fff;color:#111827;cursor:pointer;font-size:13px}
.w2d-zone-btn.is-active{border-color:#111827;box-shadow:0 0 0 1px #111827 inset;font-weight:700}
.w2d-zone-color-dot{width:18px;height:18px;border-radius:50%;background:var(--w2d-zone-color);box-shadow:0 0 0 1px rgba(15,23,42,.24);flex:0 0 auto}
.w2d-palette-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 8px;font-size:14px}
#w2d-selected-color{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;color:#64748b}
.w2d-color-palette{display:grid;grid-template-columns:repeat(6,36px);gap:10px;align-items:center}
.w2d-color-swatch{width:36px;height:36px;padding:0;border:2px solid #fff;border-radius:7px;background:var(--w2d-swatch);cursor:pointer;box-shadow:0 0 0 1px #cbd5e1;transition:transform .12s ease,box-shadow .12s ease}
.w2d-color-swatch:hover{transform:translateY(-1px);box-shadow:0 0 0 2px #64748b}
.w2d-color-swatch.is-active{box-shadow:0 0 0 3px #111827;transform:translateY(-1px)}
.w2d-color-swatch:focus-visible,.w2d-zone-btn:focus-visible{outline:3px solid #2563eb;outline-offset:2px}
@media(max-width:520px){.w2d-zone-selector{grid-template-columns:repeat(2,minmax(0,1fr))}.w2d-color-palette{grid-template-columns:repeat(6,31px);gap:8px}.w2d-color-swatch{width:31px;height:31px}}

/* v1.1 pixel-accurate realistic mockup compositing */
.w2d-overlay-layer{mix-blend-mode:multiply;isolation:isolate}
.w2d-zone{stroke:none!important;fill-opacity:.82!important}
.w2d-design-layer{opacity:.78}
.w2d-base-mockup{pointer-events:none}
