.ppw-customizer {
  --ppw-engraving-color: #111111;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #d5d9d9;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.ppw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.ppw-head-copy {
  min-width: 0;
}

.ppw-head-copy strong,
.ppw-head-copy span {
  display: block;
}

.ppw-head-copy strong {
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.ppw-head-copy > span:last-child {
  margin-top: 4px;
  color: #59626f;
  font-size: 13px;
}

.ppw-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #b7d2f0;
  border-radius: 999px;
  background: #eef6ff;
  color: #174a7c;
  font-size: 12px;
  font-weight: 700;
}

.ppw-head-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 0 0 auto;
}

.ppw-start {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #f0b800;
  border-radius: 999px;
  background: #ffd814;
  color: #111827;
  cursor: pointer;
  font-weight: 700;
}

.ppw-start:hover,
.ppw-start:focus-visible {
  background: #f7ca00;
  outline: none;
}

.ppw-price-box {
  min-width: 132px;
  padding: 7px 10px;
  border: 1px solid #d5d9d9;
  border-radius: 8px;
  background: #f7f8fa;
  text-align: right;
}

.ppw-price-box span {
  display: block;
  color: #59626f;
  font-size: 11px;
  line-height: 1.1;
}

.ppw-price {
  display: block;
  margin-top: 2px;
  color: #111827;
  font-size: 16px;
  line-height: 1.1;
}

.ppw-price-note {
  display: block;
  margin-top: 2px;
  color: #59626f;
  font-size: 11px;
  line-height: 1.15;
}

.ppw-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.ppw-progress-step {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #d5d9d9;
  border-radius: 999px;
  background: #ffffff;
  color: #59626f;
  font-size: 12px;
  font-weight: 700;
}

.ppw-progress-step.is-current {
  border-color: #f0b800;
  background: #fff8dd;
  color: #6c4e00;
}

.ppw-progress-step.is-complete {
  border-color: #a6d8be;
  background: #edfdf4;
  color: #067047;
}

.ppw-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(300px, 1.08fr);
  gap: 18px;
  align-items: start;
}

.ppw-preview {
  position: sticky;
  top: 16px;
  min-width: 0;
}

.ppw-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ppw-preview-bar strong {
  min-width: 0;
  font-size: 14px;
}

.ppw-preview-bar span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff3cd;
  color: #8a6116;
  font-size: 12px;
  font-weight: 700;
}

.ppw-preview-bar span.is-ready {
  background: #edfdf4;
  color: #067047;
}

.ppw-surface-reference {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 9px;
  border: 1px solid #d5d9d9;
  border-radius: 8px;
  background: #ffffff;
}

.ppw-surface-reference.no-image {
  grid-template-columns: 1fr;
}

.ppw-surface-reference img {
  display: block;
  width: 72px;
  height: 54px;
  border: 1px solid #e5e7eb;
  object-fit: cover;
}

.ppw-surface-reference strong,
.ppw-surface-reference span {
  display: block;
}

.ppw-surface-reference strong {
  font-size: 13px;
}

.ppw-surface-reference span {
  margin-top: 2px;
  color: #59626f;
  font-size: 12px;
}

.ppw-plate-shell {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f7f8fa;
}

.ppw-plate {
  position: relative;
  width: min(100%, var(--ppw-preview-width, 420px));
  margin: 0 auto;
  aspect-ratio: var(--ppw-ratio);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 2px;
  background-color: #d1a43b;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.ppw-plate::after {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 36%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0) 64%);
}

.ppw-plate-media {
  position: absolute;
  top: 50%;
  left: 15%;
  z-index: 2;
  display: none;
  width: 20%;
  height: 58%;
  transform: translate(-50%, -50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.ppw-plate-media.is-picto {
  background-image: none;
  background-color: var(--ppw-engraving-color);
  -webkit-mask: var(--ppw-picto-url) center / contain no-repeat;
  mask: var(--ppw-picto-url) center / contain no-repeat;
}

.ppw-plate-lines {
  position: absolute;
  inset: 8% 8%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05em;
  font-weight: 700;
  line-height: 1.06;
  text-transform: none;
  white-space: nowrap;
}

.ppw-plate-lines.has-media {
  left: 30%;
}

.ppw-plate-lines[data-align="left"] {
  align-items: flex-start;
}

.ppw-plate-lines[data-align="center"] {
  align-items: center;
}

.ppw-plate-lines[data-align="right"] {
  align-items: flex-end;
}

.ppw-summary {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.ppw-summary li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #edf0f3;
  font-size: 13px;
}

.ppw-summary span {
  color: #59626f;
}

.ppw-summary strong {
  min-width: 0;
  max-width: 68%;
  overflow-wrap: anywhere;
  text-align: right;
}

.ppw-controls {
  display: grid;
  gap: 12px;
}

.ppw-step {
  padding: 13px;
  border: 1px solid #d5d9d9;
  border-radius: 8px;
  background: #ffffff;
}

.ppw-step.is-current {
  border-color: #f0b800;
  box-shadow: 0 0 0 2px #fff0b3;
}

.ppw-step.is-complete {
  border-color: #b9d9c8;
}

.ppw-step-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.ppw-step-head > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.ppw-step-head strong,
.ppw-step-head small {
  display: block;
}

.ppw-step-head strong {
  line-height: 1.2;
}

.ppw-step-head small {
  margin-top: 2px;
  color: #59626f;
  font-size: 12px;
}

.ppw-field label,
.ppw-line-row > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: #111827;
}

.ppw-field select,
.ppw-field input[type="text"],
.ppw-field input[type="file"],
.ppw-field textarea,
.ppw-line-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #ffffff;
}

.ppw-field select:focus,
.ppw-field input:focus,
.ppw-field textarea:focus,
.ppw-line-row input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
  outline: none;
}

.ppw-lines {
  display: grid;
  gap: 9px;
}

.ppw-line-row {
  display: block;
  margin: 0;
}

.ppw-line-row input {
  padding: 9px 11px;
}

.ppw-line-row small {
  display: block;
  margin-top: 4px;
  color: #59626f;
  font-size: 12px;
  text-align: right;
}

.ppw-line-row.has-value small {
  color: #067047;
}

.ppw-multiline {
  min-height: 132px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

.ppw-multiline-count {
  display: block;
  margin-top: 5px;
  color: #59626f;
  font-size: 12px;
  text-align: right;
}

.ppw-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.ppw-material,
.ppw-picto {
  position: relative;
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 88px;
  padding: 9px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}

.ppw-material:hover,
.ppw-picto:hover,
.ppw-material:focus-visible,
.ppw-picto:focus-visible {
  border-color: #111827;
  outline: none;
}

.ppw-material.is-active,
.ppw-picto.is-active {
  border-color: #111827;
  box-shadow: inset 0 0 0 2px #111827;
}

.ppw-material.is-active::after,
.ppw-picto.is-active::after {
  content: "OK";
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #067047;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

.ppw-swatch {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.ppw-material span:last-child,
.ppw-picto span {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.ppw-picto-mark {
  display: block;
  width: 56px;
  height: 44px;
  background: var(--ppw-engraving-color);
  -webkit-mask: var(--ppw-picto-url) center / contain no-repeat;
  mask: var(--ppw-picto-url) center / contain no-repeat;
}

.ppw-cart-total {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  margin: 0 10px 0 0;
  padding: 6px 12px;
  border: 1px solid #d5d9d9;
  border-radius: 8px;
  background: #f7f8fa;
  vertical-align: middle;
}

.ppw-cart-total span {
  color: #59626f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.ppw-cart-total strong {
  color: #111827;
  font-size: 16px;
  line-height: 1.15;
}

.ppw-help,
.ppw-status {
  margin: 6px 0 0;
  color: #59626f;
  font-size: 12px;
}

.ppw-status {
  min-height: 18px;
  color: #b42318;
  font-weight: 700;
}

.ppw-status.is-ready {
  color: #067047;
}

@media (max-width: 860px) {
  .ppw-head {
    display: grid;
  }

  .ppw-head-actions {
    width: 100%;
  }

  .ppw-start {
    flex: 1 1 auto;
  }

  .ppw-price-box {
    flex: 0 0 132px;
  }

  .ppw-grid {
    grid-template-columns: 1fr;
  }

  .ppw-preview {
    position: static;
  }
}

@media (max-width: 520px) {
  .ppw-customizer {
    padding: 12px;
  }

  .ppw-head-actions {
    display: grid;
  }

  .ppw-price-box {
    width: 100%;
    text-align: left;
  }

  .ppw-cart-total {
    display: flex;
    width: 100%;
    margin: 0 0 8px;
  }

  .ppw-choice-grid {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  }

  .ppw-summary li {
    display: grid;
    gap: 2px;
  }

  .ppw-summary strong {
    max-width: 100%;
    text-align: left;
  }
}
