/* ==========================================================================
   POP-UPS: every window that opens over the site (item view, Q&A, mail
   signup, the Airbrush Studio, the cart) looks like a comic speech bubble.
   CHANGE THE LOOK HERE - these numbers style all of them at once.
   ========================================================================== */
:root {
  --pop-outline: 4px;               /* outline thickness (0px = none) */
  --pop-outline-color: #1a1b1f;     /* outline colour */
  --pop-fill: #ffffff;              /* inside colour */
  --pop-corner: 3px;                /* corner rounding: 0px = square, 30px = very round */
  --pop-shadow: 7px 7px 0 #1a1b1f;  /* the solid comic shadow ("none" to remove) */
  --pop-tail: 26px;                 /* speech-bubble tail size (0px = no tail) */
  --pop-tail-left: 18%;             /* where the tail hangs, from the left edge */
  --pop-dim: rgba(14, 12, 20, 0.55);/* the darkening behind a pop-up */
  --pop-x-size: 40px;               /* the close button */
}

/* ---------------------------------------------------------------- the bubble */
.pop {
  position: relative;
  background: var(--pop-fill);
  border: var(--pop-outline) solid var(--pop-outline-color);
  border-radius: var(--pop-corner);
  box-shadow: var(--pop-shadow);
  box-sizing: border-box;
}
/* the tail: an outlined triangle under the box (two layers: outline, then fill) */
.pop::before,
.pop::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--pop-tail-left);
  width: 0;
  height: 0;
  pointer-events: none;
}
.pop::before {
  margin-top: 0;
  border-left: calc(var(--pop-tail) * 0.55 + var(--pop-outline)) solid transparent;
  border-right: calc(var(--pop-tail) * 0.25) solid transparent;
  border-top: calc(var(--pop-tail) + var(--pop-outline) * 1.6) solid var(--pop-outline-color);
  margin-left: calc(var(--pop-outline) * -1);
}
.pop::after {
  margin-top: calc(var(--pop-outline) * -1);
  border-left: calc(var(--pop-tail) * 0.55) solid transparent;
  border-right: calc(var(--pop-tail) * 0.25 - var(--pop-outline) * 0.5) solid transparent;
  border-top: var(--pop-tail) solid var(--pop-fill);
}
.pop.big::before,
.pop.big::after { display: none; }   /* the big windows (Studio) have no tail */

/* ---------------------------------------------------------------- the close button, on the bubble's corner */
.pop-x {
  position: absolute;
  top: calc(var(--pop-x-size) * -0.42);
  right: calc(var(--pop-x-size) * -0.42);
  z-index: 3;
  width: var(--pop-x-size);
  height: var(--pop-x-size);
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: var(--pop-outline) solid var(--pop-outline-color);
  border-radius: var(--pop-corner);
  background: var(--pop-fill);
  color: var(--pop-outline-color);
  font: 700 calc(var(--pop-x-size) * 0.5) / 1 system-ui, Arial, sans-serif;
  box-shadow: 3px 3px 0 var(--pop-outline-color);
  cursor: pointer;
  transform: none;
}
.pop-x:hover { background: var(--pop-outline-color); color: var(--pop-fill); }
.pop-x:active { transform: translate(2px, 2px); box-shadow: none; }

/* ---------------------------------------------------------------- the dim layer behind */
.product-view,
.modal-overlay,
.overlay.popup,
.layer.popup {
  background: var(--pop-dim);
  padding: calc(var(--pop-x-size) * 0.6 + 12px) 16px calc(var(--pop-tail) + 20px);
}

/* ---------------------------------------------------------------- each window */
/* item view (shirts, archive pieces) */
.pv-box.pop {
  overflow: visible;
  max-height: none;
  padding: 18px 18px 14px;
}
.pv-box.pop .pv-stage { width: min(100%, 46dvh); margin: 0 auto; }
.pv-box .pv-close.pop-x { position: absolute; left: auto; }

/* Q&A + Contact, and other pages in a bubble */
.popup-box.pop {
  overflow: visible;
  border-radius: var(--pop-corner);
}
.popup-box.pop iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: max(0px, calc(var(--pop-corner) - var(--pop-outline)));
  background: #fff;
}
/* the Airbrush Studio: a big window, nearly the whole screen */
.popup-box.pop.big {
  width: min(1400px, 100%);
  height: 100%;
}

/* mail signup */
.modal-box.pop,
.mail-box.pop {
  border-radius: var(--pop-corner);
}

/* the cart drawer: same outline, square corners */
.aw-panel {
  border-left: var(--pop-outline) solid var(--pop-outline-color);
  border-radius: 0;
}
.aw-item img, .aw-noimg, .aw-go, .aw-mode { border-radius: var(--pop-corner); }
.aw-exit { border-radius: var(--pop-corner); border-width: var(--pop-outline); }
#booth-exit.pop-x { left: auto; top: calc(var(--pop-x-size) * -0.42); right: calc(var(--pop-x-size) * -0.42); transform: none; }

/* buttons and fields inside a pop-up get the same corners */
.pop input, .pop button:not(.pop-x), .pop .pv-buy, .pop .cta { border-radius: var(--pop-corner); }

/* big windows start a little lower, so their close button sits clear of the cart button (top right) */
.overlay.popup:has(.pop.big),
.layer.popup:has(.pop.big) {
  padding-top: calc(76px + var(--pop-x-size) * 0.42);
  padding-bottom: 16px;
}

/* ---------------------------------------------------------------- Lotus's tutorial bubble (tutorial.js) */
.aw-tut {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 34;
  width: min(320px, calc(100vw - 20px));
  padding: 14px 16px 14px;
  font: 15px/1.4 "Montserrat", Arial, sans-serif;
  color: #1a1b1f;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transform-origin: 18% 100%;
  transition: opacity 0.25s, transform 0.25s;
}
.aw-tut.on { opacity: 1; transform: none; }
.aw-tut p { margin: 0 0 8px; }
.aw-tut-who {
  display: block;
  margin-bottom: 4px;
  font: 18px "Wurld Bubble", "Boring Time", Impact, sans-serif;
  letter-spacing: 0.04em;
}
.aw-tut-ok {
  display: block;
  margin: 4px 0 0 auto;
  padding: 8px 16px;
  min-height: 40px;
  border: var(--pop-outline) solid var(--pop-outline-color);
  border-radius: var(--pop-corner);
  background: var(--pop-outline-color);
  color: var(--pop-fill);
  font: 16px "Wurld Bubble", "Boring Time", Impact, sans-serif;
  cursor: pointer;
}

/* ---------------------------------------------------------------- the item view (shop): the piece floats on its own,
   Lotus tells you about it in a speech bubble underneath (RPG style) */
.product-view { padding: 16px 16px 20px; }
.product-view .pv-box {
  width: min(620px, 100%);
  max-height: none;
  overflow: visible;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.product-view .pv-stage {
  width: min(100%, 52dvh);
  aspect-ratio: 1 / 1;
  background: none;
}
.product-view .pv-stage img {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}
.product-view .pv-photo { border: var(--pop-outline) solid var(--pop-outline-color); border-radius: 50%; }
.product-view .pv-dots span { border-color: #fff; }
.product-view .pv-dots span.on { background: #fff; }

.pv-talk {
  width: 100%;
  padding: 14px 18px 10px;
  text-align: left;
  color: #1a1b1f;
  font-family: "Montserrat", Arial, sans-serif;
}
.pv-who { font: 16px "Wurld Bubble", "Boring Time", Impact, sans-serif; letter-spacing: 0.04em; color: #8a5a2b; }
.pv-talk .pv-name { margin: 2px 0 0; font-size: 24px; text-align: left; }
.pv-talk .pv-price { margin: 2px 0 6px; font-size: 16px; color: #1a1b1f; font-weight: 700; }
.pv-line { margin: 0 0 10px; min-height: 2.8em; font-size: 15px; line-height: 1.4; }
.pv-actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; min-height: 54px; }

/* add to cart: words in a hand-drawn ellipse, not a black box */
.pv-talk .pv-buy {
  display: inline-block;
  padding: 12px 30px;
  border: var(--pop-outline) solid var(--pop-outline-color);
  border-radius: 50%;
  background: transparent;
  color: var(--pop-outline-color);
  font-family: "Wurld Bubble", "Boring Time", Impact, sans-serif;
  font-size: 19px;
  text-decoration: none;
  transform: rotate(-2deg);
  transition: transform 0.12s, background 0.12s, color 0.12s;
}
.pv-talk .pv-buy[hidden] { display: none; }
.pv-talk a.pv-buy:hover, .pv-talk a.pv-buy:active { background: var(--pop-outline-color); color: var(--pop-fill); transform: rotate(-2deg) scale(1.04); }
.pv-talk .pv-buy.disabled { border-style: dashed; color: #8a8a8a; border-color: #8a8a8a; transform: none; }
.pv-talk .pv-ask { color: #1a1b1f; font-weight: 700; }
.pv-talk .pv-nav { margin-top: 6px; border-top: 2px dashed #0002; padding-top: 4px; }
.pv-talk .pv-close.pop-x { position: absolute; left: auto; top: calc(var(--pop-x-size) * -0.42); right: calc(var(--pop-x-size) * -0.42); }

/* ---------------------------------------------------------------- Lotus talking (dialogue.js)
   Jet Set Radio Future style: his face in a little chrome TV with a speaker grille, the words in a dark box.  */
:root { --dlg-box: rgba(54, 55, 60, 0.9); --dlg-edge: rgba(255, 255, 255, 0.22); --dlg-text: #fff; --dlg-tv: 128px; --dlg-font: 20px; }
.aw-dlg { position: fixed; z-index: 60; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); width: min(900px, calc(100vw - 24px));
          display: flex; align-items: stretch; gap: 10px; opacity: 0; pointer-events: none; transform: translate(-50%, 24px);
          transition: opacity .22s, transform .22s; -webkit-user-select: none; user-select: none; cursor: pointer; }
.aw-dlg.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.aw-dlg-tv { flex: none; width: var(--dlg-tv); padding: 7px 7px 0; border-radius: 12px;
             background: linear-gradient(155deg, #fbfcfd 0%, #c3c8ce 28%, #8b9299 48%, #e4e7ea 62%, #a6acb3 82%, #6c737a 100%);
             box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 #5a6067, 0 3px 0 #1b1c1f, 0 6px 14px rgba(0,0,0,.35); }
.aw-dlg-screen { position: relative; aspect-ratio: 1; border-radius: 7px; overflow: hidden;
                 background: radial-gradient(circle at 50% 35%, #5aa6c4 0%, #2a5f7a 55%, #10283a 100%);
                 box-shadow: inset 0 0 0 2px #2a2d31, inset 0 0 14px rgba(0,0,0,.6); }
.aw-dlg-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.aw-dlg-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
                        background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px),
                                    linear-gradient(160deg, rgba(255,255,255,.22), transparent 40%); }
.aw-dlg-grille { height: 20px; margin: 6px 14px 7px; border-radius: 4px;
                 background: radial-gradient(circle, #24262a 1.5px, transparent 2px) 0 0 / 7px 7px; }
.aw-dlg-box { position: relative; flex: 1; min-width: 0; padding: 12px 22px 20px; background: var(--dlg-box); color: var(--dlg-text);
              border: 2px solid var(--dlg-edge); border-radius: 3px; box-shadow: 0 6px 14px rgba(0,0,0,.3); backdrop-filter: blur(2px); }
.aw-dlg-name { display: block; margin-bottom: 4px; font: italic 800 13px/1 Arial, Helvetica, sans-serif; letter-spacing: .14em; color: #c9ced6; }
.aw-dlg-text { margin: 0; min-height: 2.7em; font: italic 600 var(--dlg-font)/1.38 Arial, Helvetica, sans-serif; letter-spacing: .01em;
               text-shadow: 1px 1px 0 rgba(0,0,0,.55); white-space: pre-wrap; }
.aw-dlg-skip { position: absolute; top: 8px; right: 10px; padding: 4px 8px; border: 0; background: none; color: #c9ced6;
               font: italic 800 11px Arial, sans-serif; letter-spacing: .12em; cursor: pointer; }
.aw-dlg-skip:hover { color: #fff; }
.aw-dlg-next { position: absolute; right: 16px; bottom: 6px; font-size: 14px; color: #fff; opacity: 0; }
.aw-dlg.done .aw-dlg-next { opacity: 1; animation: aw-dlg-blink .8s steps(2) infinite; }
.aw-dlg.done.last .aw-dlg-next { animation: none; }
.aw-dlg.done.last .aw-dlg-next::after { content: " OK"; font: italic 800 12px Arial, sans-serif; letter-spacing: .1em; }
@keyframes aw-dlg-blink { 50% { opacity: 0; } }
@media (max-width: 600px) {
  :root { --dlg-tv: 86px; --dlg-font: 16px; }
  .aw-dlg { gap: 7px; }
  .aw-dlg-tv { padding: 5px 5px 0; border-radius: 9px; }
  .aw-dlg-grille { height: 12px; margin: 4px 8px 5px; background-size: 6px 6px; }
  .aw-dlg-box { padding: 9px 14px 18px; }
}
