/* pmyeni /kendi-paketin (plan 07 Task 11). Ported from NT kendi-paketin.html; the :root tokens, .wrap, .mono, .btn,
   header, footer and .toast live in site.css and are not repeated here. Tier state is :has(input:checked) (no JS
   aria-checked). CC-20: .flv-btn, .minus, label.tier, #kpAdd and #kpMbarAdd keep a >= 44 px tap target at both
   viewports. No price/total is styled in from the browser; the JS only swaps server-formatted text. */

.kp{padding-bottom:40px}

/* Section heads (not in site.css) */
.kp .sec-head{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;padding-block:10px 18px}
.kp .sec-head h2{margin:0;font-size:clamp(32px,4vw,46px);font-weight:800;letter-spacing:-.02em;line-height:1}
.kp .sec-no{color:var(--muted)}

/* Hero */
.kp-hero{position:relative;padding-block:12px 48px}
.kp-hero-art{position:relative}
.kp-hero h1{margin:0;font-weight:800;color:var(--hero-ink);font-size:clamp(44px,13vw,190px);line-height:.88;letter-spacing:-.02em;text-wrap:balance}
.kp-hero h1 span{display:block}
.kp-hero-pieces{position:absolute;inset:0;display:flex;align-items:center;justify-content:flex-end;gap:14px;pointer-events:none;opacity:.9}
.kp-hero-pieces img{width:clamp(48px,7vw,96px);height:auto;object-fit:contain;filter:drop-shadow(0 10px 22px rgb(0 0 0 / .14))}
.kp-hero-foot{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;flex-wrap:wrap;margin-top:34px}
.kp-hero-foot p{margin:0;max-width:44ch;font-size:16px}

/* Scale grid */
.kp-grid{display:grid;grid-template-columns:minmax(0,1fr) 430px;gap:28px;align-items:start}
.kp-stage{position:sticky;top:86px;height:calc(100vh - 140px);min-height:480px;max-height:820px;overflow:hidden;border-radius:24px;background:var(--surface-2);border:1px solid var(--line);display:grid;place-items:center}
.kp-ghost{font-weight:900;font-size:clamp(120px,20vw,320px);letter-spacing:-.02em;color:var(--ghost);line-height:1;user-select:none}
.kp-poster{position:absolute;inset:auto 0 24px;display:flex;align-items:flex-end;justify-content:center;gap:10px;pointer-events:none}
.kp-poster img{width:clamp(48px,7vw,96px);height:auto;object-fit:contain;filter:drop-shadow(0 8px 20px rgb(0 0 0 / .16))}

/* 3D scale (Task 12): the canvas fills the stage once started; the start button sits over the static poster and is
   hidden by the page module when reduced-motion is set or WebGL is unavailable (the 2D wizard stays the fallback). */
.kp-stage #kpScene{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;z-index:1}
.kp-stage #kpScene[hidden]{display:none}
.kp-start3d{position:absolute;z-index:2;min-height:44px;border:1px solid var(--line);background:color-mix(in srgb,var(--surface) 92%,transparent);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-radius:999px;padding:11px 20px;font-weight:600;font-size:14px;cursor:pointer;box-shadow:0 6px 20px rgb(0 0 0 / .1)}
.kp-start3d:hover{border-color:var(--fg)}
.kp-start3d[hidden]{display:none}
body[data-kp3d="on"] .kp-stage .kp-ghost,body[data-kp3d="on"] .kp-stage .kp-poster{display:none}

/* Ticket */
.kp-ticket{background:var(--surface);border:1px solid var(--line);border-radius:24px;padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.kp .t-head{display:flex;justify-content:space-between;color:var(--muted);padding:4px 4px 2px}
.kp .t-block{background:var(--surface-2);border-radius:var(--r);padding:14px}
.kp .t-label{display:flex;justify-content:space-between;color:var(--muted);margin-bottom:10px}

/* Tiers */
.kp .tiers{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:var(--chip);border-radius:14px;padding:5px}
.kp label.tier{position:relative;border:0;background:transparent;border-radius:10px;padding:9px 10px;min-height:44px;cursor:pointer;display:flex;flex-direction:column;gap:1px;justify-content:center}
.kp label.tier input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.kp label.tier b{font-size:17px;font-weight:800;letter-spacing:-.01em}
.kp label.tier small{color:var(--muted);font-size:11.5px}
.kp label.tier:has(input:checked){background:var(--surface);box-shadow:0 1px 0 var(--line),0 4px 14px rgb(0 0 0 / .06)}
.kp label.tier:has(input:checked) b{color:var(--accent)}
.kp label.tier:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}

/* Flavours */
.kp .flavors{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.kp .flv{position:relative;min-width:0}
.kp .flv-btn{width:100%;min-height:44px;border:1px solid transparent;background:var(--surface);border-radius:14px;padding:8px 48px 8px 6px;display:flex;align-items:center;gap:8px;cursor:pointer;text-align:left;-webkit-user-select:none;user-select:none;touch-action:manipulation;transition:transform .12s,border-color .2s}
.kp .flv-btn:hover{border-color:var(--line)}
.kp .flv-btn:active{transform:scale(.97);border-color:var(--accent)}
.kp .flv-btn img{width:54px;height:54px;flex:none;object-fit:contain;pointer-events:none}
.kp .flv-btn .ph{width:54px;height:54px;flex:none;border-radius:12px;background:var(--chip)}
.kp .flv-txt{min-width:0;display:flex;flex-direction:column}
.kp .flv-txt b{font-size:13.5px;font-weight:650;line-height:1.2}
.kp .flv-txt small{color:var(--muted);font-size:11.5px;font-variant-numeric:tabular-nums;min-height:14px}
.kp .flv-txt small.kp-g:not(:empty){color:var(--fg)}
.kp .minus{position:absolute;top:50%;right:4px;transform:translateY(-50%);width:44px;height:44px;border-radius:10px;border:1px solid var(--line);background:var(--surface-2);cursor:pointer;display:grid;place-items:center;font-size:18px;line-height:1;padding:0}
.kp .minus:hover{background:var(--fg);color:var(--bg)}
.kp .flv.is-soldout .flv-btn{opacity:.5;cursor:not-allowed}
.kp .flv.is-soldout .minus{opacity:.4;cursor:not-allowed}

/* Tools */
.kp .actions{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;margin-top:10px}
.kp .act{min-height:40px;border:1px solid var(--line);background:var(--surface);border-radius:12px;padding:10px 6px;font-size:13px;cursor:pointer;font-weight:500}
.kp .act:hover{border-color:var(--fg)}
.kp .act[hidden]{display:none}
.kp .status{min-height:16px;margin-top:10px;color:var(--muted);letter-spacing:.01em}
.kp .status.warn{color:var(--accent)}

/* Receipt */
.kp .receipt ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.kp .receipt li{display:grid;grid-template-columns:10px 1fr auto auto;gap:10px;align-items:center;font-family:var(--mono);font-size:11.5px;letter-spacing:.04em;font-variant-numeric:tabular-nums}
.kp .receipt li i{width:8px;height:8px;border-radius:50%;box-shadow:inset 0 0 0 1px rgb(0 0 0 / .12)}
.kp .receipt li span.r-g{color:var(--muted);min-width:56px;text-align:right}
.kp .receipt li span.r-tl{min-width:70px;text-align:right}
.kp .sheet-head b{font-size:20px;letter-spacing:-.01em}
.kp .empty-line{color:var(--muted);font-size:13px}
.kp .net{display:flex;justify-content:space-between;align-items:flex-end;border-top:1px dashed var(--line);margin-top:12px;padding-top:12px}
.kp .net .mono{color:var(--muted)}
.kp .net b{font-size:40px;font-weight:800;letter-spacing:-.02em;line-height:.9;font-variant-numeric:tabular-nums}
.kp .net small{color:var(--muted);font-size:13px;margin-left:6px}
.kp .total{display:flex;justify-content:space-between;align-items:baseline;margin-top:10px}
.kp .total .mono{color:var(--muted)}
.kp .total b{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.kp .total small{color:var(--muted);font-size:12px;margin-left:6px}
.kp .cta{min-height:52px;border:0;border-radius:16px;background:var(--accent);color:var(--accent-ink);padding:16px;font-weight:700;font-size:16px;cursor:pointer}
.kp .cta:disabled{background:var(--chip);color:var(--muted);cursor:not-allowed}
.kp .kp-noscript{color:var(--muted);font-size:13px;margin:4px 4px 0}

/* How */
.kp-how{padding-block:64px 24px}
.kp-how .steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px;border-top:1px solid var(--line);padding-top:24px}
.kp-how .step h3{margin:10px 0 6px;font-size:22px;letter-spacing:-.015em}
.kp-how .step p{margin:0;color:var(--muted);max-width:38ch}
.kp-how .step .mono{color:var(--accent)}

/* Mobile bar: hidden on desktop, fixed on phones */
.kp-mbar{display:none}

@media (max-width:980px){
  .kp-grid{grid-template-columns:minmax(0,1fr)}
  .kp-stage{position:relative;top:0;height:46vh;min-height:320px;max-height:none}
}
@media (max-width:760px){
  .kp-how .steps{grid-template-columns:1fr}
}
@media (max-width:640px){
  .kp{padding-bottom:84px}
  .kp-hero{padding-block:6px 28px}
  .kp-hero-pieces{opacity:.65}
  /* One column so the flavour name fits (the two-column card left ~18 px for the text, clipping the names under the
     minus); the full-width card also keeps a comfortable 44 px minus tap target on the right. */
  .kp .flavors{grid-template-columns:1fr}
  .kp .flv-txt b{overflow-wrap:anywhere}
  .kp .flv-txt small.kp-g{white-space:nowrap}
  /* The fixed .kp-mbar is a sticky bar like the PDP .buybar and cart .cbar: publish its height as --buybar-h so the
     floating WhatsApp button, the #toast and the first-visit consent banner (site.css) sit above it, and give the
     dark footer the same room so its last line is not hidden under the bar. */
  body:has(.kp-mbar){--buybar-h:calc(62px + env(safe-area-inset-bottom,0px))}
  body:has(.kp-mbar) .foot{padding-bottom:calc(32px + var(--buybar-h,0px))}
  .kp .net b{font-size:34px}
  .kp-mbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:45;gap:8px;align-items:stretch;
    padding:8px max(16px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));
    background:color-mix(in srgb,var(--surface) 94%,transparent);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);border-top:1px solid var(--line)}
  .kp-mbar .mbar-sum{flex:1;min-width:0;display:flex;align-items:center;gap:8px;background:var(--surface-2);border-radius:12px;padding:6px 12px}
  .kp-mbar .mbar-txt{display:flex;flex-direction:column;min-width:0}
  .kp-mbar .mbar-txt small{color:var(--muted);font-size:10px}
  .kp-mbar .mbar-txt b{font-size:16px;font-weight:800;letter-spacing:-.015em;font-variant-numeric:tabular-nums;line-height:1.1}
  .kp-mbar .mbar-tot{margin-left:auto;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
  .kp-mbar .mbar-add{min-height:44px;border:0;border-radius:12px;background:var(--accent);color:var(--accent-ink);font-weight:700;font-size:15px;padding:0 18px;cursor:pointer;white-space:nowrap}
  .kp-mbar .mbar-add:disabled{background:var(--chip);color:var(--muted);cursor:not-allowed}
}
@media (prefers-reduced-motion: reduce){
  .kp .flv-btn{transition:none}
}
