:root {
    --ppd-green: #35b777;
    --ppd-black: #111;
    --ppd-border: #dedede;
    --ppd-panel: #f7f7f5;
}

body.ppd-modal-open { overflow: hidden; }

.ppd-editor-shell { margin: 0; }

/* Keep Customize above the quantity/Add to Cart row without moving the
   designer's hidden order fields outside WooCommerce's cart form. */
.single-product form.cart .ppd-editor-shell,
.single-product .woocommerce-variation-add-to-cart .ppd-editor-shell {
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
    margin: 0;
}

.ppd-open-designer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    /* Space above the button is anchored here (not under the form) so a product
       with no personalize form doesn't get double spacing on top. */
    margin-top: 18px;
    min-height: 42px;
    padding: 9px 18px;
    border: 1px solid #000;
    border-radius: 6px;
    background: #fff;
    color: #000;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.ppd-open-designer:not(:disabled):not(.is-locked):hover,
.ppd-open-designer:not(:disabled):not(.is-locked):focus-visible {
    border-color: #000 !important;
    background: #000 !important;
    color: #fff !important;
}
.ppd-open-designer svg,
.ppd-tool-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.ppd-modal[hidden] { display: none !important; }
.ppd-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 12px; }
.ppd-modal__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(0,0,0,.62); cursor: default; }
.ppd-modal__dialog {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(1600px, 100%);
    height: min(1040px, calc(100dvh - 24px));
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0,0,0,.28);
}

.ppd-modal__header,
.ppd-modal__footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-color: var(--ppd-border); }
.ppd-modal__header { border-bottom: 1px solid var(--ppd-border); }
.ppd-modal__footer { justify-content: flex-end; border-top: 1px solid var(--ppd-border); }
.ppd-modal__eyebrow { display: block; margin-bottom: 2px; color: var(--ppd-green); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ppd-modal__header h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.ppd-icon-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: #f2f2f2; color: #111; cursor: pointer; }
.ppd-icon-button svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.ppd-icon-button:hover { background: #e5e5e5; }

.ppd-modal__body { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 0; }
.ppd-tools { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 18px; border-right: 1px solid var(--ppd-border); background: #fff; overflow-y: auto; }
.ppd-tool-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--ppd-border);
    border-radius: 7px;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.ppd-tool-button:hover { border-color: #111; }
.ppd-tools > .ppd-tool-button { display: none; }
.ppd-product-switcher { display: none !important; }
.ppd-product-switcher label,
.ppd-assets-panel__heading { display: block; margin-bottom: 7px; color: #555; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ppd-product-switcher select { width: 100%; min-height: 38px; }
.ppd-layers-panel {
    position: relative;
    z-index: 2;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    margin-top: 16px;
    margin-bottom: 0;
    padding-bottom: 16px;
    clear: both;
    border-bottom: 1px solid var(--ppd-border);
    background: #fff;
}
.ppd-layers-panel__header { display: block; }
.ppd-layers-panel__close,
.ppd-layers-drawer-backdrop,
.ppd-mobile-layers-toggle { display: none; }
.ppd-assets-panel {
    position: relative;
    z-index: 1;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    margin-top: 16px !important;
    padding-top: 0;
    clear: both;
    background: #fff;
}
.ppd-design-layers { display: flex; flex-direction: column; gap: 7px; max-height: 132px; margin-bottom: 0; overflow-y: auto; padding: 1px 4px 2px 1px; }
.ppd-design-layer {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    flex: 0 0 auto;
    width: 100%;
    min-height: 48px;
    padding: 7px 8px;
    border: 1px solid var(--ppd-border);
    border-radius: 7px;
    background: #fff;
    color: #222;
    font: inherit;
    box-sizing: border-box;
    cursor: grab;
    touch-action: none;
    text-align: left;
}
.ppd-design-layer:has(.ppd-design-layer__align-menu:not([hidden])) { grid-template-rows: auto auto; }
.ppd-design-layer:hover { border-color: #111; }
.ppd-design-layer.is-dragging { opacity: .42; cursor: grabbing; }
.ppd-design-layer.is-drag-over { border-color: var(--ppd-green); box-shadow: 0 -2px 0 var(--ppd-green); }
.ppd-guides-toggle-row { display: flex; justify-content: flex-end; min-height: 23px; padding: 0 2px; }
.ppd-design-layer__icon--small { width: 23px; height: 23px; }
.ppd-design-layer__icon--small svg { width: 13px; height: 13px; }
.ppd-design-layer.is-active { border-color: var(--ppd-green); background: #eef8f3; box-shadow: 0 0 0 1px var(--ppd-green); }
.ppd-design-layer.is-disabled .ppd-design-layer__main { cursor: not-allowed; opacity: .64; }
.ppd-design-layer.is-hidden { opacity: .72; }
.ppd-design-layer__main { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; justify-content: flex-start; gap: 6px; width: 100%; min-width: 0; min-height: 34px; overflow: hidden; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ppd-design-layer__main:disabled { cursor: not-allowed; }
.ppd-design-layer__thumb { display: grid; place-items: center; width: 32px; height: 32px; overflow: hidden; border: 1px solid #e0e0e0; border-radius: 6px; background: #f7f7f5; color: #16784b; font-size: 13px; font-weight: 850; line-height: 1; }
.ppd-design-layer__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ppd-design-layer__thumb svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ppd-design-layer__thumb.is-text { padding: 2px; background: #eef8f3; color: #16784b; font-size: 8px; line-height: 1.05; text-align: center; word-break: break-word; box-sizing: border-box; }
.ppd-design-layer__title { display: block; min-width: 0; overflow: hidden; font-size: 11px; font-weight: 750; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.ppd-design-layer.is-hidden .ppd-design-layer__title { text-decoration: line-through; }
.ppd-design-layer__lock { display: inline-grid; place-items: center; flex: 0 0 auto; width: 15px; height: 15px; color: #555; }
.ppd-design-layer__lock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ppd-design-layer__actions { display: inline-flex; align-items: center; gap: 3px; }
.ppd-design-layer__icon { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; padding: 0; border: 1px solid #d8d8d8; border-radius: 6px; background: #f3f3f3; color: #333; cursor: pointer; }
.ppd-design-layer__icon:hover { border-color: var(--ppd-green); background: #eef8f3; color: #16784b; }
.ppd-design-layer__icon:disabled { opacity: .38; cursor: not-allowed; }
.ppd-design-layer__icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ppd-design-layer__align-menu { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 5px; padding-top: 6px; border-top: 1px solid #e7e7e7; }
.ppd-design-layer__align-menu[hidden] { display: none !important; }
.ppd-design-layers__empty { margin: 0; color: #777; font-size: 12px; line-height: 1.4; }
.ppd-asset-category {
    width: 100%;
    min-height: 38px;
    margin-bottom: 9px;
    padding: 7px 30px 7px 9px;
    border: 1px solid var(--ppd-border);
    border-radius: 6px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 12px;
}
.ppd-asset-category[hidden] { display: none; }
.ppd-assets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ppd-asset {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--ppd-border);
    border-radius: 6px;
    background: var(--ppd-panel);
    cursor: pointer;
}
.ppd-asset:hover { border-color: #111; }
.ppd-asset img { width: 100%; height: 100%; object-fit: contain; }
.ppd-assets__empty { grid-column: 1 / -1; color: #777; font-size: 12px; line-height: 1.5; }

.ppd-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; padding: 16px; background: var(--ppd-panel); }
.ppd-workspace-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; min-width: 0; min-height: 44px; padding-bottom: 10px; }
.ppd-workspace-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ppd-workspace-tools .ppd-tool-button { width: auto; min-height: 38px; padding: 8px 12px; white-space: nowrap; }
.ppd-view-tabs { display: flex; justify-content: flex-end; gap: 6px; min-width: 0; min-height: 38px; overflow-x: auto; scrollbar-width: thin; }
.ppd-view-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto; padding: 7px 14px; border: 1px solid var(--ppd-border); border-radius: 999px; background: #fff; color: #333; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.ppd-view-tab.is-active { border-color: var(--ppd-black); background: var(--ppd-black); color: #fff; }
.ppd-view-tab__mask { display: inline-grid; place-items: center; flex: 0 0 auto; width: 21px; height: 15px; color: currentColor; }
.ppd-view-tab.is-active .ppd-view-tab__mask { color: #fff; }
.ppd-view-tab__mask svg { display: block; width: 21px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ppd-stage-wrap { position: relative; display: grid; place-items: center; min-height: 0; overflow: auto; border: 1px solid #e2e2df; border-radius: 9px; background-color: #e7e7e3; background-image: linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; }
.ppd-stage-wrap canvas { display: block; max-width: calc(100% - 20px); max-height: calc(100% - 20px); width: auto; height: auto; background: #fff; box-shadow: 0 5px 22px rgba(0,0,0,.16); touch-action: none; }
.ppd-wrap-labels { position: absolute; z-index: 4; display: grid; pointer-events: none; color: #6b7280; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; letter-spacing: .02em; }
.ppd-wrap-labels[hidden] { display: none; }
.ppd-image-toolbar {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: calc(100% - 16px);
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(0,0,0,.2);
    transform: translate(-50%, -100%);
}
.ppd-image-toolbar[hidden], .ppd-image-panel[hidden] { display: none !important; }
.ppd-image-toolbar button { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 9px; border: 0; border-radius: 7px; background: transparent; color: #222; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ppd-image-toolbar button[hidden] { display: none !important; }
.ppd-image-toolbar button svg { flex: 0 0 17px; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ppd-image-toolbar button:hover, .ppd-image-toolbar button.is-active { background: #eef8f3; color: #16784b; }
.ppd-image-toolbar button[data-ppd-image-action="ai"] { color: #0f7a4b; }
.ppd-image-toolbar button[data-ppd-image-action="ai"] svg { padding: 2px; border-radius: 50%; background: #35b777; color: #fff; stroke-width: 2; }
.ppd-image-toolbar button[data-ppd-image-action="ai"]:hover,
.ppd-image-toolbar button[data-ppd-image-action="ai"].is-active { background: #e8f8ef; color: #0f7a4b; }
.ppd-image-toolbar button.is-danger:hover { background: #fff0f0; color: #b32d2e; }
/* Thin divider separating Reset / Delete from the editing tools. */
.ppd-toolbar-divider { flex: 0 0 1px; width: 1px; height: 22px; margin: 0 4px; background: rgba(0, 0, 0, .14); border-radius: 1px; }

/* Reset button beside the view tabs on mobile (hidden on desktop). */
.ppd-mobile-reset { display: none; }
.ppd-image-panel { position: absolute; z-index: 6; width: min(290px, calc(100% - 20px)); padding: 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.22); transform: translateX(-50%); }
.ppd-image-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ppd-image-panel__header strong { font-size: 13px; }
.ppd-image-panel__header button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: #f1f1f1; font-size: 20px; cursor: pointer; }
.ppd-image-panel__row { margin: 9px 0; }
.ppd-image-panel__row label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; color: #444; font-size: 11px; font-weight: 700; }
.ppd-image-panel__row input[type="range"] { width: 100%; }
.ppd-repeat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ppd-repeat-grid label { display: flex; align-items: center; gap: 7px; min-width: 0; color: #444; font-size: 11px; font-weight: 800; }
.ppd-repeat-grid span { flex: 0 0 auto; }
.ppd-repeat-grid input { width: 100%; min-height: 38px; padding: 7px 8px; border: 1px solid var(--ppd-border); border-radius: 6px; font: inherit; font-size: 13px; }
.ppd-svg-colors { display: grid; gap: 8px; margin-bottom: 10px; }
.ppd-svg-colors label { display: grid; gap: 4px; color: #444; font-size: 11px; font-weight: 800; }
.ppd-svg-colors select,
.ppd-svg-colors input[type="color"] { width: 100%; min-height: 38px; border: 1px solid var(--ppd-border); border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.ppd-svg-colors input[type="color"] { padding: 3px; }
.ppd-svg-colors .ppd-svg-color-row { grid-template-columns: 28px minmax(0, 1fr) 64px; align-items: center; gap: 8px; }
.ppd-svg-color-chip { display: block; width: 26px; height: 26px; border: 1px solid rgba(0,0,0,.2); border-radius: 6px; background: linear-gradient(135deg, var(--ppd-original) 0 50%, var(--ppd-swatch) 50% 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.ppd-svg-color-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppd-color-grades { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.ppd-color-grades button { display: grid; gap: 5px; min-height: 64px; padding: 7px; border: 1px solid var(--ppd-border); border-radius: 7px; background: #fafafa; color: #222; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; text-align: center; }
.ppd-color-grades button.is-active { border-color: var(--ppd-green); background: #eef8f3; color: #16784b; }
.ppd-color-grade-swatch { display: block; height: 28px; border-radius: 5px; background: linear-gradient(135deg, #1c4d7a 0%, #f3c85b 42%, #d65353 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.ppd-ai-effects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: min(58vh, 430px); overflow-y: auto; padding: 1px 2px 2px 1px; }
.ppd-ai-section-title { display: block; margin: 2px 0 7px; font-size: 11px; }
.ppd-ai-history { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ppd-border); }
.ppd-ai-history__grid { display: grid; grid-auto-flow: column; grid-auto-columns: 82px; gap: 7px; overflow-x: auto; padding: 1px 1px 4px; }
.ppd-ai-history__loading { color: #6b7280; font-size: 10px; }
.ppd-ai-history__item { display: grid; gap: 4px; min-width: 0; padding: 5px; border: 1px solid var(--ppd-border); border-radius: 7px; background: #fafafa; color: #222; font: inherit; cursor: pointer; }
.ppd-ai-history__item:hover, .ppd-ai-history__item:focus-visible { border-color: var(--ppd-green); background: #eef8f3; color: #16784b; outline: 0; }
.ppd-ai-history__item img { display: block; width: 100%; aspect-ratio: 1; border-radius: 5px; object-fit: cover; background: #f1f1f1; }
.ppd-ai-history__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 750; }
.ppd-ai-effect-card { display: grid; align-content: start; gap: 5px; min-height: 118px; padding: 6px; border: 1px solid var(--ppd-border); border-radius: 8px; background: #fafafa; color: #222; font: inherit; line-height: 1.15; cursor: pointer; text-align: center; }
.ppd-ai-effect-card:hover, .ppd-ai-effect-card:focus-visible { border-color: var(--ppd-green); background: #eef8f3; color: #16784b; outline: 0; }
.ppd-ai-effect-card__label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.ppd-ai-effect-card__desc { display: block; color: #6b7280; font-size: 9px; font-weight: 650; line-height: 1.2; }
.ppd-ai-preview { display: block; height: 66px; overflow: hidden; border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.ppd-ai-preview svg { display: block; width: 100%; height: 100%; }
.ppd-ai-preview--photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ppd-ai-preview__bg { fill: #f6d0bd; }
.ppd-ai-preview__marks { display: none; fill: none; stroke: rgba(35,35,35,.2); stroke-width: 1.5; }
.ppd-ai-preview__marks circle { fill: rgba(35,35,35,.16); stroke: none; }
.ppd-ai-preview__brush { display: none; fill: none; stroke: rgba(255,255,255,.45); stroke-linecap: round; stroke-width: 7; }
.ppd-ai-preview__sticker-back { display: none; fill: none; stroke: #fff; stroke-linejoin: round; stroke-width: 9; }
.ppd-ai-preview__shoulders { fill: #566fb5; }
.ppd-ai-preview__neck { fill: #d98f6d; }
.ppd-ai-preview__face { fill: #eeb18d; }
.ppd-ai-preview__shadow { fill: rgba(188,108,79,.2); }
.ppd-ai-preview__hair { fill: #322623; }
.ppd-ai-preview__hair-detail,
.ppd-ai-preview__eye,
.ppd-ai-preview__nose,
.ppd-ai-preview__mouth,
.ppd-ai-preview__outline { fill: none; stroke: #2d2522; stroke-linecap: round; stroke-linejoin: round; }
.ppd-ai-preview__hair-detail { opacity: .22; stroke-width: 1.4; }
.ppd-ai-preview__eye { stroke-width: 2; }
.ppd-ai-preview__nose { opacity: .52; stroke-width: 1.3; }
.ppd-ai-preview__mouth { stroke-width: 1.8; }
.ppd-ai-preview__outline { display: none; stroke-width: 2.4; }
.ppd-ai-preview--cartoon .ppd-ai-preview__bg { fill: #d6f4ff; }
.ppd-ai-preview--cartoon .ppd-ai-preview__outline,
.ppd-ai-preview--comic .ppd-ai-preview__outline,
.ppd-ai-preview--pop_art .ppd-ai-preview__outline { display: block; }
.ppd-ai-preview--cartoon .ppd-ai-preview__shoulders { fill: #ffbf4d; }
.ppd-ai-preview--caricature .ppd-ai-preview__bg { fill: #ffe3a1; }
.ppd-ai-preview--caricature .ppd-ai-preview__face { transform: translateY(-2px) scale(1.04); transform-origin: 64px 42px; }
.ppd-ai-preview--comic .ppd-ai-preview__bg { fill: #f5cf44; }
.ppd-ai-preview--comic .ppd-ai-preview__marks { display: block; stroke: none; fill: rgba(0,0,0,.13); }
.ppd-ai-preview--comic .ppd-ai-preview__shoulders { fill: #d94853; }
.ppd-ai-preview--anime .ppd-ai-preview__bg { fill: #e8d8ff; }
.ppd-ai-preview--anime .ppd-ai-preview__eye { stroke-width: 3.5; }
.ppd-ai-preview--anime .ppd-ai-preview__face { fill: #f0bd9f; }
.ppd-ai-preview--watercolor .ppd-ai-preview__bg { fill: #e4f0e8; }
.ppd-ai-preview--watercolor .ppd-ai-preview__brush { display: block; stroke: rgba(226,119,120,.28); }
.ppd-ai-preview--watercolor .ppd-ai-preview__face,
.ppd-ai-preview--watercolor .ppd-ai-preview__hair,
.ppd-ai-preview--watercolor .ppd-ai-preview__shoulders { opacity: .76; }
.ppd-ai-preview--oil_painting .ppd-ai-preview__bg { fill: #33483f; }
.ppd-ai-preview--oil_painting .ppd-ai-preview__brush { display: block; stroke: rgba(245,202,132,.22); stroke-width: 6; }
.ppd-ai-preview--oil_painting .ppd-ai-preview__face { fill: #d69b76; }
.ppd-ai-preview--oil_painting .ppd-ai-preview__shoulders { fill: #8b5b42; }
.ppd-ai-preview--pencil_sketch .ppd-ai-preview__bg,
.ppd-ai-preview--line_art .ppd-ai-preview__bg { fill: #fbfaf5; }
.ppd-ai-preview--pencil_sketch .ppd-ai-preview__face,
.ppd-ai-preview--pencil_sketch .ppd-ai-preview__neck,
.ppd-ai-preview--pencil_sketch .ppd-ai-preview__shoulders,
.ppd-ai-preview--line_art .ppd-ai-preview__face,
.ppd-ai-preview--line_art .ppd-ai-preview__neck,
.ppd-ai-preview--line_art .ppd-ai-preview__shoulders { fill: transparent; }
.ppd-ai-preview--pencil_sketch .ppd-ai-preview__shadow,
.ppd-ai-preview--line_art .ppd-ai-preview__shadow { display: none; }
.ppd-ai-preview--pencil_sketch .ppd-ai-preview__outline,
.ppd-ai-preview--line_art .ppd-ai-preview__outline { display: block; stroke: #242424; }
.ppd-ai-preview--pencil_sketch .ppd-ai-preview__hair { fill: none; stroke: #363636; stroke-width: 2; }
.ppd-ai-preview--pencil_sketch .ppd-ai-preview__brush { display: block; stroke: rgba(0,0,0,.12); stroke-width: 2; }
.ppd-ai-preview--pop_art .ppd-ai-preview__bg { fill: #3ca6ff; }
.ppd-ai-preview--pop_art .ppd-ai-preview__marks { display: block; fill: rgba(255,239,55,.72); stroke: none; }
.ppd-ai-preview--pop_art .ppd-ai-preview__shoulders { fill: #ef426f; }
.ppd-ai-preview--toy_3d .ppd-ai-preview__bg { fill: #eaf8ff; }
.ppd-ai-preview--toy_3d .ppd-ai-preview__face,
.ppd-ai-preview--toy_3d .ppd-ai-preview__hair,
.ppd-ai-preview--toy_3d .ppd-ai-preview__shoulders { filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.ppd-ai-preview--sticker .ppd-ai-preview__bg { fill: #dfffd4; }
.ppd-ai-preview--sticker .ppd-ai-preview__sticker-back { display: block; }
.ppd-ai-preview--sticker .ppd-ai-preview__outline { display: block; stroke: #24302a; }
.ppd-ai-preview--line_art .ppd-ai-preview__hair { fill: transparent; stroke: #111; stroke-width: 2.6; }
.ppd-image-shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ppd-image-shapes button, .ppd-image-panel__button { min-height: 36px; padding: 7px; border: 1px solid var(--ppd-border); border-radius: 7px; background: #fafafa; color: #222; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.ppd-image-shapes button { display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 4px; }
.ppd-image-shapes button svg { width: 32px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ppd-image-shapes button.is-active { border-color: var(--ppd-green); background: #eef8f3; color: #16784b; }
.ppd-image-panel__note { margin: 7px 0 0; color: #666; font-size: 10px; line-height: 1.4; }
.ppd-text-toolbar {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: calc(100% - 16px);
    padding: 4px;
    overflow-x: auto;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(0,0,0,.2);
    transform: translate(-50%, -100%);
}
.ppd-text-toolbar[hidden], .ppd-text-panel[hidden], .ppd-inline-text-editor[hidden] { display: none !important; }
.ppd-text-toolbar button { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: #222; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ppd-text-toolbar button:hover, .ppd-text-toolbar button.is-active { background: #eef8f3; color: #16784b; }
.ppd-text-toolbar button svg { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ppd-text-toolbar button[data-ppd-text-align] { padding: 6px; }
.ppd-text-toolbar button[data-ppd-text-align] span { display: none; }
.ppd-text-panel { position: absolute; z-index: 6; width: min(290px, calc(100% - 20px)); padding: 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.22); transform: translateX(-50%); }
.ppd-fill-panel { position: absolute; z-index: 6; width: min(290px, calc(100% - 20px)); padding: 12px; border: 1px solid rgba(0,0,0,.14); border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.ppd-fill-panel__header { margin-bottom: 10px; }
.ppd-fill-panel__header strong { font-size: 13px; }
.ppd-design-layer__thumb.is-fill { border: 1px solid rgba(0, 0, 0, .12); }
.ppd-text-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ppd-text-panel__header strong { font-size: 13px; }
.ppd-text-panel__header button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: #f1f1f1; font-size: 20px; cursor: pointer; }
.ppd-text-panel select { width: 100%; min-height: 40px; }
.ppd-text-panel .ppd-image-panel__button { width: 100%; }
.ppd-text-color-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
/* Compact, fixed-size swatch. -webkit-appearance:none stops iOS Safari from
   rendering the picker as a huge black pill that swallows the Save button. */
.ppd-text-color-row input[type="color"] {
    flex: 0 0 auto;
    width: 52px;
    height: 44px;
    min-height: 0;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 8px;
    background: none;
    cursor: pointer;
}
.ppd-text-color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.ppd-text-color-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
.ppd-text-color-row input[type="color"]::-moz-color-swatch { border: none; border-radius: 7px; }
.ppd-text-color-row .ppd-image-panel__button { flex: 1 1 auto; width: auto; min-width: 120px; }
.ppd-text-swatches { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 12px; }
.ppd-text-swatch { -webkit-appearance: none; appearance: none; flex: 0 0 auto; display: block; width: 30px; height: 30px; padding: 0; border: 1px solid rgba(0,0,0,.22); border-radius: 6px; background: var(--ppd-swatch); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.ppd-text-swatch:hover, .ppd-text-swatch.is-active { border-color: var(--ppd-green); box-shadow: 0 0 0 2px rgba(53,183,119,.2), inset 0 0 0 1px rgba(255,255,255,.35); }
.ppd-text-direction { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ppd-text-direction button { display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 5px; min-height: 84px; padding: 10px; border: 1px solid var(--ppd-border); border-radius: 7px; background: #fafafa; color: #222; font: inherit; cursor: pointer; }
.ppd-text-direction button:hover, .ppd-text-direction button.is-active { border-color: var(--ppd-green); background: #eef8f3; color: #16784b; }
.ppd-text-direction span { font-size: 15px; font-weight: 850; line-height: 1.12; }
.ppd-text-direction small { color: #555; font-size: 10px; font-weight: 750; line-height: 1; }
.ppd-inline-text-editor { position: absolute; z-index: 7; min-width: 150px; min-height: 42px; padding: 5px 8px; overflow: hidden; border: 2px solid var(--ppd-green); border-radius: 5px; outline: 0; background: rgba(255,255,255,.94); color: #111; line-height: 1.15; text-align: center; resize: none; box-shadow: 0 3px 14px rgba(0,0,0,.16); transform: translate(-50%, -50%); }
.ppd-loading { position: absolute; z-index: 8; top: 14px; left: 50%; display: inline-flex; align-items: center; gap: 9px; width: max-content; max-width: min(420px, calc(100% - 24px)); min-height: 42px; padding: 8px 13px 8px 9px; border: 1px solid rgba(0,0,0,.12); border-radius: 999px; background: rgba(255,255,255,.94); color: #232323; font-size: 12px; font-weight: 800; line-height: 1.25; box-shadow: 0 8px 24px rgba(0,0,0,.18); pointer-events: none; transform: translateX(-50%); }
.ppd-loading[hidden] { display: none !important; }
.ppd-loading__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppd-loading__mark { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; overflow: hidden; border-radius: 8px; background: #eef8f3; color: #fff; font-size: 12px; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(53,183,119,.18); }
.ppd-loading__mark::before,
.ppd-loading__mark::after { content: ""; position: absolute; inset: 5px; background-image: var(--ppd-loader-icon); background-position: center; background-size: contain; background-repeat: no-repeat; }
.ppd-loading__mark::before { opacity: .22; filter: grayscale(1); }
.ppd-loading__mark::after { background: var(--ppd-green); -webkit-mask-image: var(--ppd-loader-icon); mask-image: var(--ppd-loader-icon); -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; animation: ppd-loader-fill 1.45s ease-in-out infinite; }
.ppd-loading__mark.is-fallback { background: var(--ppd-green); animation: ppd-loader-pulse 1.1s ease-in-out infinite; }
.ppd-loading__mark.is-fallback::before,
.ppd-loading__mark.is-fallback::after { display: none; }
.ppd-stage-wrap.is-loading canvas { filter: saturate(.92); }
@keyframes ppd-loader-fill {
    0% { clip-path: inset(100% 0 0 0); opacity: .65; }
    50% { clip-path: inset(0 0 0 0); opacity: 1; }
    100% { clip-path: inset(100% 0 0 0); opacity: .65; }
}
@keyframes ppd-loader-pulse {
    0%, 100% { transform: scale(.94); }
    50% { transform: scale(1); }
}
.ppd-workspace__hint { margin: 10px 2px 0; color: #666; font-size: 11px; line-height: 1.4; text-align: center; }

.ppd-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 20px; border: 1px solid #111; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; }
.ppd-button--secondary { background: #fff; color: #111; }
.ppd-button--primary { background: #111; color: #fff; }
.ppd-button svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ppd-button__logo { display: block; flex: 0 0 18px; width: 18px; height: 18px; object-fit: contain; filter: brightness(0) invert(1); }
.ppd-button:hover { opacity: .82; }

/* One line, left to right: the preview of what they made, what it was, and the
   way to the cart. Centred and wrapping put the confirmation over three lines
   on a phone and pushed the product itself off the top of the screen. */
.woocommerce-message:has(.ppd-cart-notice-content) {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* WooCommerce sets both of these as !important on its notices; without
       matching it the band keeps its default inset and a 2em gap underneath. */
    margin: 0 !important;
    padding: 12px 18px !important;
    border-radius: 0 !important;
    text-align: left;
}

.woocommerce-message:has(.ppd-cart-notice-content)::before { display: none; }

.ppd-cart-notice-content,
.ppd-cart-notice-copy {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    min-width: 0;
}

.ppd-cart-notice-content { width: 100%; }

/* The copy is the only part that gives ground, so a long product name
   truncates rather than folding the row. */
.ppd-cart-notice-copy { flex: 1 1 auto; }

.ppd-cart-notice-thumbnail {
    flex: 0 0 40px;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    border: 1px solid #dce8df;
    border-radius: 6px;
    background: #fff;
    object-fit: contain;
}

/* Matches the theme's plain add-to-cart notice: black, and smaller than a page
   button, because this strip confirms something rather than asking for it. */
.ppd-cart-notice-copy .button,
.ppd-cart-notice-copy .button:hover {
    order: initial !important;
    flex: 0 0 auto;
    min-width: 0;
    margin: 0 0 0 auto !important;
    padding: 7px 14px !important;
    border-radius: 6px !important;
    background: #111 !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    float: none !important;
    white-space: nowrap;
}

.ppd-cart-notice-copy .button:hover { opacity: .85; }

/* Wide screens centre the group instead of stretching it across the band; see
   the same rule on .pp-cart-notice in the theme. */
@media (min-width: 641px) {
    .woocommerce-message:has(.ppd-cart-notice-content) { justify-content: center; }
    .ppd-cart-notice-content { width: auto; max-width: 100%; }
    .ppd-cart-notice-copy { flex: 0 1 auto; }
    .ppd-cart-notice-copy .button { margin-left: 0 !important; }
}

.woocommerce-product-gallery.ppd-gallery-has-previews,
.product .images.ppd-gallery-has-previews {
    position: relative;
}

.ppd-gallery-preview-host {
    position: relative;
}

.ppd-gallery-preview-nav {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    transform: translateX(-50%);
}

.ppd-gallery-preview-tab {
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background: #fff;
    color: #222;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.ppd-gallery-preview-tab:hover { border-color: #111; }
.ppd-gallery-preview-tab.is-active { border-color: #111; background: #111; color: #fff; }

.ppd-gallery-preview-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #d8d8d8;
    border-radius: 999px;
    background: #fff;
    color: #111;
    cursor: pointer;
}

.ppd-gallery-preview-button:hover {
    border-color: var(--ppd-green);
    color: #16784b;
}

.ppd-gallery-preview-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ppd-gallery-preview-count {
    min-width: 88px;
    max-width: 180px;
    color: #333;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .woocommerce-message:has(.ppd-cart-notice-content) { padding: 10px 12px !important; }
    .ppd-cart-notice-content { gap: 9px; }
    .ppd-cart-notice-copy { gap: 9px; }
    .ppd-cart-notice-thumbnail { flex-basis: 34px; width: 34px !important; height: 34px !important; }
    .ppd-gallery-preview-nav { bottom: 10px; }
    .ppd-gallery-preview-button { width: 40px; height: 40px; }
    .ppd-gallery-preview-count { max-width: 120px; }
}

@media (max-width: 820px) {
    .ppd-modal { padding: 0; }
    .ppd-modal__dialog { width: 100%; height: 100dvh; border-radius: 0; }
    .ppd-modal__body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
    .ppd-tools { order: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 0; max-height: 176px; padding: 8px 10px 10px; border-top: 1px solid var(--ppd-border); border-right: 0; border-bottom: 0; overflow: hidden; }
    .ppd-tools > .ppd-tool-button { display: flex; }
    .ppd-workspace-tools { display: none; }
    .ppd-tool-button { min-height: 40px; padding: 8px 10px; font-size: 12px; }
    .ppd-tool-button--text { order: 2; }
    .ppd-tool-button--upload { order: 3; }
    .ppd-product-switcher { display: none; }
    .ppd-layers-drawer-backdrop {
        position: fixed;
        z-index: 18;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        /* Keep the canvas fully visible; this transparent click target only
           closes the flyout when the customer taps outside it. */
        background: transparent;
    }
    .ppd-layers-drawer-backdrop[hidden] { display: none; }
    .ppd-layers-panel {
        position: fixed;
        z-index: 19;
        top: auto;
        bottom: 72px;
        left: 10px;
        display: flex;
        flex-direction: column;
        width: min(72vw, 280px);
        max-height: min(54dvh, 440px);
        min-height: 0;
        margin: 0;
        padding: 10px;
        border: 1px solid rgba(0, 0, 0, .14);
        border-radius: 12px;
        box-sizing: border-box;
        box-shadow: 0 10px 32px rgba(0, 0, 0, .24);
        visibility: hidden;
        transform: translate(-12px, 10px) scale(.97);
        transform-origin: bottom left;
        opacity: 0;
        transition: transform .22s ease, opacity .18s ease, visibility 0s linear .22s;
        pointer-events: none;
    }
    .ppd-layers-panel.is-mobile-open {
        visibility: visible;
        transform: translate(0, 0) scale(1);
        opacity: 1;
        transition-delay: 0s;
        pointer-events: auto;
    }
    .ppd-layers-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
    .ppd-layers-panel__header .ppd-assets-panel__heading { display: block; margin: 0; color: #111; font-size: 13px; }
    .ppd-layers-panel__close {
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #f1f1f1;
        color: #111;
        cursor: pointer;
    }
    .ppd-layers-panel__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
    .ppd-layers-panel .ppd-design-layers {
        flex: 1 1 auto;
        max-height: calc(min(54dvh, 440px) - 58px);
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }
    .ppd-assets-panel { order: 1; display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(112px, 148px); align-items: stretch; gap: 8px; width: 100%; margin: 0 !important; padding: 0; overflow: hidden; }
    .ppd-assets-panel__heading { display: none; }
    .ppd-assets { order: 1; display: flex; gap: 7px; min-width: 0; overflow-x: auto; padding-bottom: 1px; scrollbar-width: thin; }
    .ppd-asset { flex: 0 0 54px; width: 54px; height: 54px; aspect-ratio: 1; }
    .ppd-asset-category { order: 2; align-self: stretch; width: 100%; min-height: 54px; margin: 0; padding: 7px 26px 7px 9px; font-size: 11px; }
    .ppd-workspace { order: 1; padding: 10px; min-height: 0; }
    .ppd-workspace-top { justify-content: space-between; min-height: 38px; padding-bottom: 8px; }
    /* Slimmer view capsules on mobile so the row isn't so tight. */
    .ppd-view-tab { gap: 4px; padding: 6px 9px; font-size: 11px; }
    .ppd-view-tab__mask, .ppd-view-tab__mask svg { width: 18px; height: 13px; }
    /* Move Reset out of the footer to sit left of the Views on mobile. */
    .ppd-modal__footer .ppd-button--secondary { display: none; }
    .ppd-mobile-reset {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        flex: 0 0 auto;
        min-height: 38px;
        padding: 7px 9px;
        border: 1px solid var(--ppd-border);
        border-radius: 8px;
        background: #fff;
        color: #111;
        font: inherit;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
    }
    .ppd-mobile-reset svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .ppd-mobile-reset:hover { border-color: #111; }
    .ppd-modal__header { padding: 11px 14px; }
    .ppd-modal__footer { gap: 8px; padding: 10px 12px; }
    .ppd-mobile-layers-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        min-width: 0;
        padding: 9px 12px;
        background: #fff;
        color: #111;
        font-weight: 600;
    }
    .ppd-modal__footer .ppd-button--primary { flex: 1 1 auto; min-width: 0; }
    .ppd-modal__header h2 { font-size: 17px; }
    .ppd-workspace__hint { display: none; }
    .ppd-image-toolbar { max-width: calc(100% - 16px); overflow-x: auto; overscroll-behavior-x: contain; }
    .ppd-image-toolbar button { min-height: 40px; padding: 8px 9px; font-size: 11px; }
    .ppd-image-toolbar button svg { flex-basis: 19px; width: 19px; height: 19px; }
}

/* ── Inline "Personalize" panel on the product page ─────────────────── */
/* The hint callout overlaps the separator between variations and inline fields. */
.ppd-inline-personalize {
    position: relative;
    margin: 18px 0 10px;
    padding: 38px 0 0;
    border-top: 1px solid #e5e5e5;
}
.ppd-inline-callout {
    position: absolute;
    top: 0;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 9px;
    width: calc(100% - 32px);
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    color: #222;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .10);
}
.ppd-inline-callout::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #fff;
}
.ppd-inline-callout__icon { flex: 0 0 auto; width: 18px; height: 18px; color: #35b777; }
.ppd-inline-personalize__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    margin-bottom: 2px;
}
@media (max-width: 560px) {
    /* Keep fields (incl. two image uploads) side by side on mobile. */
    .ppd-inline-personalize__fields { gap: 6px 10px; }
}
.ppd-inline-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
/* Grouped layout: the outer grid gives way to stacked sections, and each
   section keeps the two-column grid the fields were laid out in. */
.ppd-inline-personalize__fields.is-grouped {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ppd-inline-group__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
}
@media (max-width: 560px) {
    .ppd-inline-group__fields { gap: 6px 10px; }
}
/* Image and colour are one pair: the colour field follows the image in the
   second column instead of opening a full-width row underneath it. */
.ppd-inline-field--color { grid-column: auto; }

.ppd-fill-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.ppd-fill-control__menu { position: relative; display: block!important; flex: 0 1 150px; width: min(100%, 150px); min-width: 118px; margin: 0!important; padding: 0!important; border: 0!important; border-radius: 0!important; outline: 0!important; background: transparent!important; box-shadow: none!important; }
.ppd-fill-control__menu summary {
    display: flex!important;
    align-items: center;
    flex-wrap: nowrap!important;
    gap: 7px;
    width: 100%;
    height: 40px;
    min-height: 40px;
    overflow: hidden;
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    list-style: none;
    box-sizing: border-box;
    box-shadow: none!important;
}
.ppd-fill-control__menu summary::-webkit-details-marker { display: none; }
.ppd-fill-control__menu summary > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ppd-fill-control__menu summary [data-ppd-fill-current] { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap!important; }
.ppd-fill-control__menu .ppd-fill-control__chevron { flex: 0 0 17px; width: 17px; height: 17px; margin-left: auto; transition: transform .16s ease; }
.ppd-fill-control__menu[open] .ppd-fill-control__chevron { transform: rotate(180deg); }
.ppd-fill-control__choices {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 6px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
.ppd-fill-control__choices button { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: #222; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; text-align: left; }
.ppd-fill-control__choices button:hover,.ppd-fill-control__choices button[aria-pressed="true"] { background: #eef8f3; color: #16784b; }
.ppd-fill-mode-sample { display: block; flex: 0 0 18px; width: 18px; height: 18px; border: 1px solid rgba(0,0,0,.14); border-radius: 5px; background: #229765; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.ppd-fill-mode-sample.is-gradient { background: linear-gradient(135deg,#229765 0 48%,#a8e8cc 52% 100%); }
.ppd-fill-control__swatch { display: block; flex: 0 0 40px; width: 40px; height: 40px; }
.ppd-fill-control__swatch[hidden] { display: none!important; }
.ppd-fill-control__swatch input[type="color"] {
    width: 40px;
    height: 40px;
    min-height: 0;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 10px;
    background: none;
    cursor: pointer;
}
.ppd-fill-control__swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.ppd-fill-control__swatch input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.ppd-fill-control__swatch input[type="color"]::-moz-color-swatch { border: 0; border-radius: 7px; }
.ppd-inline-field.is-busy .ppd-inline-upload__btn,
.ppd-inline-field.is-busy .ppd-inline-upload__remove { opacity: .55; pointer-events: none; }
.ppd-inline-field__label {
    font-size: 12px;
    font-weight: 600;
    color: #222;
}
.ppd-inline-text {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    font-size: 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}
.ppd-inline-text:focus { outline: none; border-color: #111; }
.ppwoo-booth-designer .ppd-fill-control__menu summary { height: 68px!important; min-height: 68px!important; border-radius: 14px; padding: 13px 16px; font-size: 18px; }
.ppd-inline-upload {
    display: grid;
    grid-template-columns: 36px max-content max-content;
    align-items: center;
    gap: 5px 8px;
    max-width: 100%;
}
.ppd-inline-upload__thumb {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
}
.ppd-inline-upload__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ppd-inline-upload__thumb.is-empty {
    background:
        linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%) 0 0/12px 12px,
        linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%) 6px 6px/12px 12px;
}

/* The blank product sitting in an empty slot. `multiply` keeps the checkerboard
   readable through the base's white ground, so the slot still says "nothing here
   yet" while showing what the photo is going onto. `isolate` confines the blend
   to this box - without it the blend reaches the panel behind and the thumbnail
   turns muddy. `contain`, not `cover`: the silhouette is the whole point. */
.ppd-inline-upload__thumb.has-base {
    position: relative;
    isolation: isolate;
}

.ppd-inline-upload__base {
    /* Taken out of the grid rather than centred by it. The thumb is
       `place-items: center`, which sizes a grid item to its own content, so a
       percentage width on a large base PNG has no definite box to resolve
       against and falls back to the intrinsic size - the image then overflows
       and `overflow: hidden` crops it off-centre. Absolute against the padding
       box gives it a definite 36x36 to fill, and object-fit centres inside
       that. */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    mix-blend-mode: multiply;
}

/* A sheen crossing the blank, to read as "waiting for your photo". It pauses
   between passes rather than sweeping continuously, which at this size is the
   difference between an invitation and a loading spinner. */
.ppd-inline-upload__thumb.has-base::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.9) 50%, transparent 58%);
    transform: translateX(-130%);
    animation: ppd-inline-sheen 3.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ppd-inline-sheen {
    0%, 55% { transform: translateX(-130%); }
    100%    { transform: translateX(130%); }
}

@media (prefers-reduced-motion: reduce) {
    .ppd-inline-upload__thumb.has-base::after { animation: none; opacity: 0; }
}
.ppd-inline-upload__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid #111;
    border-radius: 8px;
    background: #fff;
    color: #111;
    cursor: pointer;
}
.ppd-inline-upload__btn:hover { background: #111; color: #fff; }
.ppd-inline-upload__status { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-self: start; gap: 6px; min-height: 30px; padding: 4px 8px 4px 5px; border: 1px solid rgba(53,183,119,.22); border-radius: 999px; background: #eef8f3; color: #16784b; font-size: 11px; font-weight: 800; line-height: 1.2; }
.ppd-inline-upload__status[hidden] { display: none !important; }
.ppd-inline-upload__status .ppd-loading__mark { width: 20px; height: 20px; border-radius: 6px; }
.ppd-inline-upload__status .ppd-loading__mark::before,
.ppd-inline-upload__status .ppd-loading__mark::after { inset: 4px; }
.ppd-inline-upload__status .ppd-loading__text { max-width: 130px; }
.ppd-inline-upload__remove {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: start;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    border: none;
    background: transparent;
    color: #b32d2e;
    cursor: pointer;
    text-decoration: underline;
}
@media (max-width: 380px) {
    .ppd-inline-upload {
        grid-template-columns: 36px max-content max-content;
        column-gap: 6px;
    }

    .ppd-inline-upload__btn {
        padding-inline: 8px;
        font-size: 11px;
    }

    .ppd-inline-upload__remove {
        padding-inline: 4px;
    }
}
.ppd-inline-personalize__note {
    margin: 12px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #999;
}

/* ── Live preview canvas in the product gallery ─────────────────────── */
.ppd-live-stage {
    display: none;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.ppd-live-canvas {
    display: block;
    width: 100%;
    height: auto;   /* box follows the canvas's own (design) aspect ratio → no reflow */
}
/* When the live design is showing, reveal our canvas and hide the native
 * slider/photos so there is no tall-image gap or duplicate image. */
.woocommerce-product-gallery.ppd-live-active > .ppd-live-stage,
.product .images.ppd-live-active > .ppd-live-stage { display: block; }
.woocommerce-product-gallery.ppd-live-active .flex-viewport,
.woocommerce-product-gallery.ppd-live-active > .woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery.ppd-live-active .flex-control-thumbs,
.woocommerce-product-gallery.ppd-live-active .ppd-gallery-preview-nav,
.product .images.ppd-live-active > .woocommerce-product-gallery__wrapper { display: none !important; }

/* View toggle under the live preview (multi-view designs) */
.ppd-live-views {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 12px 0 4px;
}
.ppd-live-view {
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.ppd-live-view:hover { border-color: #111; }
.ppd-live-view.is-active { background: #111; color: #fff; border-color: #111; }

/* Font picker dropdown */
.ppd-font-select { width: 100%; padding: 9px 10px; font-size: 15px; border: 1px solid #d9d9d9; border-radius: 8px; background: #fff; }
.ppd-font-select optgroup { font-weight: 700; }

/* ── Variation gate (variable products) ─────────────────────────────── */
/* A small white bubble floated over the variation the customer must pick.
   Positioned by JS (position: fixed) and non-blocking so the select stays
   clickable underneath. */
/* Reserved divider above variations, after the size guide. */
.ppd-variation-callout-rail {
    position: relative;
    display: block;
    width: 100%;
    height: 20px;
    margin: 0 0 4px;
}
.ppd-variation-callout-rail::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    border-top: 1px solid #e5e5e5;
}
.ppd-variation-callout {
    position: fixed;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 260px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #222;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .16), 0 1px 3px rgba(0, 0, 0, .1);
    pointer-events: none;
}
.ppd-variation-callout::after {
    content: "";
    position: absolute;
    left: var(--ppd-callout-arrow, 50%);
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}
/* Default: bubble sits above the control, arrow points down. */
.ppd-variation-callout::after { bottom: -7px; border-top: 8px solid #fff; }
/* Fallback (no room above): bubble sits below, arrow points up. */
.ppd-variation-callout.ppd-variation-callout--below::after {
    bottom: auto;
    top: -7px;
    border-top: 0;
    border-bottom: 8px solid #fff;
}
.ppd-variation-callout.ppd-variation-callout--rail::after {
    bottom: -7px;
    top: auto;
    border-top: 8px solid #fff;
    border-bottom: 0;
}
.ppd-variation-callout__icon { flex: 0 0 auto; width: 20px; height: 20px; color: #35b777; }
.ppd-variation-callout.is-pulse { animation: ppd-callout-pulse .9s ease; }
@keyframes ppd-callout-pulse {
    0%, 100% { transform: translateY(0); }
    30%      { transform: translateY(-4px); }
}
.ppd-inline-personalize.is-locked {
    opacity: .45;
    pointer-events: none;
    filter: grayscale(.35);
}
.ppd-open-designer.is-locked,
.ppd-open-designer:disabled {
    opacity: .45 !important;
    cursor: not-allowed !important;
}
.ppd-open-designer.ppd-open-uploading {
    filter: grayscale(.3);
    pointer-events: none;
}
.single_add_to_cart_button.ppd-cart-disabled,
button[type="submit"].ppd-cart-disabled,
input[type="submit"].ppd-cart-disabled {
    opacity: .48 !important;
    cursor: not-allowed !important;
    filter: grayscale(.25);
}

/* The hidden attribute must win over the display:flex base rules above. */
.ppd-variation-callout[hidden],
.ppd-inline-callout[hidden],
.ppd-live-views[hidden] { display: none !important; }

/* Deter saving/reusing the design + product images (drag & long-press). */
.woocommerce-product-gallery img,
.woocommerce-product-gallery canvas,
.ppd-live-canvas,
.ppd-modal canvas,
[data-ppd-editor] canvas {
    -webkit-user-drag: none;
    -moz-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
}

/* Collapse long personalize forms behind a "Show more" toggle (>4 fields).
   Which fields those are is marked in JS: once the fields are gathered into
   groups they are no longer siblings, so counting children here would hide the
   wrong ones. */
.ppd-inline-personalize.is-collapsible.is-collapsed .ppd-inline-field[data-ppd-inline-overflow] {
    display: none;
}
/* A group with nothing left showing takes its heading with it. */
.ppd-inline-personalize.is-collapsible.is-collapsed .ppd-inline-group:not(:has(.ppd-inline-field:not([data-ppd-inline-overflow]))) {
    display: none;
}
.ppd-inline-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s;
}
.ppd-inline-more:hover { border-color: #111; }
.ppd-gift-design {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 9px;
}

.ppd-gift-design__button {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #111;
    border-radius: 5px;
    background: #fff;
    color: #111;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.ppd-gift-design__button:hover,
.ppd-gift-design__button:focus {
    background: #111;
    color: #fff;
}

/* Reopens the gift in the designer. An anchor, not a button, so it keeps
   middle-click and "open in new tab" - but it has to be dressed as the solid
   partner to the outlined upload button beside it. */
.ppd-gift-design__edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #111;
    border-radius: 5px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.ppd-gift-design__edit:hover,
.ppd-gift-design__edit:focus {
    background: #fff;
    color: #111;
    text-decoration: none;
}

.ppd-gift-design__status {
    color: #555;
    font-size: 11px;
}

.ppd-gift-design__status.is-success { color: #147a4b; }
.ppd-gift-design__status.is-error { color: #b42318; }

/* Shown on the gift product's own page when it was opened to be edited. The
   Add to cart button says "Save gift design" there, and this explains why. */
.ppd-gift-edit-note {
    box-sizing: border-box;
    margin: 0 0 12px;
    padding: 10px 13px;
    border: 1px solid #d8e6dd;
    border-radius: 8px;
    background: #f2f8f4;
    color: #14532d;
    font-size: 13px;
    line-height: 1.5;
}

/* The cart form is a flex row - quantity beside Add to cart - so a plain
   paragraph dropped into it shrinks to a narrow column beside them. Claim the
   whole row, exactly as .ppd-editor-shell above has to. */
.single-product form.cart .ppd-gift-edit-note,
.single-product .woocommerce-variation-add-to-cart .ppd-gift-edit-note {
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
    grid-column: 1 / -1;
}

/* Once there is a design on it, the gallery preview takes the same drag,
   resize and rotate gestures as the editor. */
.ppd-live-active .ppd-live-canvas {
    cursor: grab;
    touch-action: none;
}

.ppd-live-active .ppd-live-canvas:active {
    cursor: grabbing;
}
