/* Holographic sticker studio (inc/holo.php, assets/js/holo.js) */
@property --holo-a { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
.sm-holo { margin: 0; padding: 14px; border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--lift); color: var(--ink); }
.sm-holo [hidden] { display: none !important; }

/* stage: the label on a white pouch-like surface */
.sm-holo__stage { position: relative; display: grid; place-items: center; aspect-ratio: 1 / .86; margin: -4px -4px 0; padding-bottom: 56px; border-radius: calc(var(--r-lg) - 6px); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 30%, #ffffff 0%, #f4f6f9 55%, #e7ebf1 100%); }
.sm-holo__stage::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(12,31,61,.018) 0 1px, transparent 1px 4px); pointer-events: none; }
.sm-holo__sticker { --mx: .5; --my: .35; position: relative; width: min(62%, 340px); aspect-ratio: 1; border-radius: 50%; isolation: isolate; cursor: pointer; touch-action: manipulation;
  box-shadow: 0 0 0 1px rgba(12,31,61,.08), 0 2px 3px rgba(12,31,61,.12), 0 18px 34px -16px rgba(12,31,61,.45);
  transition: width var(--dur-3) var(--ease-out); }
.sm-holo.has-design .sm-holo__sticker { cursor: grab; touch-action: none; }
.sm-holo.has-design .sm-holo__sticker:active { cursor: grabbing; }
.sm-holo__stage.is-actual .sm-holo__sticker { width: 50mm; }

/* the foil: silver base, rainbow diffraction that slides with the light, fine brushed grain */
.sm-holo__foil { position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background:
    repeating-linear-gradient(calc(115deg + var(--mx) * 40deg), rgba(255,255,255,.22) 0 2px, rgba(255,255,255,0) 2px 5px),
    linear-gradient(calc(120deg + var(--holo-a) * .25), #ffd1ec 0%, #fff1c2 16%, #c9f7e4 32%, #bfe3ff 48%, #dccfff 64%, #ffd1ec 80%, #fff1c2 100%),
    radial-gradient(circle at 50% 50%, #f7f8fa, #d9dee6);
  background-size: 100% 100%, 260% 260%, 100% 100%;
  background-position: 0 0, calc(var(--mx) * 100%) calc(var(--my) * 100%), 0 0;
  background-blend-mode: soft-light, multiply, normal;
  filter: saturate(1.25) contrast(1.02);
  animation: sm-holo-spin 9s linear infinite; }
.sm-holo__foil::after { content: ''; position: absolute; inset: -20%;
  background: conic-gradient(from calc(var(--holo-a) + var(--mx) * 90deg) at calc(30% + var(--mx) * 40%) calc(25% + var(--my) * 40%),
    rgba(255,120,200,.35), rgba(255,230,120,.32), rgba(120,255,200,.3), rgba(110,190,255,.35), rgba(200,150,255,.32), rgba(255,120,200,.35));
  mix-blend-mode: color-dodge; opacity: .55; }
@keyframes sm-holo-spin { to { --holo-a: 360deg; } }

/* the print: the real 203 dpi file as matte near-black, on top of the foil's shine (thermal black barely reflects) */
.sm-holo__ink { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border-radius: 50%; image-rendering: auto; }
.sm-holo__glare { position: absolute; inset: 0; z-index: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at calc(var(--mx) * 100%) calc(var(--my) * 100%), rgba(255,255,255,.55), rgba(255,255,255,0) 42%),
    linear-gradient(calc(135deg + var(--mx) * 30deg), rgba(255,255,255,0) 35%, rgba(255,255,255,.28) 48%, rgba(255,255,255,0) 60%);
  mix-blend-mode: screen; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7), inset 0 -6px 14px rgba(12,31,61,.08); }

.sm-holo__tag { position: absolute; left: 12px; top: 12px; padding: 6px 10px; border-radius: var(--pill); background: rgba(255,255,255,.85); border: 1px solid var(--edge); font: 700 var(--fs-xs)/1.2 var(--f); color: var(--ink-2); }
.sm-holo__size { position: absolute; right: 12px; top: 12px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--edge-2); border-radius: var(--pill); background: rgba(255,255,255,.9); font: 700 var(--fs-xs)/1 var(--f); color: var(--ink); cursor: pointer; }
.sm-holo__size:focus-visible, .sm-holo__link:focus-visible { outline: 3px solid var(--laser); outline-offset: 2px; }

.sm-holo__status { margin: 12px 2px 0; min-height: 1.4em; font: 500 var(--fs-ui)/1.45 var(--f); color: var(--ink-2); }
.sm-holo__status.is-bad { color: var(--laser-deep); }

/* the upload button sits on the stage, under the sticker: the first thing to tap */
.sm-holo__drop { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; }
.sm-holo__drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sm-holo__upload { min-height: 50px; padding-inline: 26px; cursor: pointer; font-size: 16px; box-shadow: 0 10px 22px -10px rgba(194,65,12,.55); }
.sm-holo.has-design .sm-holo__upload { min-height: 42px; font-size: var(--fs-ui); background: rgba(255,255,255,.92); box-shadow: inset 0 0 0 1.5px var(--edge-2); }
.sm-holo__drop input:focus-visible + .sm-holo__upload { outline: 3px solid var(--laser); outline-offset: 2px; }

.sm-holo__tune { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--edge); }
.sm-holo__seg { display: inline-flex; width: fit-content; padding: 4px; gap: 4px; border: 1px solid var(--edge); border-radius: var(--pill); background: var(--frost); }
.sm-holo__seg label { position: relative; }
.sm-holo__seg input { position: absolute; opacity: 0; inset: 0; }
.sm-holo__seg span { display: block; min-height: 40px; padding: 10px 18px; border-radius: var(--pill); font: 700 var(--fs-ui)/1.4 var(--f); color: var(--ink-2); cursor: pointer; }
.sm-holo__seg input:checked + span { background: var(--ink); color: #fff; }
.sm-holo__seg input:focus-visible + span { outline: 3px solid var(--laser); outline-offset: 2px; }
.sm-holo__range { display: grid; grid-template-columns: 4.5em 1fr 4.5em; align-items: center; gap: 8px; font: 600 var(--fs-xs)/1.2 var(--f); color: var(--ink-3); }
.sm-holo__range span:last-child { text-align: right; }
.sm-holo__range input { width: 100%; accent-color: var(--ink); min-height: 32px; }
.sm-holo__hint { margin: 0; font: 500 var(--fs-sm)/1.4 var(--f); color: var(--ink-3); }
.sm-holo__link { padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }

.sm-holo__extra { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--edge); }
.sm-holo__extra summary { min-height: 40px; display: flex; align-items: center; gap: 6px; font: 700 var(--fs-ui)/1.3 var(--f); cursor: pointer; }
.sm-holo__extra .sm-field { display: grid; gap: 6px; margin-top: 10px; font: 600 var(--fs-sm)/1.3 var(--f); }
.sm-holo__extra input { min-height: 44px; padding: 10px 12px; border: 1px solid var(--edge-2); border-radius: var(--r-sm); font: 500 16px/1.2 var(--f); color: var(--ink); background: #fff; }

.sm-holo__qty { margin: 4px 0 14px; padding: 0; border: 0; min-width: 0; }
.sm-holo__qty legend { padding: 0; font: 800 var(--fs-md)/1.3 var(--f); }
.sm-holo__packs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.sm-holo__packs label { position: relative; }
.sm-holo__packs input { position: absolute; opacity: 0; inset: 0; }
.sm-holo__packs span { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; border: 1px solid var(--edge-2); border-radius: var(--r); background: #fff; cursor: pointer; transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out); }
.sm-holo__packs b { font: 800 18px/1 var(--f); }
.sm-holo__packs em { font: 600 var(--fs-xs)/1.2 var(--f); font-style: normal; color: var(--ink-3); }
.sm-holo__packs i { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 2px 7px; border-radius: var(--pill); background: var(--laser); color: #fff; font: 800 10px/1.4 var(--f); font-style: normal; white-space: nowrap; letter-spacing: .02em; }
.sm-holo__packs input:checked + span { border: 2px solid var(--ink); padding: 9px 3px 7px; background: var(--frost); }
.sm-holo__packs input:focus-visible + span { outline: 3px solid var(--laser); outline-offset: 2px; }
.sm-holo__stepper { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.sm-holo__other { margin-right: auto; font: 600 var(--fs-sm)/1.2 var(--f); color: var(--ink-3); }
.sm-holo__stepper button { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--edge-2); border-radius: 50%; background: #fff; font: 700 20px/1 var(--f); color: var(--ink); cursor: pointer; }
.sm-holo__qty .sm-holo__stepper input[type=text] { flex: 0 0 72px; width: 72px; min-height: 0; height: 44px; padding: 0; text-align: center; border: 1px solid var(--edge-2); border-radius: var(--r-sm); font: 800 18px/1 var(--f); color: var(--ink); -moz-appearance: textfield; }
.sm-holo__stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sm-holo__total { margin: 12px 0 4px; font: 800 var(--fs-md)/1.3 var(--f); color: var(--ink); }
.sm-holo__qty > small { display: block; font: 500 var(--fs-sm)/1.45 var(--f); }

@media (max-width: 480px) {
  .sm-holo { padding: 10px; }
  .sm-holo__packs { gap: 5px; }
  .sm-holo__packs span { padding: 9px 2px 7px; }
  .sm-holo__packs input:checked + span { padding: 8px 1px 6px; }
  .sm-holo__packs b { font-size: 16px; }
  .sm-holo__packs i { font-size: 9px; padding: 1px 5px; }
}

/* the panel replaces the photo until "Real photos" is chosen; one design per order, so no quantity box */
.sm-pd__media > .sm-holo:not([hidden]) ~ .woocommerce-product-gallery { display: none !important; }
form.cart:has([data-holo-buy]) .quantity { display: none !important; }
.sm-pd__media > .sm-holo { box-shadow: var(--lift); }
@media (prefers-reduced-motion: reduce) { .sm-holo__foil { animation: none; } .sm-holo__sticker { transition: none; } }
.sm-holo__sticker::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at calc(var(--mx) * 100%) calc(var(--my) * 100%), rgba(255,255,255,.12), rgba(255,255,255,0) 35%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
form.cart .sm-holo__qty { flex: 1 0 100%; width: 100%; }   /* the theme lays form.cart out as a row: pieces get their own line */
@media (min-width: 900px) {
  .sm-holo__stage { aspect-ratio: auto; height: clamp(380px, 34vw, 470px); }
  .sm-holo__sticker { width: min(58%, 300px); }
}
