/* PrimePrint Wizard — vanilla CSS, no dependency */

#ppp-wizard-mount, .ppp-wizard-mount {
  position: relative;
  display: block;
  margin-top: 1rem;
}

/* === TRIGGER BUTTON === */
.ppp-wiz-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ppp-wiz-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.22), 0 4px 8px rgba(15, 23, 42, 0.12);
}
.ppp-wiz-trigger .ppp-wiz-icon {
  display: inline-flex;
  color: #ea5424;
}

/* === SOLD OUT (tutte le combinazioni a stock 0) === */
.ppp-wiz-trigger--soldout {
  background: #f1f5f9;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
  border: 1px solid #e2e8f0;
}
.ppp-wiz-trigger--soldout:hover {
  transform: none;
  box-shadow: none;
}
.ppp-wiz-soldout-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dc2626;
  flex-shrink: 0;
}
.ppp-wiz-soldout-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
}
.ppp-wiz-soldout-hint a {
  color: #ea5424;
  font-weight: 600;
  text-decoration: none;
}
.ppp-wiz-soldout-hint a:hover { text-decoration: underline; }

/* === BACKDROP / DIALOG === */
.ppp-wiz-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  backdrop-filter: blur(4px);
  animation: ppp-wiz-fadein 0.2s ease;
}
@keyframes ppp-wiz-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ppp-wiz-dialog {
  background: #fff;
  width: 100%;
  max-width: 1200px;
  max-height: calc(100vh - 4rem);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ppp-wiz-slideup 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
}
@keyframes ppp-wiz-slideup {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === HEADER === */
.ppp-wiz-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-bottom: 3px solid #ea5424;
}
.ppp-wiz-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}
.ppp-wiz-title .ppp-wiz-icon {
  color: #ea5424;
}
.ppp-wiz-stepper {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  justify-content: center;
}
.ppp-wiz-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  cursor: default;
}
.ppp-wiz-step.done { color: rgba(255, 255, 255, 0.85); cursor: pointer; }
.ppp-wiz-step.active { color: #fff; font-weight: 600; }
.ppp-wiz-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 1rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}
.ppp-wiz-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
  font-weight: 600;
}
.ppp-wiz-step.active .ppp-wiz-step-num {
  background: #ea5424;
  border-color: #ea5424;
}
.ppp-wiz-step.done .ppp-wiz-step-num {
  background: #16a34a;
  border-color: #16a34a;
}
.ppp-wiz-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.ppp-wiz-close:hover { background: rgba(255, 255, 255, 0.2); }

/* === BODY (main + aside) === */
.ppp-wiz-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 900px) {
  .ppp-wiz-body { grid-template-columns: 1fr; }
}
.ppp-wiz-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ppp-wiz-content-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.ppp-wiz-step-content {
  padding: 2rem 2rem 1rem;
}
.ppp-wiz-step-content h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ppp-wiz-help {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.5;
}
.ppp-wiz-empty {
  padding: 2rem;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
}

/* === STEP 1: SIZE GRID === */
.ppp-wiz-grid-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: auto;
  max-height: 60vh;
}
.ppp-wiz-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.ppp-wiz-grid th,
.ppp-wiz-grid td {
  padding: 0.5rem 0.6rem;
  border: 1px solid #f1f5f9;
  text-align: center;
}
.ppp-wiz-grid thead th {
  background: #f8fafc;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.ppp-wiz-th-corner {
  text-align: left !important;
  font-weight: 600;
  color: #ea5424;
  white-space: nowrap;
}
.ppp-wiz-color-cell {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  text-align: left !important;
  font-weight: 500;
  background: #fafbfc !important;
  position: sticky;
  left: 0;
  z-index: 1;
  white-space: nowrap;
}
.ppp-wiz-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.ppp-wiz-cell-na {
  color: #cbd5e1;
}
.ppp-wiz-cell-active {
  background: #fff7ed !important;
  border-color: #ea5424 !important;
}
.ppp-wiz-qty-input {
  width: 60px;
  padding: 0.4rem 0.4rem;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}
.ppp-wiz-qty-input:focus {
  outline: 0;
  border-color: #ea5424;
  box-shadow: 0 0 0 3px rgba(234, 84, 36, 0.15);
}
/* Hint scroll orizzontale: nascosto su desktop, visibile solo su mobile */
.ppp-wiz-grid-hint { display: none; }

/* === STEP 2: SIDE PANELS === */
.ppp-wiz-sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}
.ppp-wiz-side-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
}
.ppp-wiz-side-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}
.ppp-wiz-side-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #0f172a;
}
.ppp-wiz-side-size {
  font-size: 0.75rem;
  color: #64748b;
}
/* === TECH SELECTOR — premium grid === */
.ppp-wiz-tech-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}
@media (max-width: 600px) {
  .ppp-wiz-tech-list { grid-template-columns: 1fr; }
}
.ppp-wiz-tech-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.85rem 0.95rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  color: #1e293b;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.12s ease;
  outline: 0;
}
.ppp-wiz-tech-btn::before {
  content: '';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.ppp-wiz-tech-btn:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}
.ppp-wiz-tech-btn:hover::before {
  border-color: #64748b;
}
.ppp-wiz-tech-btn.is-selected {
  background: #fff;
  border-color: #ea5424;
  box-shadow: 0 0 0 3px rgba(234, 84, 36, 0.12);
  color: #0f172a;
  font-weight: 600;
}
.ppp-wiz-tech-btn.is-selected::before {
  border-color: #ea5424;
  background: #ea5424;
  box-shadow: inset 0 0 0 3px #fff;
}
.ppp-wiz-tech-btn .ppp-wiz-tech-label {
  flex: 1;
  line-height: 1.2;
}
.ppp-wiz-tech-btn .ppp-wiz-tech-check {
  display: none;  /* sostituito dal radio dot via ::before */
}

.ppp-wiz-tech-btn.ppp-wiz-tech-none {
  grid-column: 1 / -1;  /* full-width sopra le tecniche */
  background: #f8fafc;
  border-style: dashed;
  color: #64748b;
}
.ppp-wiz-tech-btn.ppp-wiz-tech-none.is-selected {
  background: #f1f5f9;
  border-style: solid;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
  color: #334155;
}
.ppp-wiz-tech-btn.ppp-wiz-tech-none.is-selected::before {
  border-color: #94a3b8;
  background: #94a3b8;
  box-shadow: inset 0 0 0 3px #fff;
}

.ppp-wiz-aside-line.is-discount {
  color: #16a34a;
}
.ppp-wiz-aside-line.is-discount strong { color: #16a34a; }

/* === STEP 4: FILE === */
.ppp-wiz-file-input {
  position: relative;
  margin-bottom: 1rem;
}
.ppp-wiz-file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #64748b;
}
.ppp-wiz-file-label:hover {
  border-color: #ea5424;
  background: #fff7ed;
  color: #ea5424;
}
.ppp-wiz-file-label strong {
  color: #0f172a;
  font-size: 1rem;
}
.ppp-wiz-file-input input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.ppp-wiz-file-uploaded {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  color: #16a34a;
  font-weight: 500;
}
.ppp-wiz-link-btn {
  background: transparent;
  border: 0;
  color: #dc2626;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
}
.ppp-wiz-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  font-size: 0.9rem;
  cursor: pointer;
  color: #475569;
}
.ppp-wiz-checkbox input { transform: scale(1.1); }
.ppp-wiz-note {
  margin-top: 1rem;
}
.ppp-wiz-note-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.ppp-wiz-note textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.ppp-wiz-note textarea:focus {
  outline: 0;
  border-color: #ea5424;
  box-shadow: 0 0 0 3px rgba(234, 84, 36, 0.15);
}
.ppp-wiz-note-counter {
  text-align: right;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* === NAV === */
.ppp-wiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.ppp-wiz-btn {
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ppp-wiz-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ppp-wiz-btn-ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.ppp-wiz-btn-ghost:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0f172a;
}
.ppp-wiz-btn-primary {
  background: linear-gradient(135deg, #ea5424 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(234, 84, 36, 0.3);
}
.ppp-wiz-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(234, 84, 36, 0.4);
}

/* === ASIDE QUOTE === */
.ppp-wiz-aside {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .ppp-wiz-aside { border-top: 1px solid #1e293b; }
}
.ppp-wiz-aside-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}
.ppp-wiz-aside-eyebrow {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.4rem;
}
.ppp-wiz-aside-header strong {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}
.ppp-wiz-aside h4 {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}
.ppp-wiz-aside-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ppp-wiz-aside-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}
.ppp-wiz-swatch-mini {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.ppp-wiz-aside-item-qty {
  font-weight: 600;
  color: #fff;
}
.ppp-wiz-aside-empty {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}
.ppp-wiz-aside-prints {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ppp-wiz-aside-print {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.ppp-wiz-aside-side-label {
  font-weight: 700;
  color: #ea5424;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}
.ppp-wiz-aside-quote {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
}
.ppp-wiz-aside-line {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}
.ppp-wiz-aside-line:last-child { border-bottom: 0; }
.ppp-wiz-aside-line span:first-child { color: rgba(255, 255, 255, 0.85); }
.ppp-wiz-aside-line-amount { color: rgba(255, 255, 255, 0.5); font-size: 0.75rem; }
.ppp-wiz-aside-line strong { color: #fff; font-weight: 700; }
.ppp-wiz-aside-totals {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.ppp-wiz-aside-totals > div {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.7);
}
.ppp-wiz-aside-totals strong { color: #fff; }
.ppp-wiz-aside-totals > div.is-discount { color: #4ade80; }
.ppp-wiz-aside-totals > div.is-discount strong { color: #4ade80; }
.ppp-wiz-aside-grandtotal {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.ppp-wiz-aside-grandtotal > span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}
.ppp-wiz-grand-amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ea5424;
  letter-spacing: -0.01em;
}
.ppp-wiz-grand-vat {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
}
.ppp-wiz-aside-loading {
  text-align: center;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}
.ppp-wiz-aside-error {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  padding: 0.75rem;
  color: #fca5a5;
  font-size: 0.85rem;
}

/* === SIMPLE MODE: option fields, tier table, misura selector === */
.ppp-wiz-field { margin-bottom: 1.25rem; }
.ppp-wiz-field-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: #0f172a;
}
.ppp-wiz-req { color: #dc2626; }
.ppp-wiz-input, .ppp-wiz-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  color: #0f172a;
}
.ppp-wiz-input:focus, .ppp-wiz-select:focus {
  outline: 0;
  border-color: #ea5424;
  box-shadow: 0 0 0 3px rgba(234, 84, 36, 0.15);
}
.ppp-wiz-misura-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ppp-wiz-misura-btn {
  padding: 0.6rem 1rem;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ppp-wiz-misura-btn:hover {
  border-color: #ea5424;
  background: #fff7ed;
}
.ppp-wiz-misura-btn.is-selected {
  background: #ea5424;
  border-color: #ea5424;
  color: #fff;
  font-weight: 600;
}
.ppp-wiz-qty-section { margin-top: 1.5rem; }
.ppp-wiz-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.ppp-wiz-tier-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9rem;
}
.ppp-wiz-tier-table th {
  background: #f8fafc;
  padding: 0.65rem 0.5rem;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
}
.ppp-wiz-tier-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}
.ppp-wiz-tier-row.is-selected {
  background: #fff7ed;
}
.ppp-wiz-tier-row.is-selected td {
  font-weight: 600;
  color: #0f172a;
}
.ppp-wiz-simple-hero {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.ppp-wiz-simple-hero img {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.ppp-wiz-aside-summary { display: flex; flex-direction: column; gap: 0.4rem; }
.ppp-wiz-aside-summary h4 { margin-top: 0; }
.ppp-wiz-aside-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.25rem 0;
}
.ppp-wiz-aside-cta {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #ea5424 0%, #dc2626 100%);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin-top: 0.5rem;
}
.ppp-wiz-aside-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(234, 84, 36, 0.4);
}
.ppp-wiz-aside-cta:disabled { opacity: 0.6; cursor: not-allowed; }
.ppp-wiz-success {
  text-align: center;
  padding: 1rem;
}
.ppp-wiz-success p {
  color: #4ade80;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

/* === GENERIC === */
.ppp-wiz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem;
  color: #64748b;
}
.ppp-wiz-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #ea5424;
  border-radius: 50%;
  animation: ppp-wiz-spin 0.8s linear infinite;
}
@keyframes ppp-wiz-spin {
  to { transform: rotate(360deg); }
}
.ppp-wiz-error {
  margin: 2rem;
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b91c1c;
}
.ppp-wiz-added {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
}
.ppp-wiz-added-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ppp-wiz-added h3 { margin: 0; font-size: 1.4rem; }
.ppp-wiz-added p { margin: 0; color: #64748b; }
.ppp-wiz-cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #ea5424;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
}

/* ====================================================================
 * MOBILE OVERRIDES — only apply at <=768px. Desktop styles untouched.
 * Strategy:
 *  - Modal becomes full-screen (no margin, no rounded corners)
 *  - Body switches to single-column with native page scroll (no nested
 *    scroll containers fighting for height)
 *  - Aside (recap + CTA) follows main naturally; CTA stays sticky at the
 *    bottom of the viewport so it's always reachable
 *  - Padding/font sizes shrunk for narrow widths
 * ==================================================================== */
@media (max-width: 768px) {
  /* Backdrop edge-to-edge */
  .ppp-wiz-backdrop {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .ppp-wiz-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  /* Header: stack title + close on top of the steps; tighter padding */
  .ppp-wiz-header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.5rem 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom-width: 2px;
  }
  .ppp-wiz-title {
    font-size: 0.95rem;
    white-space: normal;
    line-height: 1.25;
    grid-column: 1;
    grid-row: 1;
  }
  .ppp-wiz-close {
    width: 32px;
    height: 32px;
    grid-column: 2;
    grid-row: 1;
  }
  .ppp-wiz-stepper {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 0.25rem;
  }
  .ppp-wiz-step {
    padding: 0 0.6rem;
    font-size: 0.75rem;
    flex: 0 0 auto;
  }
  .ppp-wiz-step-num { width: 1.4rem; height: 1.4rem; font-size: 0.75rem; }
  .ppp-wiz-step:not(:last-child)::after { width: 0.5rem; }

  /* Body: single column, scrolls inside the main wrap. No fixed grid. */
  .ppp-wiz-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .ppp-wiz-main {
    flex: 1 1 auto;
    min-height: 0;
  }
  .ppp-wiz-content-wrap {
    -webkit-overflow-scrolling: touch;
  }
  .ppp-wiz-step-content {
    padding: 1rem 1rem 1.25rem;
  }
  .ppp-wiz-step-content h2 { font-size: 1.15rem; }
  .ppp-wiz-help { font-size: 0.85rem; margin-bottom: 0.85rem; }

  /* Hero image (simple-mode) */
  .ppp-wiz-simple-hero img { max-width: 120px !important; }

  /* Misura buttons: tighter, full-row friendly */
  .ppp-wiz-misura-list { gap: 0.4rem; }
  .ppp-wiz-misura-btn {
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
    flex: 1 0 auto;
    min-width: 0;
    white-space: nowrap;
  }

  /* Generic field spacing */
  .ppp-wiz-field { margin-bottom: 0.85rem; }
  .ppp-wiz-field-label { font-size: 0.85rem; }
  .ppp-wiz-input, .ppp-wiz-select {
    padding: 0.55rem 0.6rem;
    font-size: 0.9rem;
  }

  /* Tier table: compact + horizontal scroll if it overflows */
  .ppp-wiz-qty-section { margin-top: 1rem; }
  .ppp-wiz-section-title { font-size: 0.95rem; }
  .ppp-wiz-tier-table {
    font-size: 0.78rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .ppp-wiz-tier-table th,
  .ppp-wiz-tier-table td { padding: 0.5rem 0.4rem; }

  /* ── Apparel mode size grid — mobile usabile mantenendo la griglia ──
   * Problema risolto: prima c'era max-height:50vh + overflow:auto =
   * scroll annidato su 2 assi dentro un box, dentro la pagina che già
   * scrolla → ingestibile. Ora: SOLO scroll orizzontale per le taglie,
   * lo scroll verticale lo gestisce il content-wrap. Header riga +
   * colonna colore + angolo restano sticky correttamente. */
  .ppp-wiz-grid-wrap {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    position: relative;
    /* fade a destra per suggerire lo scroll orizzontale */
    background:
      linear-gradient(to right, transparent calc(100% - 24px), rgba(255,255,255,0.9)) right center / 24px 100% no-repeat;
  }
  .ppp-wiz-grid { font-size: 0.85rem; }
  .ppp-wiz-grid th,
  .ppp-wiz-grid td {
    padding: 0.5rem 0.4rem;
    min-width: 54px;
  }
  /* Header taglie sticky in alto */
  .ppp-wiz-grid thead th { z-index: 2; }
  /* Angolo: sticky su entrambi gli assi, compatto */
  .ppp-wiz-th-corner {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 4;
    background: #fff !important;
    min-width: 88px;
    max-width: 104px;
    font-size: 0.68rem !important;
    line-height: 1.15;
    white-space: normal !important;
    box-shadow: 2px 0 6px -3px rgba(0, 0, 0, 0.18);
  }
  /* Colonna colore sticky a sinistra, sopra le celle */
  .ppp-wiz-color-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 88px;
    max-width: 104px;
    background: #fafbfc !important;
    box-shadow: 2px 0 6px -3px rgba(0, 0, 0, 0.18);
  }
  .ppp-wiz-color-cell > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60px;
  }
  /* Celle: tap target più grandi, keypad numerico su mobile */
  .ppp-wiz-qty-input {
    width: 50px;
    height: 42px;
    padding: 0.3rem;
    font-size: 1rem;
    font-weight: 600;
  }
  /* Hint scroll orizzontale (mostrato solo su mobile) */
  .ppp-wiz-grid-hint {
    display: block;
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0 0 0.5rem;
    text-align: center;
  }
  .ppp-wiz-grid-hint span { color: #ea5424; font-weight: 600; }

  /* Side panels (apparel step 2): single col always; tighter padding */
  .ppp-wiz-sides { gap: 0.85rem; }
  .ppp-wiz-side-panel { padding: 0.9rem; border-radius: 10px; }

  /* Aside: compact bottom bar — hide the verbose recap, show only the
   * grand total + CTA so it doesn't eat half the screen. The form below
   * already shows which qty/options are selected.
   * The user keeps the dark sticky strip but at minimal height. */
  .ppp-wiz-aside {
    flex: 0 0 auto;
    overflow: visible;
    padding: 0.55rem 0.85rem 0.7rem;
    gap: 0.5rem;
    position: sticky;
    bottom: 0;
    border-top: 2px solid rgba(234, 84, 36, 0.4);
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.25);
  }
  /* Hide everything except the grand total + CTA — those are the only
   * actionable rows on a small screen. */
  .ppp-wiz-aside h4,
  .ppp-wiz-aside-header,
  .ppp-wiz-aside-summary > .ppp-wiz-aside-row,
  .ppp-wiz-aside-summary > .ppp-wiz-aside-totals,
  .ppp-wiz-aside-items,
  .ppp-wiz-aside-prints,
  .ppp-wiz-aside-quote .ppp-wiz-aside-line,
  .ppp-wiz-aside-quote .ppp-wiz-aside-totals { display: none !important; }
  .ppp-wiz-aside-summary { gap: 0; margin: 0; }
  .ppp-wiz-aside-quote {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
  .ppp-wiz-aside-grandtotal {
    margin: 0;
    padding: 0;
    border-top: 0;
    align-items: center;
  }
  .ppp-wiz-aside-grandtotal > span {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
  }
  .ppp-wiz-grand-amount { font-size: 1.15rem; line-height: 1; }
  .ppp-wiz-grand-vat { font-size: 0.6rem; }
  .ppp-wiz-aside-cta { padding: 0.65rem; font-size: 0.9rem; }
  /* Apparel mode: hide variants/prints recap on mobile too — keep the
   * essential totals only (grand-total + CTA already kept visible). */
  .ppp-wiz-aside-empty { display: none !important; }

  /* Step 1 / Step 2 / Step nav (apparel): tighter footer nav */
  .ppp-wiz-nav { padding: 0.7rem 1rem; }
  .ppp-wiz-btn { padding: 0.6rem 1rem; font-size: 0.9rem; }
}

/* Extra-small phones (≤420px) — further squeeze */
@media (max-width: 420px) {
  .ppp-wiz-misura-btn { font-size: 0.78rem; padding: 0.45rem 0.6rem; }
  .ppp-wiz-tier-table { font-size: 0.74rem; }
  .ppp-wiz-grand-amount { font-size: 1.1rem; }
  .ppp-wiz-step-content { padding: 0.85rem 0.85rem 1rem; }
}
