.pd-personalization{margin:1.5rem 0;padding:1.25rem;border:1px solid #ddd;border-radius:12px}.pd-preview-dialog{width:min(1050px,94vw);max-height:92dvh;overflow:auto;padding:28px;border:0;border-radius:16px;color:#182039}.pd-preview-dialog::backdrop{background:#111b}.pd-close{float:right;background:transparent;border:0;font-size:30px;cursor:pointer}.pd-preview-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(240px,1fr);gap:24px}.pd-preview-layout canvas{width:100%;height:auto;background:#fff;border:1px solid #ddd;border-radius:8px;touch-action:none;cursor:move}.pd-controls{display:flex;flex-direction:column;gap:12px}.pd-controls label{display:flex;flex-direction:column;gap:6px;font-weight:600}.pd-controls input{max-width:100%}.pd-controls input[type=number]{padding:10px;border:1px solid #ccc;border-radius:6px}.pd-controls p{margin:0}.pd-personalization [role=status]:empty{display:none}@media(max-width:700px){.pd-preview-layout{grid-template-columns:1fr}.pd-preview-dialog{padding:18px}}

.pd-preview-dialog{margin:auto;box-sizing:border-box}.pd-preview-dialog h2{font-size:1.5rem;font-weight:700;margin:0 40px 12px 0}.pd-preview-dialog [data-pd-save]{background:#f5a000;color:#182039;font-weight:700}.pd-preview-dialog [data-pd-save]:disabled{opacity:.5}.pd-preview-dialog [data-pd-zone]{margin-bottom:18px}

.print-configurator .pd-preview-dialog canvas{display:block;width:auto;height:auto;max-width:100%;max-height:60vh;margin:0 auto}.print-configurator .pd-personalization .pd-preview-dialog h2{font-size:1.5rem;line-height:1.3;font-weight:700}@media(max-width:700px){.print-configurator .pd-preview-dialog canvas{max-height:42vh}}

/* Pidesign uses the same cards and action hierarchy as the textile configurator. */
.pd-textile-style .pd-personalization{border:0;padding:0;margin:12px 0;display:flex;flex-direction:column;gap:10px}
.pd-textile-style .pd-personalization>.button{width:100%;min-height:44px;border-radius:999px;font:inherit;font-weight:700;justify-content:center;margin:0;padding:12px 18px}
.pd-textile-style .pd-create-design,.pd-textile-style .pd-preview-dialog [data-pd-save]{background:#e92338!important;border:1px solid #e92338!important;color:#fff!important}
.pd-textile-style .pd-add-later{background:#f5f0e6!important;border:1px solid #f5f0e6!important;color:#151515!important}
.pd-textile-style .pd-personalization>.button:disabled{opacity:.45;cursor:not-allowed}
.pd-textile-style [data-attribute-key=zone] .print-option-buttons{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.pd-textile-style [data-attribute-key=zone] .print-option{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:190px;width:100%;padding:12px;border:1px solid #cdbda8;border-radius:7px;background:white;text-align:center}
.pd-textile-style [data-attribute-key=zone] .print-option-image{display:block!important;width:100%!important;max-width:190px!important;height:120px!important;object-fit:contain!important;mix-blend-mode:multiply}
.pd-textile-style [data-attribute-key=zone] .print-option[aria-pressed=true],.pd-textile-style [data-attribute-key=method] .print-option[aria-pressed=true]{border:2px solid #e92338!important;background:#f5f0e6!important;color:#151515!important}
.pd-textile-style [data-attribute-key=method] .print-option{border:1px solid #cdbda8;border-radius:7px;min-height:48px}
.pd-textile-style .print-recap{border-top:1px solid #e9dfce;padding-top:16px}
.pd-textile-style [data-print-total]{font-size:28px;font-weight:800}
.pd-textile-style .pd-preview-dialog{color:#151515}
.pd-textile-style .pd-personalization>[data-pd-summary]{order:3;margin:0}
@media(max-width:600px){.pd-textile-style [data-attribute-key=zone] .print-option-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}.pd-textile-style [data-attribute-key=zone] .print-option-image{height:100px!important}}

body .pp-product .print-configurator.pd-textile-style .pd-personalization>button.pd-create-design{background:#e92338!important;color:white!important;border-color:#e92338!important;border-radius:999px!important}
body .pp-product .print-configurator.pd-textile-style .pd-personalization>button.pd-add-later{background:#f5f0e6!important;color:#151515!important;border-color:#f5f0e6!important;border-radius:999px!important}

/* Compact technique choices, matching the textile marking controls. */
body .pp-product .pd-textile-style [data-attribute-key=method] .print-option-buttons{display:flex!important;flex-wrap:wrap;gap:8px}
body .pp-product .pd-textile-style [data-attribute-key=method] button.print-option{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;flex:0 1 auto!important;width:auto!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:44px!important;padding:9px 12px!important;text-align:left!important;border-radius:7px!important}
body .pp-product .pd-textile-style [data-attribute-key=method] .print-option-image{display:block!important;width:28px!important;height:28px!important;min-width:28px!important;max-width:28px!important;object-fit:contain!important;margin:0!important;background:transparent!important;border:0!important;border-radius:0!important}
body .pp-product .pd-textile-style [data-attribute-key=method] .print-option-label{white-space:normal!important;line-height:1.4;text-transform:none}

/* Keep the logo editor within small viewports, including long upload filenames. */
@media(max-width:700px){
    body .pd-preview-dialog{width:calc(100vw - 24px);max-width:calc(100vw - 24px);min-width:0;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);padding:16px;box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain}
    body .pd-preview-dialog .pd-preview-layout{grid-template-columns:minmax(0,1fr);gap:16px}
    body .pd-preview-dialog .pd-preview-layout>div,body .pd-preview-dialog .pd-controls,body .pd-preview-dialog .pd-controls label{min-width:0;max-width:100%}
    body .pd-preview-dialog .pd-controls input{box-sizing:border-box;width:100%;min-width:0;max-width:100%;font-size:16px}
    body .pd-preview-dialog .pd-controls input[type=file]{overflow:hidden}
    body .pd-preview-dialog .pd-controls .button{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
    body .pd-preview-dialog p,body .pd-preview-dialog small{overflow-wrap:anywhere}
    body .pd-preview-dialog .pd-close{position:sticky;top:0;z-index:2;min-width:44px;min-height:44px;background:#fff;border-radius:50%;line-height:1}
    body .print-configurator .pd-preview-dialog canvas{max-width:100%;max-height:32vh;max-height:32dvh;object-fit:contain}
}
