/* TS Printify - Stili frontend personalizzatore */
#pp-popup-overlay { box-sizing: border-box; overflow-anchor: none; }
#pp-popup-inner-scroll { overflow-anchor: none; }
#pp-popup-container { padding-bottom: 24px; }
#pp-popup-overlay * { box-sizing: border-box; }
#pp-close:hover { opacity: 0.8; }

.pp-variant-thumb {
    flex-shrink: 0;
    background: #f5f5f5;
}

.pp-popup-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    z-index: 50;
}

.pp-popup-loader.is-visible {
    display: flex;
}

.pp-popup-loader-inner {
    text-align: center;
    color: #34451c;
    font-weight: 600;
}

.pp-popup-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    border: 4px solid #dbe7bf;
    border-top-color: #97b04e;
    animation: ppSpin 0.8s linear infinite;
}

@keyframes ppSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Barra sticky nascosta: totale e pulsanti solo nel riepilogo */
#pp-sticky-price-bar {
    display: none !important;
}
.pp-sticky-price-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 96%;
    max-width: 1500px;
    z-index: 10000;
    margin: 0;
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
    border: 1px solid #cfe2ab;
    border-bottom: none;
    background: rgba(233, 244, 217, 0.98);
    box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pp-sticky-price-label {
    font-size: 12px;
    font-weight: 700;
    color: #486122;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.pp-sticky-price-sub {
    font-size: 12px;
    color: #4f5f33;
}

.pp-sticky-price-main {
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    color: #245d11;
    white-space: nowrap;
}

.pp-sticky-actions-slot {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#pp-sticky-actions-slot .pp-sticky-actions {
    position: static !important;
    bottom: auto !important;
    z-index: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex !important;
    gap: 8px !important;
}

#pp-sticky-actions-slot .pp-cta-btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 14px;
}

#pp-indietro { display: none !important; }
#pp-indietro.is-visible { display: inline-block !important; }

/* Pulsanti nel riepilogo (Prosegui, Indietro) */
.pp-recap-buttons .pp-cta-btn {
    pointer-events: auto;
    cursor: pointer;
}

/* Riepilogo stile immagine preventivo */
.pp-recap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pp-recap-line:last-child { border-bottom: none !important; }

/* Quando "Carico i file successivamente" è attivo: nascondi solo elementi upload */
#pp-step-upload.pp-files-later-active .pp-zone-placeholder,
#pp-step-upload.pp-files-later-active .pp-upload-loader {
    display: none !important;
}
#pp-step-upload.pp-files-later-active .pp-upload-file {
    pointer-events: none;
    opacity: 0;
}
#pp-step-upload.pp-files-later-active .pp-upload-block,
#pp-step-upload.pp-files-later-active .pp-ref-distances,
#pp-step-upload.pp-files-later-active .pp-serigrafia-opzioni {
    display: none !important;
}
#pp-step-upload.pp-files-later-active .pp-card-two-cols {
    grid-template-columns: minmax(0, 1fr) 170px !important;
    gap: 10px !important;
}
#pp-step-upload.pp-files-later-active .pp-card-col-rect .pp-template-wrap {
    max-width: 170px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 6px !important;
}
#pp-step-upload.pp-files-later-active .pp-print-area {
    border-width: 1px !important;
}
#pp-step-upload.pp-files-later-active .pp-size-guide {
    border-width: 1px !important;
}

/* Quadrati anteprima varianti colore sopra template */
.pp-template-variant-previews {
    min-height: 64px;
}
.pp-variant-preview-square {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
}
.pp-variant-preview-square:hover {
    border-color: #97B04E !important;
    box-shadow: 0 2px 10px rgba(151,176,78,0.4);
}
.pp-variant-preview-graphic {
    /* Mostra la grafica così com'è, senza moltiplicare col colore di sfondo */
    mix-blend-mode: normal;
    z-index: 1;
}

/* Popup anteprima variante colore: grafica sopra, sfondo sotto */
.pp-variant-preview-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.pp-variant-preview-graphic-overlay {
    position: absolute;
    inset: 8px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    mix-blend-mode: normal !important;
    z-index: 1;
}

/* Popup upload grafica */
#pp-graphic-upload-modal .pp-logo-lib-filter {
    border: 1px solid #d4dfbf;
    background: #fff;
    color: #486122;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
#pp-graphic-upload-modal .pp-logo-lib-filter.is-active {
    border-color: #97B04E;
    background: #edf5dc;
    color: #2f4a15;
    font-weight: 700;
}
#pp-graphic-upload-modal .pp-logo-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-height: 56vh;
    overflow: auto;
    padding-right: 3px;
}
#pp-graphic-upload-modal .pp-logo-lib-item {
    border: 1px solid #e2e2e2;
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
#pp-graphic-upload-modal .pp-logo-lib-item:hover {
    border-color: #97B04E;
    box-shadow: 0 4px 10px rgba(151,176,78,.22);
    transform: translateY(-1px);
}
#pp-graphic-upload-modal .pp-logo-lib-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 6px;
}
#pp-graphic-upload-modal .pp-logo-lib-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
#pp-graphic-upload-modal .pp-logo-lib-title {
    display: block;
    font-size: 12px;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Popup veloce: scegli tecnica prima del caricamento grafica */
#pp-ts-technique-toast {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10080;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}
#pp-ts-technique-toast.pp-ts-technique-toast--open {
    display: flex;
}
#pp-ts-technique-toast .pp-ts-technique-toast-inner {
    max-width: 420px;
    width: 100%;
    padding: 20px 22px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    border: 1px solid #dfe8cc;
}
#pp-ts-technique-toast .pp-ts-technique-toast-inner h4 {
    margin: 0 0 10px 0;
    font-size: 17px;
    color: #2f4a15;
}
#pp-ts-technique-toast .pp-ts-technique-toast-inner p {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.45;
    color: #444;
}
#pp-ts-technique-toast .pp-ts-technique-toast-ok {
    display: inline-block;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: #97b04e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

/* Distanze collo / ascella sotto il mockup (template classico, non manica) */
#pp-step-upload .pp-ref-distances-below .pp-dist-neck,
#pp-step-upload .pp-ref-distances-below .pp-dist-armpit {
    font-weight: 700;
    color: #2f4a15;
}

/* Upload grafiche - posizionamento zona e wrapper per autoscale affidabile */
#pp-step-upload .pp-print-area {
    box-sizing: border-box;
}

#pp-step-upload .pp-print-area--circle {
    border-radius: 50%;
    overflow: hidden;
}
/* Spostamento grafica: cursore mano anche al centro del rettangolo rosso */
#pp-step-upload .pp-size-guide,
#pp-step-upload .pp-size-guide *:not(.pp-resize-handle) {
    cursor: move;
}
#pp-step-upload .pp-graphic-wrapper {
    position: absolute !important;
    box-sizing: border-box;
}
#pp-step-upload .pp-upload-overlay {
    display: none !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
}
#pp-step-upload .pp-upload-overlay.is-visible .pp-uploaded-wrap {
    pointer-events: auto !important;
}
#pp-step-upload .pp-upload-overlay.is-visible {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#pp-step-upload .pp-upload-overlay.is-visible .pp-uploaded-wrap {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#pp-step-upload .pp-upload-overlay.is-visible .pp-uploaded-preview[src] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#pp-step-upload .pp-uploaded-preview {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    display: block;
}
#pp-step-upload .pp-print-area-upload .pp-uploaded-preview[src] {
    display: block !important;
}

/* Loader durante caricamento grafica */
.pp-upload-loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(151, 176, 78, 0.2);
    border-top-color: #97B04E;
    border-radius: 50%;
    animation: pp-upload-spin 0.8s linear infinite;
}
@keyframes pp-upload-spin {
    to { transform: rotate(360deg); }
}

/* Controlli grafica nello step upload - stile screenshot */
#pp-step-upload .pp-graphic-wrapper {
    border-radius: 4px;
}
#pp-step-upload .pp-graphic-wrapper:active {
    cursor: grabbing;
}
#pp-step-upload .pp-graphic-btn,
#pp-step-upload .pp-graphic-rotate {
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
#pp-step-upload .pp-graphic-btn:hover,
#pp-step-upload .pp-graphic-rotate:hover {
    background: #f5f5f5;
}
/* Maniglie resize sul size guide (rettangolo rosso) */
#pp-step-upload .pp-size-guide .pp-resize-handle {
    display: block !important;
    position: absolute;
    width: 10px;
    height: 10px;
    background: #97B04E;
    border: 2px solid #fff;
    border-radius: 2px;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
#pp-step-upload .pp-size-guide .pp-handle-n { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
#pp-step-upload .pp-size-guide .pp-handle-s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
#pp-step-upload .pp-size-guide .pp-handle-e { right: -5px; top: 50%; transform: translateY(-50%); cursor: e-resize; }
#pp-step-upload .pp-size-guide .pp-handle-w { left: -5px; top: 50%; transform: translateY(-50%); cursor: w-resize; }
#pp-step-upload .pp-size-guide .pp-handle-ne { top: -5px; right: -5px; cursor: ne-resize; }
#pp-step-upload .pp-size-guide .pp-handle-nw { top: -5px; left: -5px; cursor: nw-resize; }
#pp-step-upload .pp-size-guide .pp-handle-se { bottom: -5px; right: -5px; cursor: se-resize; }
#pp-step-upload .pp-size-guide .pp-handle-sw { bottom: -5px; left: -5px; cursor: sw-resize; }

/* Dopo il posizionamento nascondi il box rosso finché non riclicchi la grafica */
#pp-step-upload .pp-size-guide.pp-guide-dormant {
    border-color: transparent !important;
    background: transparent !important;
}
#pp-step-upload .pp-size-guide.pp-guide-dormant .pp-resize-handle {
    display: none !important;
}

/* Maniglie resize visibili solo quando c'è una grafica caricata (.has-graphic sul wrapper) */
#pp-step-upload .pp-graphic-wrapper .pp-resize-handle {
    display: none !important;
}
#pp-step-upload .pp-graphic-wrapper.has-graphic .pp-resize-handle {
    display: block !important;
    position: absolute;
    width: 12px;
    height: 12px;
    background: #97B04E;
    border: 2px solid #fff;
    border-radius: 2px;
    z-index: 6;
}
#pp-step-upload .pp-resize-handle.pp-resize-tl { top: -6px; left: -6px; cursor: nwse-resize; }
#pp-step-upload .pp-resize-handle.pp-resize-tr { top: -6px; right: -6px; cursor: nesw-resize; }
#pp-step-upload .pp-resize-handle.pp-resize-bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
#pp-step-upload .pp-resize-handle.pp-resize-br { bottom: -6px; right: -6px; cursor: nwse-resize; }
#pp-step-upload .pp-graphic-inner {
    padding: 8px;
}

/* WoodMart discount table - layout orizzontale come tabella */
.wd-dynamic-discounts .wd-dd-table-horizontal {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #333;
}
.wd-dynamic-discounts .wd-dd-table-horizontal th,
.wd-dynamic-discounts .wd-dd-table-horizontal td {
    padding: 8px 12px;
    border: 1px solid #333;
    text-align: center;
}
.wd-dynamic-discounts .wd-dd-table-horizontal .wd-dd-label {
    background-color: #e8e8e8;
    font-weight: 600;
    text-align: left;
    min-width: 120px;
}
.wd-dynamic-discounts .wd-dd-table-horizontal thead th {
    background-color: #e8e8e8;
}
.wd-dynamic-discounts .wd-dd-table-horizontal th.wd-dd-tier {
    cursor: pointer;
    min-width: 44px;
    transition: background-color 0.2s ease;
}
.wd-dynamic-discounts .wd-dd-table-horizontal th.wd-dd-tier:hover,
.wd-dynamic-discounts .wd-dd-table-horizontal th.wd-dd-tier.wd-active {
    background-color: rgba(151, 176, 78, 0.25);
}

/* Nascondi selettori Woo standard (colore/taglia/qty/add-to-cart) nella pagina prodotto */
.single-product .variations tr:has(label[for*="pa_colore"]),
.single-product .variations tr:has(.value select[id*="pa_colore"]),
.single-product .variations tr:has(label[for*="pa_taglia"]),
.single-product .variations tr:has(.value select[id*="pa_taglia"]) {
    display: none !important;
}
.single-product .summary .quantity,
.single-product .summary .single_variation_wrap .quantity,
.single-product form.cart .quantity,
.single-product form.cart .qty,
.single-product form.cart input.qty {
    display: none !important;
}
.single-product form.cart .single_add_to_cart_button,
.single-product .summary .single_add_to_cart_button,
.single-product .summary button[name="add-to-cart"],
.single-product .summary .woocommerce-variation-add-to-cart {
    display: none !important;
}

/* Disattiva pagamenti rapidi in pagina prodotto */
.single-product .wcpay-payment-request-wrapper,
.single-product .woocommerce-payments-payment-request-button,
.single-product .gpay-button,
.single-product .gpay-button.black.plain.short.it.border-inset.gpay-button-size-match-height,
.single-product .wc-stripe-product-checkout-container,
.single-product .paypal-buttons,
.single-product .ppc-button-wrapper,
.single-product #ppc-button,
.single-product .xoo-wsc-buy-now,
.single-product .wd-buy-now-btn,
.single-product .single-product-payments {
    display: none !important;
    pointer-events: none !important;
}

/* Box fasce + CTA prodotto */
.pp-tier-box {
    margin: 6px 0 14px 0;
    padding: 14px;
    border: 1px solid #e3e7ef;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 6px 18px rgba(24, 55, 91, 0.08);
}
.pp-tier-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
    align-items: stretch;
}
.wd-tier-buttons .wd-tier-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-height: 76px;
    height: 100%;
    padding: 11px 12px;
    border: 1px solid #d6deea;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: all .18s ease;
    box-shadow: 0 2px 6px rgba(15, 36, 65, 0.04);
    box-sizing: border-box;
}
.wd-tier-buttons .pp-tier-label {
    display: block;
    font-weight: 700;
    color: #2f3f57;
}
.wd-tier-buttons .pp-tier-price {
    display: block;
    margin-top: 3px;
    font-weight: 700;
    color: #22344f;
}
.wd-tier-buttons .wd-tier-btn:hover {
    border-color: #9fd0f2 !important;
    background-color: #f3f9ff !important;
    box-shadow: 0 4px 10px rgba(31, 72, 105, 0.12);
    transform: translateY(-1px);
}
.wd-tier-buttons .wd-tier-btn.wd-tier-active {
    border-color: #f28b1d !important;
    background-color: #fff7ee !important;
    box-shadow: 0 4px 10px rgba(242, 139, 29, 0.2);
}
/* Scheda prodotto: due CTA affiancate; sotto ~420px in colonna */
.pp-tier-cta-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}
.pp-tier-cta-row .pp-loop-cta-btn {
    width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}
.pp-loop-cta-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.pp-loop-cta-btn {
    width: 100%;
    text-align: center;
    min-height: 42px;
    font-weight: 700;
    border-radius: 8px;
}
@media (max-width: 420px) {
    .pp-tier-cta-row {
        grid-template-columns: 1fr;
    }
}
.pp-cta-quote {
    background: #f28b1d !important;
    border-color: #f28b1d !important;
    color: #fff !important;
}
.pp-cta-quote:hover {
    background: #df7e18 !important;
    border-color: #df7e18 !important;
}
.pp-cta-sample {
    background: #dff1ff !important;
    border: 1px solid #9fd0f2 !important;
    color: #1f4869 !important;
}
.pp-cta-sample:hover {
    background: #d2ebff !important;
}

/* Grid shop ordinata: brand, prezzo, colori, taglie */
.pp-shop-loop-cta {
    margin-top: 8px;
    padding: 10px 10px 8px 10px;
    border: 1px solid #e3e7ef;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
}
.pp-shop-loop-meta {
    display: block;
    height: auto;
    min-height: 0;
}
.pp-shop-loop-main {
    display: block;
}
.pp-shop-loop-price-wrap {
    display: block;
}
.pp-shop-loop-attrs-wrap {
    min-height: 0;
    max-height: none;
    overflow: visible;
}
.pp-shop-loop-buttons {
    margin-top: 12px !important;
}
.pp-shop-brand-line {
    margin: 0 0 4px 0;
    font-size: 12px;
    font-weight: 700;
    color: #5d6b82;
    text-transform: uppercase;
    letter-spacing: .2px;
}
.pp-loop-price-line {
    margin: 0 0 7px 0;
    font-size: 16px;
    font-weight: 700;
    color: #2f3f57;
}
.pp-loop-price-prefix {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
    color: #6b7280;
}
.pp-loop-price-amount {
    display: block;
    font-size: 26px;
    line-height: 1;
    font-weight: 900;
    color: #2f4a15;
}
.pp-loop-price-note {
    font-size: 12px;
    color: #6b6b6b;
}
.pp-available-attrs {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #dfe5ef;
}
.pp-available-attr-row + .pp-available-attr-row {
    margin-top: 10px;
}
.pp-available-attr-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .2px;
    color: #5e7240;
}
.pp-available-color-circles {
    display: grid;
    grid-template-columns: repeat(auto-fill, 40px);
    gap: 10px 12px;
    justify-content: start;
    align-content: start;
}
.pp-loop-color-dots {
    margin-top: 8px;
}
.pp-color-circle {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #bfcfac;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    pointer-events: none;
    user-select: none;
}
.pp-color-circle--has-kids {
    overflow: visible;
}
.pp-color-kids-badge {
    position: absolute;
    left: -4px;
    top: -4px;
    z-index: 2;
    padding: 2px 5px;
    font-size: 8px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: #4a4a4a;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}
.pp-available-size-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.pp-available-size-group {
    width: 100%;
}
.pp-available-size-sub {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5e7240;
}
.pp-available-size-group--kids .pp-available-size-sub {
    color: #8b5a2b;
}
.pp-available-attr-badges--kids .pp-attr-badge-size--kids {
    border-color: #d4a574;
    background: #fffaf5;
    color: #6b4420;
}
.pp-color-circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pp-color-circle img,
.pp-color-circle-fallback {
    width: 100%;
    height: 100%;
    display: block;
}
.pp-color-circle img {
    object-fit: cover;
}
.pp-available-attr-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}
.pp-attr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5em;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #cfe0b0;
    background: #fff;
    color: #2f4a15;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .2px;
    pointer-events: none;
    user-select: none;
    box-sizing: border-box;
}

/* Badge analisi grafica (verifica serigrafia) */
.pp-graphic-analysis-badge {
    font-size: 12px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 6px 0 0 0;
    display: none;
}
.pp-graphic-analysis-badge.pp-badge-ok {
    border-color: #97b04e;
    background: rgba(151, 176, 78, 0.12);
    color: #486122;
}
.pp-graphic-analysis-badge.pp-badge-dtf {
    border-color: #c45a2a;
    background: rgba(196, 90, 42, 0.1);
    color: #8b3a1a;
}
.pp-analysis-message {
    font-size: 11px;
    color: #8b3a1a;
    margin-top: 4px;
}

#pp-cart-progress-logo {
    animation: pp-cart-logo-spin 1.8s linear infinite;
    transform-origin: 50% 50%;
}

@keyframes pp-cart-logo-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Titoli step in alto */
#pp-popup-container .pp-step-titles {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    align-items: center;
    margin: 0 0 14px 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #d9d9d9;
    background: transparent;
}
#pp-popup-container .pp-plugin-top-banner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    min-height: 0;
    padding: 8px 20px;
    background: #97B04E;
    color: #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(70, 95, 24, 0.18);
}

#pp-popup-container .pp-plugin-top-banner .pp-step1-banner-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
#pp-popup-container .pp-plugin-top-banner .pp-step1-banner-icon {
    font-size: 16px;
    line-height: 1;
}
#pp-popup-container .pp-step-title-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 1 1 0;
    min-height: 34px;
    padding: 6px 6px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #7f8f63;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
#pp-popup-container .pp-step-title-item:hover {
    color: #5a7428;
    background: rgba(151,176,78,0.08);
}
#pp-popup-container .pp-step-title-item.is-active {
    color: #3e531d;
    border-bottom-color: #97B04E;
    background: rgba(151,176,78,0.12);
    font-weight: 800;
}
#pp-popup-container .pp-step-title-item.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
    border-bottom-color: transparent !important;
    background: rgba(0,0,0,0.02) !important;
    color: #9aa58a !important;
}
.pp-close-popup:hover {
    background: #f0f7e4 !important;
    border-color: #6f8f2f !important;
    color: #2d5016 !important;
}

#pp-popup-container > .pp-close,
#pp-popup-container > .pp-close.pp-close-popup {
    position: fixed !important;
    top: 14px !important;
    right: 14px !important;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid #97B04E !important;
    background: #fff !important;
    color: #2f4a15;
    font-size: 30px !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    padding: 0;
}

#pp-popup-container .pp-close-inline {
    position: static !important;
    margin-left: 8px;
    width: 30px;
    height: 30px;
    border: 0 !important;
    border-radius: 6px;
    background: transparent !important;
    color: #5a7428 !important;
    font-size: 26px !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none !important;
    flex: 0 0 auto;
}
#pp-popup-container .pp-close-inline:hover {
    background: rgba(151,176,78,0.14) !important;
}


/* Layout compatto + CTA sempre visibili */
#pp-popup-container {
    padding-bottom: 36px;
}

#pp-step-unico h2,
#pp-step3 h3,
#pp-step4 h3 {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    line-height: 1.2;
}

#pp-step-unico p,
#pp-step3 p,
#pp-step4 p {
    margin-top: 0;
}

#pp-step-unico .pp-main-columns,
#pp-step4 .pp-main-columns {
    gap: 16px !important;
    align-items: flex-start;
}

#pp-step3-template-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

#pp-step3 .pp-opzioni-alto {
    margin-bottom: 12px !important;
}

#pp-step3 .pp-step3-option-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#pp-step3 .pp-step3-option-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    min-height: 94px;
    padding: 10px 12px;
    border: 1px solid #bfd49a;
    border-radius: 10px;
    background: #edf5dc;
    color: #3e531d;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 0 #9eb96f, 0 6px 14px rgba(62, 83, 29, 0.14);
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
}

#pp-step3 .pp-step3-option-btn:hover {
    transform: translateY(-1px);
    background: #e8f2d5;
    border-color: #9eb96f;
    box-shadow: 0 3px 0 #91ae5f, 0 10px 18px rgba(62, 83, 29, 0.18);
}

#pp-step3 .pp-step3-option-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #9eb96f, 0 4px 8px rgba(62, 83, 29, 0.12);
}

#pp-step3 .pp-step3-option-btn .pp-step3-option-title {
    font-size: 14px;
    line-height: 1.1;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#pp-step3 .pp-step3-option-btn .pp-step3-option-icon {
    font-size: 16px;
    line-height: 1;
}

#pp-step3 .pp-step3-option-btn .pp-step3-option-sub {
    font-size: 12px;
    line-height: 1.25;
    color: #5e7240;
    text-transform: lowercase;
}

#pp-step3 .pp-step3-option-btn .pp-step3-option-badge {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    background: #3e531d;
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 800;
}

#pp-step3 .pp-step3-option-btn.is-active {
    outline: 2px solid #3e531d;
    outline-offset: 0;
    background: #e4efcd;
    border-color: #3e531d;
    box-shadow: 0 2px 0 #3e531d, 0 8px 18px rgba(62, 83, 29, 0.22);
}

#pp-step3 .pp-step3-option-btn.is-active .pp-step3-option-badge {
    display: inline-block;
}

#pp-step3 .pp-area-card.pp-upload-area-block {
    padding: 12px !important;
}

#pp-step3 .pp-area-card .pp-card-two-cols {
    gap: 12px !important;
}

#pp-step-unico .pp-main-column table th,
#pp-step-unico .pp-main-column table td {
    padding: 6px !important;
}

#pp-step-unico .pp-main-column .pp-qty-input {
    width: 56px !important;
    min-height: 34px;
}

#pp-step-unico .pp-product-type-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 14px 14px 12px 14px;
    border: 0;
    border-radius: 10px;
    background: #edf5dc;
    color: #3e531d;
    text-align: left;
    cursor: pointer;
    padding-left: 44px;
}
#pp-step-unico .pp-product-type-btn::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 14px;
    width: 18px;
    height: 18px;
    border: 2px solid #7f9b4a;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}
#pp-step-unico .pp-product-type-btn::after {
    content: "";
    position: absolute;
    left: 19px;
    top: 19px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: transparent;
}
#pp-step-unico .pp-product-type-btn .pp-product-type-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
#pp-step-unico .pp-product-type-btn .pp-product-type-icon {
    font-size: 18px;
    line-height: 1;
}
#pp-step-unico .pp-product-type-btn .pp-product-type-sub {
    font-size: 13px;
    color: #5e7240;
    line-height: 1.25;
    text-transform: lowercase;
}
#pp-step-unico .pp-product-type-btn .pp-product-type-badge {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    background: #3e531d;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 4px;
    padding: 2px 6px;
}
#pp-step-unico .pp-product-type-btn.is-active {
    outline: 2px solid #3e531d;
    outline-offset: 0;
    box-shadow: none;
    background: #e4efcd;
}
#pp-step-unico .pp-product-type-btn.is-active::before {
    border-color: #3e531d;
    background: #f8fff0;
}
#pp-step-unico .pp-product-type-btn.is-active::after {
    background: #3e531d;
}
#pp-step-unico .pp-product-type-btn.is-active .pp-product-type-badge {
    display: inline-block;
}

/* Tabella qty step 1: stile compatto pulito (no grigio) */
#pp-step-unico .pp-qty-table-wrap {
    max-height: 430px;
    overflow: auto;
    border: 1px solid #cfe0b0;
    border-radius: 6px;
    background: #ffffff;
}

#pp-step-unico .pp-qty-table {
    width: 100%;
    border-collapse: collapse !important;
    table-layout: fixed;
}

#pp-step-unico .pp-qty-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 12px;
    font-weight: 600;
    background: #edf5dc;
    color: #3f5420;
    padding: 4px 6px !important;
    border: 1px solid #cfe0b0 !important;
    line-height: 1.15;
}
#pp-step-unico .pp-qty-table thead th:first-child,
#pp-step-unico .pp-qty-table tbody td:first-child {
    width: min(280px, 32vw);
}
#pp-step-unico .pp-qty-table thead th .pp-total-distribuito-inline {
    color: #ff991f;
    font-weight: 800;
}

.pp-size-audience-tablist .pp-size-audience-btn.is-active {
    background: #97B04E;
    color: #fff;
}

.pp-size-audience-tablist .pp-size-audience-btn:not(.is-active) {
    background: transparent;
    color: #3e531d;
}

#pp-step-unico .pp-qty-table td {
    padding: 0 !important;
    border: 1px solid #dbe8c5 !important;
    min-height: 32px;
    height: auto;
    background: #fff;
    vertical-align: middle;
}

#pp-step-unico .pp-qty-table tbody tr:nth-child(even) td {
    background: #fafdf4;
}

#pp-step-unico .pp-qty-table tbody td:first-child {
    min-width: 220px;
    padding: 8px 10px !important;
    overflow: visible;
}
#pp-step-unico .pp-qty-table tbody td:first-child .pp-qty-color-cell-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    min-height: 0;
}
#pp-step-unico .pp-qty-table tbody td:first-child .pp-qty-color-cell-inner > span:not(.pp-color-variant-thumb-wrap) {
    white-space: nowrap !important;
    font-size: 13px;
    font-weight: 600;
    color: #3e531d;
    line-height: 1.2;
}

#pp-step-unico .pp-qty-table .pp-qty-input {
    width: 100% !important;
    min-height: 32px !important;
    height: 32px !important;
    font-size: 12px;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 4px;
    background: transparent;
    text-align: center;
    box-shadow: none !important;
}
#pp-step-unico .pp-qty-table .pp-qty-input.pp-has-qty {
    color: #ff991f;
    font-weight: 800;
}
#pp-step-unico .pp-qty-table .pp-qty-input:focus {
    outline: none;
    background: #f4fae8;
}

#pp-step-unico .pp-qty-table .pp-cell-price {
    display: none !important;
}

/* Anteprima colore step 1: miniatura più grande + hover zoom (tabella qty) */
#pp-step-unico .pp-color-variant-thumb-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 0;
    line-height: 0;
    border-radius: 10px;
    cursor: zoom-in;
    outline: none;
}
#pp-step-unico .pp-qty-table .pp-color-variant-thumb {
    width: 76px !important;
    height: 76px !important;
    max-width: none !important;
    border-radius: 10px !important;
    border: 1px solid #cfd8b8 !important;
    object-fit: cover !important;
    background: #f6f8f1;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;
    transform-origin: center center;
    will-change: transform;
    vertical-align: middle;
}
#pp-step-unico .pp-color-variant-thumb-wrap:hover .pp-color-variant-thumb,
#pp-step-unico .pp-color-variant-thumb-wrap:focus-visible .pp-color-variant-thumb {
    transform: scale(1.48);
    box-shadow: 0 14px 36px rgba(47, 74, 21, 0.22);
    z-index: 40;
    position: relative;
    border-color: #97b04e !important;
}
#pp-step-unico .pp-color-variant-thumb-wrap:hover,
#pp-step-unico .pp-color-variant-thumb-wrap:focus-within {
    z-index: 50;
}

.pp-variant-hover-preview {
    position: fixed;
    z-index: 10050;
    width: 180px;
    height: 180px;
    border-radius: 10px;
    border: 2px solid #97B04E;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    padding: 6px;
    pointer-events: none;
    display: none;
}
.pp-variant-hover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

#pp-popup-container .pp-recap-panel {
    position: sticky;
    top: 10px;
    align-self: flex-start;
}

#pp-popup-container .pp-recap-body {
    padding: 12px !important;
}

#pp-popup-container .pp-recap-buttons {
    position: sticky;
    bottom: 0;
    z-index: 6;
    margin-top: 12px !important;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 18px, #fff 100%);
}

#pp-popup-container .pp-cta-btn {
    min-height: 48px;
    font-size: 16px;
    font-weight: 800;
}

/* CTA verde pieno su tutti gli step */
#pp-popup-container .pp-cta-primary {
    background: #97B04E !important;
    border-color: #97B04E !important;
    color: #fff !important;
}
#pp-popup-container .pp-cta-primary:hover {
    background: #89a143 !important;
    border-color: #89a143 !important;
}
#pp-popup-container .pp-cta-secondary {
    background: #6f8f2f !important;
    border-color: #6f8f2f !important;
    color: #fff !important;
}
#pp-popup-container .pp-cta-secondary:hover {
    background: #5f7a28 !important;
    border-color: #5f7a28 !important;
}

/* Chiudi fuori dal modal */
#pp-popup-container .pp-close:not(.pp-close-inline) {
    position: fixed !important;
    top: 14px !important;
    right: 14px !important;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid #97B04E !important;
    background: #fff !important;
    color: #2f4a15;
    font-size: 30px !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@media (max-width: 992px) {
    #pp-popup-container .pp-recap-panel {
        position: static;
    }
    #pp-popup-container .pp-close:not(.pp-close-inline) {
        top: 8px !important;
        right: 8px !important;
    }

    /* iPad/tablet: stack columns and keep controls readable */
    #pp-step-unico .pp-main-columns,
    #pp-step3-upload-phase,
    #pp-step4 .pp-main-columns {
        flex-direction: column !important;
        gap: 12px !important;
    }
    #pp-step-unico .pp-main-column,
    #pp-step-unico .pp-summary-card,
    #pp-step3-upload-phase .pp-step3-upload-main,
    #pp-step3-upload-phase .pp-recap-column,
    #pp-step4 .pp-main-column,
    #pp-step4 .pp-recap-panel {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    #pp-step-unico .pp-qty-table-wrap {
        max-height: 52vh;
    }
    #pp-step-unico .pp-qty-table thead th:first-child,
    #pp-step-unico .pp-qty-table tbody td:first-child {
        width: min(260px, 42vw);
        min-width: 200px;
    }
}
@media (max-width: 768px) {
    #pp-graphic-upload-modal .pp-graphic-upload-modal-grid {
        grid-template-columns: 1fr !important;
    }
    #pp-graphic-upload-modal .pp-logo-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 42vh;
    }
    #pp-popup-overlay {
        padding: 8px;
    }
    #pp-popup-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        max-height: calc(100vh - 16px) !important;
        border-radius: 10px;
        padding: 14px !important;
    }
    #pp-popup-container .pp-plugin-top-banner {
        width: 100%;
        margin: 0;
        justify-content: flex-start;
        gap: 8px 14px;
        min-height: 0;
        padding: 6px 14px;
        border-radius: 10px 10px 0 0;
    }
    #pp-popup-container .pp-plugin-top-banner .pp-step1-banner-item {
        font-size: 14px;
        white-space: nowrap;
    }
    #pp-popup-container .pp-step-titles {
        gap: 8px;
        padding: 0;
        margin-bottom: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #pp-popup-container .pp-step-title-item {
        flex: 0 0 auto;
        min-height: 30px;
        padding: 5px 8px;
        font-size: 12px;
        white-space: nowrap;
    }
    #pp-popup-container .pp-close-inline {
        margin-left: auto;
        width: 26px;
        height: 26px;
        font-size: 22px !important;
    }
    #pp-step-unico .pp-qty-table-wrap {
        max-height: 48vh;
    }
    #pp-step-unico .pp-product-type-switch {
        grid-template-columns: 1fr !important;
    }
    #pp-step3 .pp-step3-option-switch {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    #pp-step3-template-column {
        display: flex !important;
        flex-direction: column !important;
    }
    #pp-step3 .pp-step3-option-btn {
        min-height: 80px;
    }
    #pp-step-unico .pp-product-type-btn .pp-product-type-title {
        font-size: 16px;
    }
    #pp-step-unico .pp-product-type-btn .pp-product-type-sub {
        font-size: 12px;
    }
    #pp-step-unico .pp-qty-table thead th,
    #pp-step-unico .pp-qty-table td {
        font-size: 11px;
    }
    #pp-step-unico .pp-qty-table thead th:first-child,
    #pp-step-unico .pp-qty-table tbody td:first-child {
        width: min(240px, 55vw);
        min-width: 180px;
    }
    #pp-step-unico .pp-qty-table .pp-color-variant-thumb {
        width: 64px !important;
        height: 64px !important;
    }
    #pp-step-unico .pp-color-variant-thumb-wrap:hover .pp-color-variant-thumb,
    #pp-step-unico .pp-color-variant-thumb-wrap:focus-visible .pp-color-variant-thumb {
        transform: scale(1.32);
    }
}

/* Midocean: niente consiglio DTF / UI classica accanto al listino fornitore */
.pp-upload-area-block[data-pp-midocean="1"] .pp-technique-advice {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Midocean: solo listino (tecnica/dimensioni/colori), niente mockup interattivo né analisi file */
.pp-upload-area-block[data-pp-midocean="1"] .pp-card-two-cols {
    grid-template-columns: 1fr !important;
}
.pp-upload-area-block[data-pp-midocean="1"] .pp-template-wrap {
    display: none !important;
}
.pp-upload-area-block[data-pp-midocean="1"] .pp-midocean-colour-limit-mockup-bar {
    display: none !important;
}
.pp-upload-area-block[data-pp-midocean="1"] .pp-midocean-colour-limit-banner {
    display: none !important;
}
.pp-upload-area-block[data-pp-midocean="1"] .pp-real-dims-display,
.pp-upload-area-block[data-pp-midocean="1"] .pp-analysis-colors-wrap,
.pp-upload-area-block[data-pp-midocean="1"] .pp-graphic-crop-white {
    display: none !important;
}

/* Flusso semplificato (no API piazzamento): solo tecnica, colori e dimensioni */
#pp-step-upload[data-pp-simple-customization="1"] .pp-step3-mode-cards {
    display: none !important;
}
.pp-upload-area-block[data-pp-simple-customization="1"] .pp-card-two-cols {
    grid-template-columns: 1fr !important;
}
.pp-upload-area-block[data-pp-simple-customization="1"] .pp-card-col-rect,
.pp-upload-area-block[data-pp-simple-customization="1"] .pp-analysis-colors-wrap,
.pp-upload-area-block[data-pp-simple-customization="1"] .pp-graphic-crop-white {
    display: none !important;
}
.pp-upload-area-block[data-pp-simple-customization="1"] .pp-serigrafia-format {
    display: none !important;
}
.pp-upload-area-block[data-pp-simple-customization="1"] .pp-dtf-format-wrap {
    display: none !important;
}

#pp-step-upload[data-pp-simple-customization="1"] #pp-step3-template-column {
    gap: 10px;
}
.pp-simple-area-group {
    border: 1px solid #dfe8cc;
    border-radius: 10px;
    background: #f8faf3;
    overflow: hidden;
}
.pp-simple-area-group-title {
    margin: 0;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #3e531d;
    background: #edf5dc;
    border-bottom: 1px solid #dfe8cc;
}
.pp-simple-area-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}
.pp-simple-area-item {
    background: #fff;
    border: 0;
    border-bottom: 1px solid #e8ede0;
    border-radius: 0;
    margin: 0;
}
.pp-simple-area-grid .pp-simple-area-item:nth-child(odd) {
    border-right: 1px solid #e8ede0;
}
.pp-simple-area-grid .pp-simple-area-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: 0;
}
.pp-simple-fields-wrap .pp-tecnica-select-label,
.pp-simple-fields-wrap .pp-serigrafia-options > label,
.pp-simple-fields-wrap .pp-simple-color-count > label {
    margin: 0;
}
.pp-simple-dims-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.pp-simple-dim-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3e531d;
}
@media (max-width: 720px) {
    .pp-simple-area-grid {
        grid-template-columns: 1fr;
    }
    .pp-simple-area-grid .pp-simple-area-item:nth-child(odd) {
        border-right: 0;
    }
}

/* Midocean: barra lato + tecniche compatta (no doppia anteprima) */
#pp-step-midocean-positions-wrap {
    margin-bottom: 14px;
}

.pp-midocean-toolbar {
    background: #f6f8f1;
    border: 1px solid #dfe8cc;
    border-radius: 10px;
    padding: 14px 16px;
}

.pp-midocean-preapproval-banner {
    margin: -4px -4px 14px -4px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #c9a227;
    border-left-width: 4px;
    background: linear-gradient(135deg, #fffbeb 0%, #fff4d6 100%);
    box-shadow: 0 1px 0 rgba(62, 83, 29, 0.06);
}

.pp-midocean-preapproval-banner__title {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #6b4e00;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0 0 6px 0;
}

.pp-midocean-preapproval-banner__text {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #3d3200;
}

.pp-midocean-preapproval-banner__text + .pp-midocean-preapproval-banner__text {
    margin-top: 8px;
}

.pp-midocean-toolbar-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.pp-midocean-toolbar-title {
    font-size: 15px;
    font-weight: 800;
    color: #2f4a15;
    letter-spacing: 0.02em;
}

.pp-midocean-toolbar-hint {
    font-size: 12px;
    color: #5a6648;
    line-height: 1.4;
}

/* Midocean: colonna template (varianti / blocchi nascosti) non visibile; resta nel DOM per sync */
#pp-step3-template-column.pp-midocean-template-column-hidden {
    display: none !important;
}

/* Midocean listino: popup quasi a tutta larghezza; padding overlay definito inline (ts-printify.php) */
#pp-popup-overlay.pp-popup-overlay-midocean {
    box-sizing: border-box;
}

#pp-popup-wrapper.pp-popup-midocean-max {
    width: min(calc(100vw - 12px), 1920px);
    max-width: none;
    margin: 6px auto;
    box-sizing: border-box;
}

/* Step3 Midocean: sotto ~1200px colonna; sopra main + riepilogo affiancati per sfruttare la larghezza */
#pp-step3-upload-phase.pp-step3-midocean-max .pp-step3-upload-phase-row {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

#pp-step3-upload-phase.pp-step3-midocean-max .pp-step3-upload-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#pp-step3-upload-phase.pp-step3-midocean-max .pp-recap-column {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (min-width: 1200px) {
    #pp-step3-upload-phase.pp-step3-midocean-max .pp-step3-upload-phase-row {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 16px;
    }

    #pp-step3-upload-phase.pp-step3-midocean-max .pp-step3-upload-main {
        flex: 1 1 0;
        min-width: 0;
    }

    #pp-step3-upload-phase.pp-step3-midocean-max .pp-recap-column {
        flex: 0 0 300px;
        width: 300px;
        max-width: 300px;
        position: sticky;
        top: 0;
        align-self: flex-start;
    }
}

/* Midocean: schede posizioni in fila orizzontale (scroll se non entrano tutte) */
#pp-step-midocean-positions-wrap .pp-mo-unified-gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
    padding: 2px 4px 10px;
    overflow-x: auto;
    overflow-y: visible;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #b8c99a transparent;
}

#pp-step-midocean-positions-wrap .pp-mo-unified-gallery::-webkit-scrollbar {
    height: 9px;
}

#pp-step-midocean-positions-wrap .pp-mo-unified-gallery::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 5px;
}

#pp-step-midocean-positions-wrap .pp-mo-unified-gallery::-webkit-scrollbar-thumb {
    background: #a8bd7a;
    border-radius: 5px;
}

#pp-step-midocean-positions-wrap .pp-mo-unified-card {
    flex: 0 0 auto;
    width: clamp(176px, 14vw, 220px);
    min-width: 176px;
    max-width: 228px;
}

.pp-mo-unified-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border: 1px solid #c8c8c8;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pp-mo-unified-card.is-active {
    border-color: #97b04e;
    background: #f6f9f0;
    box-shadow: 0 0 0 1px rgba(151, 176, 78, 0.35);
}

.pp-mo-unified-preview {
    width: 100%;
    min-height: 0;
}

.pp-mo-unified-card .pp-mo-lato-preview-wrap {
    width: 100%;
    min-height: 0;
}

.pp-mo-unified-title {
    font-size: 12px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: 0.05em;
    line-height: 1.25;
}

.pp-mo-unified-dims {
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-top: -6px;
}

.pp-mo-unified-tech-grid {
    grid-template-columns: 1fr !important;
}

.pp-mo-unified-tech-grid .pp-mo-tech-max {
    color: #c45c12;
    font-weight: 700;
}

/* Sopra l’anteprima: evita che layer/stacking blocchi i click sui radio tecnica */
#pp-step-midocean-positions-wrap .pp-mo-step2-tech-list {
    position: relative;
    z-index: 2;
}

#pp-step-midocean-positions-wrap .pp-mo-graphic-dims {
    position: relative;
    z-index: 1;
}

.pp-mo-unified-clear {
    align-self: flex-start;
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #5a7a2a;
    text-decoration: underline;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pp-mo-unified-clear:hover {
    color: #3e531d;
}

.pp-mo-unified-print-colours {
    width: 100%;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px dashed #dfe8cc;
}

.pp-mo-unified-print-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #2f4a15;
}

.pp-mo-unified-print-label select.pp-mo-unified-print-colori {
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    font-size: 13px;
    border: 1px solid #c8c8c8;
    border-radius: 8px;
    box-sizing: border-box;
    background: #fff;
}

.pp-mo-unified-graphic-block {
    padding: 10px 0 4px 0;
    border-top: 1px dashed #dfe8cc;
    margin-top: 2px;
}

.pp-mo-unified-graphic-heading {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #2f4a15;
    margin-bottom: 4px;
}

.pp-mo-unified-graphic-hint {
    margin: 0 0 8px 0;
    font-size: 11px;
    line-height: 1.4;
    color: #5a6648;
}

.pp-mo-unified-graphic-file-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
}

.pp-mo-unified-graphic-file-label input[type='file'] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
    left: 0;
    top: 0;
    scroll-margin: 0;
}

.pp-mo-unified-graphic-file-btn {
    display: inline-block;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #2f4a15;
    background: #edf5dc;
    border: 1px solid #97b04e;
    border-radius: 8px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pp-mo-unified-graphic-file-label:hover .pp-mo-unified-graphic-file-btn {
    background: #e3ecc8;
}

.pp-mo-unified-graphic-file-label.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.pp-mo-unified-graphic-file-label.is-disabled .pp-mo-unified-graphic-file-btn {
    background: #e8e8e8;
    border-color: #ccc;
    color: #888;
}

.pp-mo-unified-graphic-preview {
    position: relative;
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-mo-unified-graphic-empty {
    font-size: 11px;
    color: #888;
}

.pp-mo-unified-graphic-thumb {
    display: none;
    max-width: 100%;
    max-height: 96px;
    object-fit: contain;
    border-radius: 4px;
}

.pp-mo-unified-graphic-thumb.is-visible {
    display: block;
}

.pp-mo-unified-graphic-remove {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    color: #5a7a2a;
    text-decoration: underline;
    cursor: pointer;
}

.pp-mo-unified-graphic-remove:hover {
    color: #3e531d;
}

.pp-mo-unified-card .pp-mo-tech-clear {
    margin-top: 0;
}

.pp-mo-unified-tech-grid .pp-mo-tech-option:has(input:checked) .pp-mo-tech-name {
    color: #2d6b1a;
    font-weight: 700;
}

/* Proporzioni naturali dell’immagine blank Midocean: le zone XML sono % dei pixel immagine;
   un box 1:1 + object-fit:contain letterboxa l’immagine e sposta i tratteggi rispetto al fornitore. */
.pp-mo-lato-preview-stage {
    position: relative;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #cfe0b0;
    background: linear-gradient(145deg, #fafdf6 0%, #f0f4e8 100%);
    overflow: hidden;
    display: block;
}

#pp-step-midocean-positions-wrap .pp-mo-lato-preview-stage:not(.pp-mo-lato-preview-stage--empty):has(.pp-mo-lato-preview-img[src]:not([src=""])) {
    cursor: zoom-in;
}

.pp-midocean-template-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 10080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.pp-midocean-template-zoom-modal.pp-is-open {
    display: flex;
}

.pp-midocean-template-zoom-backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}

.pp-midocean-template-zoom-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(96vw, 1200px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.pp-midocean-template-zoom-close {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #2f4a15;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.pp-midocean-template-zoom-close:hover {
    background: #f4f8e8;
}

.pp-midocean-template-zoom-viewport {
    overflow: auto;
    max-height: calc(90vh - 52px);
    padding: 12px;
    background: #1a1f14;
    border-radius: 10px;
    text-align: center;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.pp-midocean-template-zoom-slot .pp-mo-lato-preview-img {
    display: block;
    max-width: 100%;
    height: auto;
}

.pp-midocean-template-zoom-hint {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
    line-height: 1.35;
}

.pp-mo-lato-preview-stage--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.pp-mo-lato-preview-stage .pp-mo-lato-preview-img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.pp-mo-lato-zone-frame {
    position: absolute;
    box-sizing: border-box;
    border: 2px dashed #97b04e;
    border-radius: 2px;
    pointer-events: none;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.65),
        inset 0 0 0 1px rgba(62, 83, 29, 0.12);
}

/* Stampa tonda (Gorfactory / overlay turchese ≈ cerchio): allinea il tratteggio al cerchio reale. */
.pp-mo-lato-zone-frame--circle {
    border-radius: 50%;
    overflow: hidden;
}

.pp-mo-lato-zone-frame--circle .pp-mo-lato-zone-graphic-slot {
    border-radius: 50%;
    overflow: hidden;
}

.pp-mo-lato-zone-graphic-slot {
    position: absolute;
    box-sizing: border-box;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.pp-mo-lato-zone-graphic {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: none;
    pointer-events: none;
}

.pp-mo-lato-zone-graphic.is-visible {
    display: block;
}

.pp-mo-graphic-dims {
    margin-top: 4px;
    padding: 10px 10px 8px 10px;
    border-radius: 8px;
    border: 1px solid #dfe8cc;
    background: #fafdf6;
}

.pp-mo-graphic-dims-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #2f4a15;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Griglia fissa su una riga: con flex+wrap su card strette (5 colonne) Larghezza finiva sopra
   e restava visibile solo Altezza. minmax(0,1fr) consente il restringimento senza andare a capo. */
.pp-mo-graphic-dims-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 6px 8px;
}

.pp-mo-graphic-dim-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    color: #444;
}

.pp-mo-graphic-dim-cap {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.pp-mo-graphic-dim-field input[type="number"] {
    width: 100%;
    padding: 7px 8px;
    font-size: 14px;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    box-sizing: border-box;
}

.pp-mo-graphic-dims-sep {
    font-weight: 700;
    color: #97b04e;
    padding-bottom: 8px;
    flex: 0 0 auto;
}

.pp-midocean-template-zoom-slot {
    display: inline-block;
    max-width: 100%;
}

.pp-midocean-template-zoom-slot .pp-mo-zoom-stage-clone {
    max-width: min(96vw, 920px);
}

.pp-midocean-template-zoom-scale {
    display: inline-block;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
}

.pp-mo-unified-card.is-active .pp-mo-lato-zone-frame {
    border-color: #6d8a2e;
    box-shadow:
        0 0 0 2px rgba(151, 176, 78, 0.5),
        inset 0 0 0 1px rgba(62, 83, 29, 0.2);
}

.pp-mo-unified-card.is-active .pp-mo-lato-zone-frame--circle {
    box-shadow:
        0 0 0 2px rgba(151, 176, 78, 0.45),
        inset 0 0 0 1px rgba(62, 83, 29, 0.18);
}

.pp-mo-unified-card .pp-mo-lato-preview-placeholder {
    padding: 10px;
    font-size: 11px;
    color: #6b7a55;
    text-align: center;
    line-height: 1.35;
}

.pp-mo-tech-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pp-mo-tech-label {
    font-size: 13px;
    font-weight: 700;
    color: #2f4a15;
}

.pp-mo-dims {
    font-size: 11px;
    font-weight: 600;
    color: #6b7559;
    white-space: nowrap;
}

.pp-mo-tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.pp-mo-tech-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
    background: #fafafa;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pp-mo-tech-option:has(input:checked) {
    border-color: #97b04e;
    background: #f4f8e8;
}

/* Fallback visivo se :has() non evidenzia il label (stessa resa della regola sopra) */
#pp-step-midocean-positions-wrap .pp-mo-tech-option.is-selected {
    border-color: #97b04e;
    background: #f4f8e8;
}

#pp-step-midocean-positions-wrap .pp-mo-tech-option.is-selected .pp-mo-tech-name {
    color: #2d6b1a;
    font-weight: 700;
}

.pp-mo-tech-option input {
    margin-top: 3px;
    flex-shrink: 0;
}

.pp-mo-tech-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pp-mo-tech-name {
    font-size: 13px;
    font-weight: 600;
    color: #2f4a15;
}

.pp-mo-tech-max {
    font-size: 11px;
    font-weight: 700;
    color: #7a6220;
}

.pp-mo-tech-clear {
    margin-top: 10px;
}

@media (max-width: 520px) {
    .pp-mo-tech-grid {
        grid-template-columns: 1fr;
    }
}
