/* =========================================================
   ZabaRoastery — kurbağa maskotu katmanı
   Tüm konum/poz mascot.js'te rAF ile yazılır (yalnız transform/opacity).
   Renkler yalnız token: --frog-*, --accent*, --ink*, --surface*, --bg, --ok.
   ========================================================= */

.zm-layer {
  --zm-line: color-mix(in oklab, var(--frog-skin-shade) 58%, var(--frog-mouth));
  position: fixed;
  inset: 0;
  z-index: var(--z-mascot);
  pointer-events: none;
  overflow: hidden;
  contain: layout style paint;
  transition: opacity var(--dur-3) var(--ease-out), visibility var(--dur-3);
}
/* Sepet çekmecesi açıkken kurbağa çekilir */
.zm-layer.is-tucked { opacity: 0; visibility: hidden; }
/* Telefonda sepetteki kurbağa altında içerik varken üst çubuğun arkasına çekilir (mascot.js tuck) */
.zm-layer.is-behind { z-index: calc(var(--z-nav) - 1); }

/* ---------- Kurbağa ---------- */
.zm-frog {
  position: absolute;
  left: -64px;
  top: -112px;
  width: 128px;
  height: 120px;
  transform-origin: 64px 112px;
  will-change: transform;
  opacity: 0;
}
.zm-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px color-mix(in oklab, var(--bg) 70%, transparent));
}
.zm-frog.is-interactive .zm-hit { pointer-events: visiblePainted; cursor: pointer; }
/* Dokunmatikte kurbağa dokunuşları yutmaz: altındaki düğmeler her zaman basılabilir */
@media (hover: none), (pointer: coarse) {
  .zm-frog.is-interactive .zm-hit { pointer-events: none; }
}

.zm-shadow { fill: color-mix(in oklab, var(--bg) 55%, transparent); }
.zm-layer .zm-shadow { filter: blur(1.4px); }

.zm-body { fill: url(#zm-g-body); stroke: var(--zm-line); stroke-width: 1.4; }
.zm-headshape, .zm-dome { fill: url(#zm-g-head); stroke: var(--zm-line); stroke-width: 1.4; }
.zm-limb { fill: url(#zm-g-limb); stroke: var(--zm-line); stroke-width: 1.2; }
.zm-limb-hl { fill: none; stroke: color-mix(in oklab, var(--frog-skin) 55%, var(--frog-belly)); stroke-width: 1.4; stroke-linecap: round; opacity: .55; }
.zm-belly { fill: url(#zm-g-belly); }
.zm-belly-line { fill: none; stroke: color-mix(in oklab, var(--frog-belly) 60%, var(--frog-skin-shade)); stroke-width: .9; stroke-linecap: round; opacity: .55; }
.zm-spot { fill: var(--frog-skin-shade); opacity: .55; }
.zm-throat-s { fill: color-mix(in oklab, var(--frog-belly) 88%, var(--frog-skin)); stroke: color-mix(in oklab, var(--frog-belly) 55%, var(--frog-skin-shade)); stroke-width: .7; }

.zm-web { fill: color-mix(in oklab, var(--frog-skin) 55%, var(--frog-belly)); opacity: .9; }
.zm-toe, .zm-finger { fill: none; stroke: var(--frog-skin); stroke-width: 2.8; stroke-linecap: round; }
.zm-pad { fill: color-mix(in oklab, var(--frog-skin) 80%, var(--frog-belly)); stroke: var(--zm-line); stroke-width: .8; }

/* Gözler */
.zm-eyeball { fill: var(--frog-eye); stroke: var(--zm-line); stroke-width: 1; }
.zm-pupil ellipse { fill: var(--frog-pupil); }
.zm-glint { fill: var(--frog-eye); }
.zm-lid__s { fill: color-mix(in oklab, var(--frog-skin) 88%, var(--frog-skin-shade)); }
.zm-lid__lash { fill: none; stroke: var(--zm-line); stroke-width: 1.3; stroke-linecap: round; }
.zm-happy { fill: none; stroke: var(--frog-mouth); stroke-width: 2.2; stroke-linecap: round; opacity: 0; }
.zm-svg[data-eyes="happy"] .zm-happy { opacity: 1; }

/* Dolar gözler: altın kenar + yeşil çekirdek, pırıl bir dönüşle belirir */
.zm-dollar { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.zm-dollar__rim { fill: none; stroke: var(--accent); stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; }
.zm-dollar__core { fill: none; stroke: var(--ok); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.zm-svg[data-eyes="dollar"] .zm-pupil { opacity: 0; }
.zm-svg[data-eyes="dollar"] .zm-dollar { opacity: 1; animation: zm-dollar-in .78s var(--ease-spring) both, zm-dollar-glint 1.6s .8s var(--ease-in-out) infinite; }
.zm-svg[data-eyes="dollar"] .zm-eyeball { fill: color-mix(in oklab, var(--frog-eye) 88%, var(--accent)); }
@keyframes zm-dollar-in {
  0%   { transform: scale(.1) rotate(-320deg); }
  70%  { transform: scale(1.22) rotate(12deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes zm-dollar-glint {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* Burun, yanak, ağız */
.zm-nostril { fill: var(--frog-mouth); opacity: .6; }
.zm-cheek { fill: var(--frog-cheek); opacity: .32; transition: opacity var(--dur-3) var(--ease-out); }
.zm-svg[data-mouth="smile"] .zm-cheek,
.zm-svg[data-mouth="joy"] .zm-cheek { opacity: .72; }
.zm-svg[data-mouth="whistle"] .zm-cheek { opacity: .5; }
.zm-m { opacity: 0; }
.zm-m path, path.zm-m { fill: none; stroke: var(--frog-mouth); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.zm-svg[data-mouth="neutral"] .zm-m--neutral,
.zm-svg[data-mouth="smile"] .zm-m--smile,
.zm-svg[data-mouth="whistle"] .zm-m--whistle,
.zm-svg[data-mouth="joy"] .zm-m--joy { opacity: 1; }
.zm-pucker { fill: var(--frog-mouth); stroke: color-mix(in oklab, var(--frog-skin-shade) 70%, var(--frog-cheek)); stroke-width: 1.4; }
.zm-m--joy .zm-joy { fill: var(--frog-mouth); stroke: var(--frog-mouth); stroke-width: 1.2; }
.zm-m--joy .zm-tongue { fill: var(--frog-cheek); stroke: none; }

/* Paket yuvaları */
.zm-slot[data-on="0"] { display: none; }

/* ---------- Kahve kutusu (iskelette, sepette ve uçarken aynı çizim) ----------
   --zk-* : ZabaRoastery kutu baskısının mürekkep renkleri (kutu görsellerinden
   örneklendi; tema token'ı değil, ürünün kendi rengi). */
.zm-bag, .zm-stack { --zk-navy: #22376d; --zk-bej: #d1c9b5; }
.zm-bag__front { fill: var(--zk-navy); }
.zm-bag__wave { fill: var(--zk-bej); }
.zm-bag__side { fill: color-mix(in oklab, var(--zk-navy) 70%, var(--bg)); }
.zm-bag__top { fill: color-mix(in oklab, var(--zk-navy) 80%, var(--ink)); }
.zm-bag__foot { fill: var(--zk-navy); stroke: var(--zk-navy); }
.zm-bag__foot ellipse, .zm-bag__foot circle { stroke: none; }
.zm-bag__foot path { fill: none; stroke-width: 1.9; stroke-linecap: round; }
.zm-bag__brand { fill: var(--zk-navy); font: 600 4.6px/1 var(--font-display); letter-spacing: .1px; text-anchor: middle; }
.zm-bag__shine { stroke: color-mix(in oklab, var(--ink) 30%, transparent); stroke-width: .6; }
.zm-bag__edge { fill: none; stroke: color-mix(in oklab, var(--zk-navy) 55%, var(--bg)); stroke-width: .7; stroke-linejoin: round; }
.zm-bag__label { fill: var(--ink); }
.zm-bag__n1, .zm-bag__n2 { fill: var(--bg); font: 500 4.2px/1 var(--font-display); text-anchor: middle; letter-spacing: -.05px; }
.zm-bag__n2 { font-size: 3.4px; fill: color-mix(in oklab, var(--bg) 78%, var(--ink)); }

.zm-pkg {
  position: absolute;
  left: 0;
  top: 0;
  width: 41.6px;
  height: 51.2px;
  margin: -25.6px 0 0 -20.8px;
  perspective: 240px;
  will-change: transform, opacity;
}
.zm-pkg__spin { width: 100%; height: 100%; transform-style: preserve-3d; }
.zm-pkg svg { display: block; width: 100%; height: 100%; max-width: none; overflow: visible; filter: drop-shadow(0 8px 10px color-mix(in oklab, var(--bg) 65%, transparent)); }
.zm-pkg-shadow {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 8px;
  margin: -4px 0 0 -20px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  filter: blur(1.5px);
  opacity: 0;
}

/* ---------- Sepet (sepet düğmesinin altında asılı tel sepet) ---------- */
.zm-basket {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  max-width: none;
  overflow: visible;
  opacity: 0;
  will-change: transform, opacity;
}
.zm-bk-handle { fill: none; stroke: var(--ink-mute); stroke-width: 2.2; stroke-linecap: round; }
.zm-bk-hook { fill: var(--bg); stroke: var(--ink-mute); stroke-width: 1.8; }
.zm-bk-inside { fill: var(--bg); }
.zm-bk-rim-back { fill: none; stroke: color-mix(in oklab, var(--accent) 60%, var(--bg)); stroke-width: 2.6; stroke-linecap: round; }
.zm-bk-panel { fill: color-mix(in oklab, var(--surface-2) 94%, transparent); stroke: color-mix(in oklab, var(--accent) 70%, var(--bg)); stroke-width: 1.4; stroke-linejoin: round; }
.zm-bk-weave { fill: none; stroke: var(--accent); stroke-width: .9; opacity: .32; }
.zm-bk-band { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: .6; }
.zm-bk-rim { fill: none; stroke: var(--accent-strong); stroke-width: 3.4; stroke-linecap: round; }
.zm-stack-i { transition: opacity var(--dur-3) var(--ease-out); }
.zm-stack-i:not([data-on="1"]) { opacity: 0; }

/* ---------- Efektler ---------- */
.zm-note, .zm-spark, .zm-puff { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.zm-note { width: 16px; height: 22px; margin: -11px 0 0 -8px; }
.zm-note--b { width: 24px; margin-left: -12px; }
.zm-note svg { width: 100%; height: 100%; display: block; max-width: none; fill: var(--accent); stroke: var(--accent); }
.zm-spark { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.zm-spark svg { width: 100%; height: 100%; display: block; fill: var(--accent-strong); }
.zm-puff {
  width: 14px;
  height: 9px;
  margin: -4.5px 0 0 -7px;
  border-radius: 50%;
  border: 1.2px solid var(--ink-mute);
  background: color-mix(in oklab, var(--ink-mute) 18%, transparent);
}

/* ---------- Hata ayıklama çubuğu (?debug=1) ---------- */
.zm-debug {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: calc(var(--z-mascot) + 1);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: min(640px, calc(100vw - 110px));
  padding: 8px;
  background: color-mix(in oklab, var(--surface) 94%, transparent);
  border: 1px solid var(--hair);
  border-radius: var(--r-2);
  box-shadow: var(--shadow);
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.zm-debug__t { padding: 0 6px 0 2px; }
.zm-debug__t b { color: var(--accent); font-weight: 500; }
.zm-debug button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--hair);
  border-radius: var(--r-1);
  background: transparent;
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.zm-debug button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 560px) {
  .zm-debug { left: 8px; bottom: 8px; max-width: calc(100vw - 86px); padding: 6px; gap: 4px; }
  .zm-debug button { min-height: 28px; padding: 0 7px; font-size: 9.5px; }
  .zm-debug__t { display: none; }
}

@media print { .zm-layer, .zm-debug { display: none !important; } }

/* ---------- Azar (ZabaMascot.scold): çatık kaş, kızgın ağız, işaret parmağı ----------
   Balon (.frog-say) frog-scold.css içinde; iki mağazada aynı görünür. */
.zm-brow { fill: none; stroke: var(--frog-mouth); stroke-width: 3.8; stroke-linecap: round; opacity: 0; transition: opacity var(--dur-1) linear; }
.zm-svg[data-eyes="angry"] .zm-brow { opacity: 1; }
.zm-svg[data-mouth="angry"] .zm-m--angry { opacity: 1; }
.zm-svg[data-mouth="angry"] .zm-cheek { opacity: .85; }
.zm-pointer { display: none; }
.zm-pointer .zm-finger { stroke-width: 3.6; }
.zm-arm.is-point .zm-pointer { display: inline; }
.zm-arm.is-point .zm-hand > .zm-finger, .zm-arm.is-point .zm-hand > .zm-pad { display: none; }
