/* Foto Larko uploader - matches the WordPress theme (navy/red, Outfit + Satoshi). */
:root {
  --red: #BA080B;
  --red-dark: #9a0609;
  --red-soft: #FDECEC;
  --navy: #06315B;
  --ink: #0b1f38;
  --muted: #5b6b80;
  --line: #dfe6ee;
  --bg: #f2f5f9;
  --card: #fff;
  --ok: #0f7a4a;
  --ok-soft: #e6f5ee;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(6, 49, 91, .06), 0 8px 24px rgba(6, 49, 91, .07);
  --shadow-lg: 0 18px 48px rgba(6, 49, 91, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font: 16px/1.55 "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: "Outfit", system-ui, sans-serif; color: var(--navy); letter-spacing: -.01em; margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid rgba(186, 8, 11, .45); outline-offset: 2px; }
.pp-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pp-skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; }
.pp-skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.pp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .25s var(--ease), transform .2s var(--ease), opacity .2s;
}
.pp-btn svg { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.pp-btn-primary { background: var(--red); color: #fff; }
.pp-btn-primary:hover { background: var(--red-dark); }
.pp-btn-primary:hover svg { transform: translateX(3px); }
.pp-btn-primary[aria-disabled="true"] { background: #c9d2dd; color: #fff; box-shadow: none; }
.pp-btn-primary.is-ready { box-shadow: 0 8px 22px rgba(186, 8, 11, .35); animation: pp-ready .6s var(--ease); }
.pp-btn-primary.is-loading { opacity: .75; pointer-events: none; }
.pp-btn-primary.is-loading span::after { content: "..."; }
.pp-btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); cursor: pointer; }
.pp-btn-ghost:hover { border-color: var(--navy); }
@keyframes pp-ready { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- Header ---------- */
.pp-header {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
  transition: box-shadow .25s;
}
.pp-header.is-scrolled { box-shadow: 0 6px 20px rgba(6, 49, 91, .08); }
.pp-header-inner {
  max-width: 1320px; margin: 0 auto; height: var(--header-h); padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
}
.pp-logo img { height: 46px; width: auto; display: block; }
.pp-logo { font-family: "Outfit"; font-weight: 800; color: var(--red); text-decoration: none; }
.pp-header-product { display: flex; flex-direction: column; padding-left: 24px; border-left: 1px solid var(--line); min-width: 0; }
.pp-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.pp-header-title { font-family: "Outfit"; font-weight: 700; font-size: 19px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-header-progress { margin-left: auto; width: 240px; }
.pp-progress-text { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.pp-progress-text strong { color: var(--navy); font-size: 16px; }
.pp-progress { height: 8px; border-radius: 99px; background: #e6ebf1; overflow: hidden; }
.pp-progress-fill {
  display: block; height: 100%; width: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--red));
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}
.js-total { display: inline-block; }
.js-total.is-bump { animation: pp-bump .35s var(--ease); }
@keyframes pp-bump { 50% { transform: scale(1.25); color: var(--red); } }

/* ---------- Layout ---------- */
.pp-layout {
  max-width: 1320px; margin: 0 auto; padding: 28px 24px 120px;
  display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start;
}
.pp-side { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; }
.pp-side-card, .pp-drop { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Drop zone */
.pp-drop { padding: 14px; transition: transform .25s var(--ease), box-shadow .25s; }
.pp-drop-target {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 30px 18px; border: 2px dashed #c7d2df; border-radius: 12px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.pp-drop-target:hover, .pp-drop.is-over .pp-drop-target { border-color: var(--red); background: var(--red-soft); }
.pp-drop.is-over { transform: scale(1.02); box-shadow: var(--shadow-lg); }
#pp-file:focus-visible + .pp-drop-target { outline: 3px solid rgba(186, 8, 11, .45); outline-offset: 2px; }
.pp-drop-icon {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red-soft); color: var(--red); margin-bottom: 6px; transition: transform .3s var(--ease);
}
.pp-drop-icon svg { width: 30px; height: 30px; }
.pp-drop-target:hover .pp-drop-icon, .pp-drop.is-over .pp-drop-icon { transform: translateY(-3px) rotate(-4deg); }
.pp-drop-title { font-family: "Outfit"; font-weight: 700; font-size: 18px; color: var(--navy); }
.pp-drop-hint { font-size: 13px; color: var(--muted); }
.pp-drop-hint u { color: var(--red); text-underline-offset: 2px; }
.pp-default-size { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 2px; font-size: 14px; color: var(--muted); }
.pp-default-size { flex-wrap: wrap; }
.pp-size-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-size-pick button {
  min-height: 36px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--navy); font-weight: 700; font-size: 13px; transition: border-color .2s, background .2s, color .2s;
}
.pp-size-pick button:hover { border-color: var(--navy); }
.pp-size-pick button[aria-checked="true"] { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.pp-upload-status { padding: 12px 4px 2px; font-size: 14px; color: var(--navy); font-weight: 600; }
.pp-upload-status .pp-progress { margin-top: 8px; }
.pp-upload-status .pp-progress-fill { transition: transform .2s linear; }

/* Summary + thumbnails */
.pp-summary { padding: 18px; }
.pp-summary-count { font-family: "Outfit"; color: var(--navy); line-height: 1; }
.pp-summary-count strong { font-size: 40px; font-weight: 800; }
.pp-summary-count span { font-size: 20px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.pp-summary-msg { margin: 8px 0 0; font-size: 14px; color: var(--muted); transition: color .2s; }
.pp-summary-msg.is-done { color: var(--ok); font-weight: 700; }
.pp-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; max-height: 300px; overflow-y: auto; }
.pp-thumbs:empty { display: none; }
.pp-thumb {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; overflow: hidden;
  background: #e9eef4; animation: pp-pop .35s var(--ease) both;
}
.pp-thumb img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-thumb::before { /* spinner behind an image that's still loading */
  content: ""; position: absolute; inset: 50% auto auto 50%; width: 18px; height: 18px; margin: -9px;
  border: 2px solid rgba(6, 49, 91, .15); border-top-color: var(--red); border-radius: 50%;
  animation: pp-spin .8s linear infinite;
}
.pp-thumb-qty {
  position: absolute; right: 4px; bottom: 4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center;
}
.pp-thumb.is-pending::before { display: none; }
.pp-thumb.is-pending img { opacity: .4; filter: grayscale(.6); }
.pp-thumb-status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.pp-thumb-pct { font-size: 11px; font-weight: 800; color: var(--navy); background: rgba(255, 255, 255, .9); border-radius: 99px; padding: 0 6px; }
.pp-spinner { width: 18px; height: 18px; border: 2px solid rgba(6, 49, 91, .2); border-top-color: var(--red); border-radius: 50%; animation: pp-spin .8s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }
@keyframes pp-pop { from { opacity: 0; transform: scale(.85); } }

/* ---------- Content ---------- */
.pp-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.pp-toolbar h1 { font-size: 30px; font-weight: 800; }
.pp-sub { margin: 4px 0 0; color: var(--muted); max-width: 640px; }
.pp-view-toggle { display: inline-flex; background: #fff; border-radius: 12px; padding: 4px; box-shadow: var(--shadow); flex-shrink: 0; }
.pp-view-toggle button { width: 40px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); display: grid; place-items: center; transition: background .2s, color .2s; }
.pp-view-toggle button svg { width: 20px; height: 20px; }
.pp-view-toggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* Empty state */
.pp-empty { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; padding: 56px 24px; }
.pp-has-photos .pp-empty { display: none; }
.pp-empty h2 { font-size: 22px; margin-top: 22px; }
.pp-empty p { color: var(--muted); margin: 6px 0 20px; }
.pp-empty-art { position: relative; width: 150px; height: 104px; margin: 0 auto; }
.pp-empty-art span {
  position: absolute; inset: 0; margin: auto; width: 96px; height: 72px; border-radius: 6px;
  background: linear-gradient(160deg, #dbe4ee, #f6f8fb); border: 5px solid #fff; box-shadow: 0 8px 20px rgba(6, 49, 91, .14);
  animation: pp-fan 3.2s var(--ease) infinite alternate;
}
.pp-empty-art span:nth-child(1) { --r: -14deg; --x: -26px; }
.pp-empty-art span:nth-child(2) { --r: 9deg; --x: 24px; animation-delay: .15s; }
.pp-empty-art span:nth-child(3) { --r: -2deg; --x: 0px; background: linear-gradient(160deg, #f9d9d9, #fff); animation-delay: .3s; }
@keyframes pp-fan { from { transform: rotate(0) translateX(0); } to { transform: rotate(var(--r)) translateX(var(--x)); } }

/* Photo cards */
.pp-cards { display: grid; gap: 14px; }
.pp-card {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; padding: 14px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: opacity .35s var(--ease), transform .35s var(--ease), box-shadow .25s;
}
.pp-card:hover { box-shadow: 0 2px 4px rgba(6, 49, 91, .06), 0 14px 32px rgba(6, 49, 91, .1); }
.pp-card.is-entering { opacity: 0; transform: translateY(14px) scale(.98); }
.pp-card.is-leaving { opacity: 0; transform: scale(.96); }
.pp-card.is-flash { animation: pp-flash 1s var(--ease); }
@keyframes pp-flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 3px var(--red), var(--shadow-lg); } }
.pp-card-photo {
  position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #e9eef4;
  aspect-ratio: 1; cursor: zoom-in;
}
.pp-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.pp-card-photo:hover img { transform: scale(1.05); }
/* Adjust photo: plain prints show the print's shape (--ar from app.js); app.js places the img inside */
.pp-frame { position: absolute; inset: 0; overflow: hidden; display: block; }
.pp-card-photo:not(.has-mock .pp-card-photo) { display: grid; place-items: center; container-type: size; }
.pp-card-photo .pp-frame[style*="--ar"] {
  position: relative; inset: auto; width: min(100cqw, calc(100cqh * var(--ar))); aspect-ratio: var(--ar);
  border-radius: 3px; box-shadow: 0 4px 14px rgba(6, 22, 40, .18); background: #fff;
}
.pp-card-photo { cursor: pointer; }
.pp-card-photo img { -webkit-user-drag: none; user-select: none; }
@media (pointer: fine) { .pp-card-photo img { cursor: grab; } }
.pp-card.is-moving .pp-card-photo img { cursor: grabbing; }
.pp-cal-photo { position: relative; }
/* Move icon in the middle of the photo: tells people they can move it */
.pp-move-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(6, 22, 40, .45); box-shadow: 0 2px 10px rgba(6, 22, 40, .25); transition: opacity .2s, transform .2s;
}
.pp-move-hint svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pp-card-photo:hover .pp-move-hint { transform: translate(-50%, -50%) scale(1.1); background: rgba(6, 22, 40, .6); }
.pp-card.is-moving .pp-move-hint, .pp-adj-frame.is-moving .pp-move-hint, .pp-adj-frame.was-moved .pp-move-hint { opacity: 0; }
.pp-adj-frame .pp-move-hint { width: 58px; height: 58px; }
.pp-adj-frame .pp-move-hint svg { width: 32px; height: 32px; }
/* Calendar pages */
.pp-page { display: inline-flex; align-items: center; gap: 8px; margin-right: 10px; }
.pp-page span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pp-page select {
  font: inherit; font-family: "Outfit"; font-weight: 700; font-size: 17px; color: var(--navy);
  padding: 6px 30px 6px 12px; border: 2px solid var(--navy); border-radius: 10px; background: #fff; cursor: pointer;
}
.pp-is-calendar .pp-card[data-page=""] .pp-page select { border-color: var(--line); color: var(--muted); }
.pp-is-calendar .pp-qty, .pp-is-calendar .pp-lines-head span:last-child { display: none; }
.pp-is-calendar .pp-card-name { font-size: 13px; color: var(--muted); }

/* The Adjust photo window */
.pp-adjust {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 20px; background: #fff; color: var(--navy); opacity: 1;
  box-shadow: 0 30px 80px rgba(6, 22, 40, .35); overflow: auto;
}
.pp-adjust::backdrop { background: rgba(6, 22, 40, .6); }
.pp-adj-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.pp-adj-head h2 { margin: 0; font-family: "Outfit"; font-size: 20px; color: var(--navy); }
.pp-adj-x { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.pp-adj-stage {
  margin: 14px 20px 0; height: min(52vh, 420px); display: grid; place-items: center; container-type: size;
  border-radius: 14px; background: repeating-conic-gradient(#eef2f7 0 25%, #f7f9fc 0 50%) 0 0 / 22px 22px;
}
.pp-adj-frame {
  position: relative; overflow: hidden; display: block; touch-action: none; cursor: grab;
  width: min(92cqw, calc(92cqh * var(--ar, 1))); aspect-ratio: var(--ar, 1);
  background: #fff; box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(6, 22, 40, .25), 0 10px 30px rgba(6, 22, 40, .25);
}
.pp-adj-frame.is-round { border-radius: 50%; }
.pp-adj-frame.is-moving { cursor: grabbing; }
.pp-adj-frame img { user-select: none; -webkit-user-drag: none; pointer-events: none; }
.pp-adj-hint { margin: 10px 20px 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.pp-adj-tools { display: grid; gap: 10px; padding: 14px 20px 0; }
.pp-adj-row { display: grid; grid-template-columns: 92px 40px 1fr 40px; align-items: center; gap: 10px; }
.pp-adj-row input { width: 100%; accent-color: var(--red); }
.pp-adj-label { font-size: 13px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .05em; }
.pp-adj-deg { display: inline-block; min-width: 3.2em; margin-left: 4px; font-variant-numeric: tabular-nums; color: var(--red); cursor: pointer; text-transform: none; }
.pp-adj-round svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.pp-adj-round { display: grid; place-items: center; }
.pp-adj-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); font-weight: 700; font-size: 12px; cursor: pointer;
}
.pp-adj-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pp-adj-btn:hover, .pp-adj-round:hover { border-color: var(--navy); }
.pp-adj-zoom { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; max-width: 280px; }
.pp-adj-zoom input { flex: 1; accent-color: var(--red); }
.pp-adj-round {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  color: var(--navy); font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer;
}
.pp-adj-actions { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 20px; }
.pp-adj-reset { border: 0; background: none; color: var(--navy); text-decoration: underline; font-weight: 600; cursor: pointer; }
.pp-card-body { display: flex; flex-direction: column; min-width: 0; padding: 4px 4px 4px 0; container-type: inline-size; }
.pp-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pp-card-name { font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.pp-card-remove {
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted);
  display: grid; place-items: center; transition: background .2s, color .2s;
}
.pp-card-remove svg { width: 19px; height: 19px; }
.pp-card-remove:hover { background: var(--red-soft); color: var(--red); }
.pp-lines-head, .pp-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; gap: 14px; align-items: center; }
.pp-lines-head { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); padding-bottom: 6px; }
.pp-lines-head span:last-child { grid-column: 2; text-align: center; }
.pp-lines { display: grid; gap: 8px; }
.pp-line { padding: 8px 0; border-top: 1px solid #edf1f5; }
.pp-line:first-child { border-top: 0; }
.pp-line.is-new { animation: pp-line-in .45s var(--ease); }
@keyframes pp-line-in { from { opacity: 0; transform: translateY(-8px); background: var(--red-soft); } }

.pp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-chip, .pp-chip-static {
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff;
  font-weight: 700; font-size: 14px; color: var(--navy);
  transition: border-color .2s, background .2s, color .2s, transform .15s var(--ease);
}
.pp-chip-static { display: inline-flex; align-items: center; background: #f6f8fb; }
.pp-chip:hover:not(:disabled) { border-color: var(--navy); }
.pp-chip:active:not(:disabled) { transform: scale(.96); }
.pp-chip[aria-checked="true"] { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.pp-chip:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

.pp-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.pp-qty-btn { width: 40px; height: 40px; border: 0; background: none; font-size: 20px; font-weight: 700; color: var(--navy); transition: background .15s; }
.pp-qty-btn:hover:not(:disabled) { background: #f0f4f8; }
.pp-qty-btn:disabled { color: #c3ccd7; cursor: not-allowed; }
.pp-qty input {
  width: 52px; height: 40px; border: 0; text-align: center; font-weight: 800; font-size: 16px; color: var(--navy);
  -moz-appearance: textfield; appearance: textfield;
}
.pp-qty input::-webkit-inner-spin-button, .pp-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pp-line-remove { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 22px; line-height: 1; }
.pp-line-remove:hover { background: var(--red-soft); color: var(--red); }
.pp-add-size {
  align-self: flex-start; margin-top: 10px; padding: 8px 14px; border-radius: 10px; border: 1.5px dashed #c7d2df;
  background: none; color: var(--navy); font-weight: 700; font-size: 14px; transition: border-color .2s, color .2s, background .2s;
}
.pp-add-size:hover:not(:disabled) { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.pp-add-size:disabled { opacity: .45; cursor: not-allowed; }
.pp-add-size[hidden] { display: none; }

/* Product mockups (mug / keyring) */
.pp-card.has-mock { grid-template-columns: 300px minmax(0, 1fr); }
.has-mock .pp-card-photo { background: radial-gradient(circle at 50% 35%, #fff 0%, #eef2f7 55%, #dfe6ee 100%); }
.has-mock .pp-card-photo:hover img { transform: none; }
.pp-mocks { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pp-mock { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: grid; place-items: center; --step: 0; }
/* Several sizes of one photo: smaller mockups side by side, each with its size name */
.pp-mocks[data-n="2"] .pp-key { width: 74%; }
.pp-mocks[data-n="3"] .pp-key { width: 84%; }
.pp-mocks:not([data-n="1"]) .pp-mug { width: 64%; margin-right: 16%; }
.pp-mock-cap {
  position: absolute; bottom: 9%; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 2px 9px; border-radius: 99px; background: #fff; color: var(--navy); font-size: 12px; font-weight: 700;
  box-shadow: 0 1px 4px rgba(6, 22, 40, .15);
}
.pp-mug, .pp-key { position: relative; display: block; transition: transform .5s var(--ease); }
.pp-mug { width: 66%; aspect-ratio: .9; transform: scale(calc(1 + var(--step) * .05), calc(1 + var(--step) * .12)); }
.pp-mug-body {
  position: absolute; inset: 0; overflow: hidden; z-index: 1;
  border-radius: 4% 4% 16% 16% / 3% 3% 9% 9%; background: #fff;
  box-shadow: 0 18px 24px -14px rgba(6, 22, 40, .45), inset 0 -3px 0 #d6dce4;
}
.pp-print { position: absolute; left: 8%; width: 84%; aspect-ratio: 1; top: 50%; transform: translateY(-50%); overflow: hidden; container-type: size; }
.pp-print img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* cylinder shading + rim on top of the print */
.pp-mug-body::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 50% 5% at 50% 0, #c9d0d9 0 70%, transparent 72%),
    linear-gradient(90deg, rgba(20, 30, 45, .35), rgba(20, 30, 45, .05) 18%, rgba(255, 255, 255, .45) 32%, rgba(255, 255, 255, 0) 46%, rgba(20, 30, 45, 0) 70%, rgba(20, 30, 45, .38));
}
.pp-mug-handle {
  position: absolute; right: -27%; top: 16%; width: 40%; height: 68%; /* box matches the 40x76 drawing: no stretching */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 76'%3E%3Cdefs%3E%3Cfilter id='s'%3E%3CfeGaussianBlur stdDeviation='0.45'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='0.9'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cg filter='url(%23s)'%3E%3Cpath d='M6 13C26 11 34 22 34 38S26 64 6 63' stroke='%23bfc8d2' stroke-width='10'/%3E%3Cpath d='M6 13C26 11 34 22 34 38S26 64 6 63' stroke='%23d6dde5' stroke-width='8'/%3E%3Cpath d='M6 13C26 11 34 22 34 38S26 64 6 63' stroke='%23e6ebf0' stroke-width='5.6'/%3E%3Cpath d='M6 13C26 11 34 22 34 38S26 64 6 63' stroke='%23f1f4f7' stroke-width='3.2'/%3E%3C/g%3E%3Cpath d='M7 11.6C25.5 9.8 33 20 33.2 34' stroke='%23fff' stroke-width='2.4' filter='url(%23b)'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / 100% 100%;
  filter: drop-shadow(3px 5px 5px rgba(6, 22, 40, .16));
}
.pp-key { width: 52%; aspect-ratio: .8; display: flex; flex-direction: column; align-items: center; }
.pp-key-ring {
  width: 34%; aspect-ratio: 1; border-radius: 50%; margin-bottom: -4%; position: relative; z-index: 0;
  border: 4px solid #b8c0ca; box-shadow: inset 0 0 0 1px #e8ecf1, 0 2px 3px rgba(6, 22, 40, .2);
}
.pp-key-charm {
  position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; z-index: 1;
  border-radius: 50%; border: 5px solid #c5ccd5; background: #fff;
  box-shadow: 0 14px 20px -10px rgba(6, 22, 40, .45), inset 0 0 0 2px #eef1f4;
  transition: border-radius .4s var(--ease);
}
.pp-key-charm.pp-print { position: relative; left: auto; top: auto; transform: none; }
.pp-key-photo { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.pp-key-charm::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 40%); }
/* Calendar page: wall = portrait with spiral binding, desk = landscape on a stand */
.pp-cal { position: relative; display: block; width: 50%; filter: drop-shadow(0 14px 14px rgba(6, 22, 40, .22)); }
.pp-cal-page { position: relative; display: flex; flex-direction: column; gap: 5%; aspect-ratio: .72; padding: 13% 7% 7%; background: #fff; border-radius: 3px; }
.pp-cal-page::before { /* spiral binding */
  content: ""; position: absolute; left: 6%; right: 6%; top: -3%; height: 9%;
  background: radial-gradient(ellipse 40% 55% at 50% 50%, transparent 52%, #6b7683 56% 72%, transparent 76%) 0 0 / 8.33% 100% repeat-x;
}
.pp-cal-photo { flex: none; aspect-ratio: 1.4142; overflow: hidden; } /* same shape as Design::aspect() */
.pp-cal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-cal-grid { flex: 1; background: radial-gradient(circle, #b9c2cd 0 1.6px, transparent 2.2px) 0 0 / 14.28% 20%, linear-gradient(#0a2f57, #0a2f57) 0 0 / 34% 3px no-repeat; background-position: 0 4px, 0 0; }
.pp-mock-calendar[data-shape="desk"] .pp-cal { width: 74%; }
.pp-mock-calendar[data-shape="desk"] .pp-cal-page { aspect-ratio: 1.42; padding: 8% 5% 5%; flex-direction: row; gap: 5%; }
.pp-mock-calendar[data-shape="desk"] .pp-cal-photo { height: 100%; aspect-ratio: 1; }
.pp-mock-calendar[data-shape="desk"] .pp-cal-page::before { top: -4%; height: 12%; }
.pp-mock-calendar[data-shape="desk"] .pp-cal::after { /* stand */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -9%; height: 10%; z-index: -1;
  background: linear-gradient(#2b3540, #4a5562); clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%); border-radius: 2px;
}
/* Christmas ball: glass bauble with a gold cap */
.pp-ball { width: 56%; display: flex; flex-direction: column; align-items: center; position: relative; }
.pp-ball-loop { width: 13%; aspect-ratio: 1; border-radius: 50%; border: 3px solid #c9a64a; margin-bottom: -3%; }
.pp-ball-cap {
  width: 24%; height: 0; padding-bottom: 13%; position: relative; z-index: 2; margin-bottom: -4%;
  border-radius: 4px 4px 3px 3px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .1) 0 2px, transparent 2px 6px), linear-gradient(90deg, #9a7623, #f3d77e 35%, #fff2c2 48%, #d7ae4b 65%, #8c6a1e);
  box-shadow: 0 2px 3px rgba(6, 22, 40, .3);
}
.pp-ball-body.pp-print {
  position: relative; left: auto; top: auto; transform: none; width: 100%; aspect-ratio: 1; z-index: 1;
  border-radius: 50%; overflow: hidden; background: #fff;
  box-shadow: 0 18px 24px -12px rgba(6, 22, 40, .5);
}
.pp-ball-body::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .85) 0 5%, rgba(255, 255, 255, .25) 13%, transparent 30%),
    radial-gradient(circle at 50% 45%, transparent 55%, rgba(6, 22, 40, .38) 100%);
}
.pp-mock[data-shape="square"] .pp-key-charm { border-radius: 14%; }
.pp-mock[data-shape="heart"] .pp-key-charm {
  border: 0; border-radius: 0; box-shadow: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 92 10 52C-6 34 6 8 28 8c10 0 18 6 22 14C54 14 62 8 72 8c22 0 34 26 18 44Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 92 10 52C-6 34 6 8 28 8c10 0 18 6 22 14C54 14 62 8 72 8c22 0 34 26 18 44Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pp-mock[data-shape="heart"] .pp-key { filter: drop-shadow(0 0 1.5px #9aa4b0) drop-shadow(0 10px 10px rgba(6, 22, 40, .25)); }
/* Rectangle keyring ("4x6cm"): portrait charm in the print's own shape (--ar = width/height) */
.pp-mock[data-shape="rect"] .pp-key { width: 40%; aspect-ratio: auto; }
.pp-mock[data-shape="rect"] .pp-key-ring { width: 44%; }
.pp-mock[data-shape="rect"] .pp-key-charm { aspect-ratio: var(--ar); border-radius: 9%; }
/* Colour in the size name: keyring edge, mug inside and handle */
.pp-mock[data-tint] .pp-key-charm { border-color: var(--tint); }
.pp-mock[data-tint] .pp-mug-body::after {
  background:
    radial-gradient(ellipse 50% 5% at 50% 0, var(--tint) 0 70%, transparent 72%),
    linear-gradient(90deg, rgba(20, 30, 45, .35), rgba(20, 30, 45, .05) 18%, rgba(255, 255, 255, .45) 32%, rgba(255, 255, 255, 0) 46%, rgba(20, 30, 45, 0) 70%, rgba(20, 30, 45, .38));
}
.pp-mock[data-tint] .pp-mug-handle {
  background: linear-gradient(90deg, rgba(255, 255, 255, .3), rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .25)), var(--tint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 76'%3E%3Cpath d='M6 13C26 11 34 22 34 38S26 64 6 63' fill='none' stroke='%23000' stroke-width='10' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 76'%3E%3Cpath d='M6 13C26 11 34 22 34 38S26 64 6 63' fill='none' stroke='%23000' stroke-width='10' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.is-grid .has-mock .pp-card-photo { aspect-ratio: 1; position: relative; top: 0; }

@font-face { font-family: 'pp-classic'; src: url('../fonts/FiraSans-Bold.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'pp-rounded'; src: url('../fonts/Comfortaa.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'pp-elegant'; src: url('../fonts/EBGaramond.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'pp-hand'; src: url('../fonts/Mansalva-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }

/* Text on the product */
.pp-mock-text {
  position: absolute; z-index: 2; transform: translate(-50%, -50%);
  font-size: calc(var(--fs, 12) * 1cqw); font-weight: 400; line-height: 1.15; white-space: pre; text-align: center;
  text-shadow: 0 .04em 0 rgba(0, 0, 0, .3); cursor: grab; touch-action: none; user-select: none;
}
.pp-mock-text[hidden] { display: none; }
.pp-mock-text.is-dragging { cursor: grabbing; }
.is-editing .pp-mock-text { outline: 1.5px dashed rgba(255, 255, 255, .85); outline-offset: .15em; }
.pp-text-toggle {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-top: 14px; padding: 9px 16px 9px 10px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); font-weight: 700; font-size: 14px;
  transition: border-color .2s, background .2s, color .2s;
}
.pp-text-toggle:hover, .pp-text-toggle[aria-expanded="true"] { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.pp-text-toggle-aa { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 13px; }
.pp-editor { margin-top: 12px; padding: 16px; border-radius: 14px; background: #f5f8fb; display: grid; gap: 8px; animation: pp-dialog .3s var(--ease); }
.pp-editor[hidden] { display: none; }
.pp-ed-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.pp-ed-hint, .pp-ed-count { text-transform: none; letter-spacing: 0; font-weight: 500; }
.pp-ed-text {
  width: 100%; resize: none; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font: inherit; font-size: 16px; color: var(--navy); line-height: 1.35;
}
.pp-ed-text:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(6, 49, 91, .12); }
.pp-ed-fonts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pp-ed-font {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy);
  transition: border-color .2s, background .2s;
}
.pp-ed-font-aa { font-size: 22px; line-height: 1.1; }
.pp-ed-font-name { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pp-ed-font[aria-checked="true"], .pp-ed-pos .is-active { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.pp-ed-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; align-items: start; }
.pp-ed-colors { display: flex; gap: 8px; padding-top: 2px; }
.pp-ed-color {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(6, 22, 40, .18); transition: transform .15s;
}
.pp-ed-color:hover { transform: scale(1.1); }
.pp-ed-color[aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(6, 22, 40, .18), 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.pp-ed-size { width: 100%; margin-top: 10px; accent-color: var(--red); }
.pp-ed-pos { display: flex; gap: 8px; }
.pp-ed-pos button { flex: 1; min-height: 38px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); font-weight: 700; font-size: 14px; }
.pp-ed-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.pp-ed-remove { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: underline; padding: 6px 0; }
.pp-ed-remove:hover { color: var(--red); }
.pp-card.has-mock { align-items: start; }
.has-mock .pp-card-photo { position: sticky; top: 96px; }

/* Select tick: photos can be uploaded and left out of the order */
.pp-card { position: relative; }
.pp-select {
  position: absolute; z-index: 3; top: 22px; left: 22px; width: 32px; height: 32px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(6, 22, 40, .3);
  display: grid; place-items: center; transition: background .2s, transform .2s;
}
.pp-select svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pp-select[aria-checked="false"] { background: rgba(255, 255, 255, .85); color: transparent; border-color: #fff; }
.pp-select:hover { transform: scale(1.1); }
.pp-card.is-off .pp-card-photo, .pp-card.is-off .pp-lines { opacity: .45; filter: grayscale(.6); transition: opacity .25s, filter .25s; }
.pp-thumb.is-off img { opacity: .35; filter: grayscale(1); }
.pp-thumb.is-off .pp-thumb-qty { display: none; }

/* Narrow cards (grid view, small screens): stack sizes above the quantity, compact editor */
@container (max-width: 440px) {
  .pp-lines-head { display: none; }
  .pp-line, .is-grid .pp-line { grid-template-columns: 1fr auto; gap: 8px; }
  .pp-line .pp-line-opts { grid-column: 1 / -1; }
  .pp-line .pp-qty { justify-self: start; }
  .pp-line-remove-spacer { display: none; }
  .pp-ed-fonts { grid-template-columns: repeat(2, 1fr); }
  .pp-ed-grid { grid-template-columns: 1fr; }
  .pp-ed-size { margin-top: 4px; }
}

/* Grid view */
.is-grid .pp-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.is-grid .pp-card { grid-template-columns: 1fr; gap: 12px; }
.is-grid .pp-card-photo { aspect-ratio: 4 / 3; }
.is-grid .pp-card-body { padding: 0 2px 2px; }
.is-grid .pp-lines-head, .is-grid .pp-line { grid-template-columns: 1fr auto 28px; gap: 8px; }
.is-grid .pp-chip { padding: 0 10px; min-height: 36px; font-size: 13px; }
.is-grid .pp-qty-btn { width: 34px; height: 36px; }
.is-grid .pp-qty input { width: 38px; height: 36px; }

/* ---------- Dialogs & toasts ---------- */
dialog { border: 0; padding: 0; background: none; color: inherit; }
dialog::backdrop { background: rgba(6, 22, 40, .7); backdrop-filter: blur(3px); }
dialog[open] { animation: pp-dialog .3s var(--ease); }
@keyframes pp-dialog { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.pp-lightbox { max-width: min(92vw, 1100px); max-height: 90vh; }
.pp-lightbox img { display: block; max-width: 100%; max-height: 90vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
.pp-lightbox-close {
  position: fixed; top: 18px; right: 22px; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: #fff; color: var(--navy); font-size: 28px; line-height: 1; box-shadow: var(--shadow);
}
.pp-confirm { background: #fff; border-radius: var(--radius); padding: 26px; width: min(92vw, 400px); box-shadow: var(--shadow-lg); }
.pp-confirm-msg { margin: 0 0 20px; font-family: "Outfit"; font-weight: 700; font-size: 20px; color: var(--navy); }
.pp-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.pp-toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.pp-toast {
  padding: 14px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: pp-toast-in .35s var(--ease); transition: opacity .4s, transform .4s var(--ease);
}
.pp-toast.is-error { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1.5px rgba(186, 8, 11, .35), var(--shadow-lg); }
.pp-toast.is-success { background: var(--ok); }
.pp-toast.is-leaving { opacity: 0; transform: translateX(20px); }
@keyframes pp-toast-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Mobile ---------- */
.pp-mobilebar { display: none; }
@media (max-width: 960px) {
  .pp-layout { grid-template-columns: 1fr; padding: 16px 14px 120px; gap: 16px; }
  .pp-side { position: static; }
  .pp-header-progress, .pp-header .js-complete { display: none; }
  .pp-header-inner { padding: 0 16px; gap: 14px; --header-h: 64px; height: 64px; }
  .pp-logo img { height: 38px; }
  .pp-header-product { padding-left: 14px; }
  .pp-header-title { font-size: 16px; }
  .pp-drop-target { padding: 22px 14px; }
  .pp-thumbs { grid-template-columns: repeat(6, 1fr); max-height: 150px; }
  .pp-summary { padding: 14px 16px; }
  .pp-summary-count strong { font-size: 30px; }
  .pp-toolbar h1 { font-size: 24px; }
  .pp-mobilebar {
    display: flex; align-items: center; gap: 14px; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -8px 24px rgba(6, 49, 91, .12);
  }
  .pp-mobilebar-text { flex: 1; font-size: 14px; color: var(--muted); }
  .pp-mobilebar-text strong { color: var(--navy); font-size: 17px; }
  .pp-mobilebar .pp-progress { margin-top: 6px; }
  .pp-toasts { bottom: 90px; }
}
@media (max-width: 600px) {
  .pp-card.has-mock { grid-template-columns: 1fr; }
  .has-mock .pp-card-photo { max-width: 300px; width: 100%; justify-self: center; position: relative; top: 0; }
  /* the photo is centred (max 300px), so place the tick from the photo's corner, not the card's */
  .has-mock .pp-select { left: max(20px, calc(50% - 142px)); top: 20px; }
  .pp-ed-fonts { grid-template-columns: repeat(2, 1fr); }
  .pp-ed-grid { grid-template-columns: 1fr; }
  .pp-card { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .pp-card-photo { align-self: start; }
  .pp-lines-head { display: none; }
  .pp-line { grid-template-columns: 1fr auto; gap: 8px; }
  .pp-line .pp-line-opts { grid-column: 1 / -1; }
  .pp-line .pp-qty { justify-self: start; }
  .pp-line-remove-spacer { display: none; }
  .pp-chip { padding: 0 12px; min-height: 38px; font-size: 13px; }
  .pp-view-toggle { display: none; }
  .is-grid .pp-cards { grid-template-columns: 1fr; }
  .pp-thumbs { grid-template-columns: repeat(5, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .pp-thumb::before, .pp-spinner { animation: pp-spin 2.4s linear infinite !important; }
}

/* Change photo: swaps the picture, keeps sizes / quantities / text. */
.pp-card-replace {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line, #e3e8ef);
  border-radius: 10px; background: #fff; color: var(--navy); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.pp-card-replace svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pp-card-replace:hover { background: var(--mist, #f4f7fa); border-color: var(--navy); }
.pp-card.is-replacing { pointer-events: none; }
.pp-card.is-replacing .pp-card-photo { opacity: .45; }
.pp-card.is-replacing .pp-card-photo::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid rgba(6, 49, 91, .2); border-top-color: var(--red); border-radius: 50%; animation: pp-spin .8s linear infinite;
}
/* Narrow cards (phones): name on its own line, then the photo actions with their words */
@container (max-width: 440px) {
  .pp-card-head { flex-wrap: wrap; row-gap: 8px; }
  .pp-card-name { flex-basis: 100%; }
  .pp-card-replace { height: 40px; font-size: 14px; }
  .pp-card-remove { margin-left: auto; }
}

/* Text and 3D buttons side by side under the sizes */
.pp-card-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pp-card-tools .pp-text-toggle { margin-top: 0; }
.pp-3d {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 10px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--navy); font: inherit; font-weight: 700; font-size: 14px; transition: border-color .2s, background .2s, color .2s;
}
.pp-3d:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.pp-3d:disabled { opacity: .6; }
.pp-3d-badge { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--red); color: #fff; font-size: 11px; letter-spacing: .02em; }
.pp-dup:disabled { opacity: .6; }
.pp-mock[data-shape="heart"] .pp-key-ring { margin-bottom: -24%; } /* hook the ring into the dip of the heart */

/* Change photo: upload new or reuse one already in the order */
.pp-pick { background: #fff; color: var(--navy); width: min(92vw, 520px); max-height: 86vh; border: 0; border-radius: 20px; padding: 20px 22px 22px; box-shadow: var(--shadow-lg, 0 30px 80px rgba(0,0,0,.3)); animation: pp-dialog .3s var(--ease); }
.pp-pick::backdrop { background: rgba(6, 20, 40, .55); }
.pp-pick-head { display: flex; align-items: center; justify-content: space-between; color: var(--navy); font-size: 18px; }
.pp-pick-x { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--mist, #f4f7fa); color: var(--navy); display: grid; place-items: center; }
.pp-pick-note { margin: 4px 0 16px; color: var(--muted); font-size: 14px; }
.pp-pick-upload { width: 100%; justify-content: center; }
.pp-pick-label { margin: 20px 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pp-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pp-pick-item { padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: #e9eef4; cursor: pointer; transition: border-color .2s, transform .2s; }
.pp-pick-item:hover, .pp-pick-item:focus-visible { border-color: var(--red); transform: scale(1.03); }
.pp-pick-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (pointer: coarse) { .pp-ed-color { width: 38px !important; height: 38px !important; } .pp-ed-colors { gap: 10px; flex-wrap: wrap; } }
/* Heart keyring: metal border like the round and square ones (charm = border colour, photo = smaller heart) */
.pp-mock[data-shape="heart"] .pp-key-charm { background: #c5ccd5; }
.pp-mock[data-shape="heart"] .pp-key-photo { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 92 10 52C-6 34 6 8 28 8c10 0 18 6 22 14C54 14 62 8 72 8c22 0 34 26 18 44Z'/%3E%3C/svg%3E") center / 86% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 92 10 52C-6 34 6 8 28 8c10 0 18 6 22 14C54 14 62 8 72 8c22 0 34 26 18 44Z'/%3E%3C/svg%3E") center / 86% no-repeat; }

/* Phones and tablets: no drag and drop, so a compact "Add photos" button instead of the big drop area */
@media (pointer: coarse) {
  .pp-drop-target {
    flex-direction: row; justify-content: center; gap: 10px; min-height: 56px; padding: 12px 18px;
    border: 0; border-radius: 14px; background: var(--red); color: #fff; flex-wrap: wrap;
  }
  .pp-drop-target:hover, .pp-drop.is-over .pp-drop-target { background: var(--red); }
  .pp-drop-icon { width: auto; height: auto; background: none; color: #fff; margin: 0; }
  .pp-drop-icon svg { width: 24px; height: 24px; }
  .pp-drop-title { color: #fff; font-size: 17px; }
  .pp-drop-hint { flex-basis: 100%; text-align: center; color: rgba(255, 255, 255, .85); font-size: 12px; margin-top: -4px; }
  .pp-drop-dnd { display: none; }
}
/* iPhone Safari: keep the tick dead-centre in the red circle */
.pp-select { -webkit-appearance: none; appearance: none; box-sizing: border-box; line-height: 0; font-size: 0; }
.pp-select svg { display: block; margin: auto; }

/* Heart keyring: the heart outline is narrower than a circle, so draw it larger to match round and square */
.pp-mock[data-shape="heart"] .pp-key-charm { width: 122%; margin-inline: -11%; }
.pp-mock[data-shape="heart"] .pp-key-ring { margin-bottom: -26%; }

/* Paper type + price per size (custom prints) */
.pp-line-opts { display: grid; gap: 8px; min-width: 0; }
.pp-chips-paper .pp-chip { font-size: 13px; }
.pp-line-price { font-size: 13px; color: var(--muted); font-weight: 600; }
.pp-summary-price { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0 2px; border-top: 1px solid #edf1f5; margin-top: 8px; font-weight: 600; }
.pp-summary-price strong { font-size: 22px; color: var(--red); }
.pp-paper-pick { margin-top: 6px; }
@media (max-width: 520px) {
  .pp-adj-row { grid-template-columns: 1fr 40px 2.4fr 40px; gap: 8px; }
  .pp-adj-stage { height: min(46vh, 380px); }
}
