/* Customization hub, wave 2: touch, press and pointer interaction.
   Scoped to cz-* classes and the chain block that only the customization templates render.
   Motion uses transform and opacity only; everything is static under prefers-reduced-motion. */

/* ---------- press states (every device) ---------- */
.cz-method, .cz-card, .cz-fab, .cz-how li, .cz-sheet dl div { -webkit-tap-highlight-color: transparent; }
/* Uses the individual scale/translate properties: GSAP reveals leave an inline transform on
   these cards, which would otherwise cancel the press. The hover lift lives in 10-customize. */
.cz-method, .cz-card, .cz-fab { transition: border-color .2s, box-shadow .3s, scale .3s var(--ease), translate .3s var(--ease); }
.cz-method:active, .cz-card:active, .cz-fab:active { scale: var(--press-sm, .985); border-color: var(--ink); transition-duration: .14s; }

/* Stage tabs and filter chips: a short, firm press on touch and mouse. */
[data-chain] .chain-steps button, .cz-filter .chip, .cz-ffilter .chip { -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: border-color .2s, background-color .2s, color .15s, scale .14s var(--ease); }
[data-chain] .chain-steps button:active, .cz-filter .chip:active, .cz-ffilter .chip:active { scale: .96; }
[data-chain] .chain-steps button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- hero: magnetic CTA stays put on touch; spec sheet rows answer hover ---------- */
@media (hover: hover) {
  .cz-sheet dl div { transition: background-color .2s; }
  .cz-sheet dl div:hover { background: var(--surface-2); }
  .cz-sheet dl div.is-key:hover { background: #dce5fb; }
}

/* "How it works": the rule above each step draws in, left to right, once in view. */
.cz-how li { position: relative; }
.cz-how li::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.cz-js .cz-how.is-in li::before { transform: scaleX(1); transition: transform .7s var(--ease); }
.cz-js .cz-how.is-in li:nth-child(2)::before { transition-delay: .12s; }
.cz-js .cz-how.is-in li:nth-child(3)::before { transition-delay: .24s; }
.cz-js .cz-how.is-in li:nth-child(4)::before { transition-delay: .36s; }

/* ---------- decoration: zoomable photos ---------- */
.cz-zoom { position: absolute; inset: 0; display: block; overflow: hidden; color: inherit; cursor: zoom-in; }
.cz-zoom img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cz-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.cz-zoom::after {
  content: ""; position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .94) no-repeat center / 14px 14px;
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink));
  background-size: 12px 2px, 2px 12px;
  box-shadow: 0 1px 0 rgba(14, 27, 44, .08), 0 4px 12px -6px rgba(14, 27, 44, .4);
  opacity: .92; transition: transform .25s var(--ease), opacity .2s;
}
.cz-code { pointer-events: none; z-index: 1; }
@media (hover: hover) {
  .cz-zoom::after { opacity: 0; transform: scale(.8); }
  .cz-method:hover .cz-zoom::after, .cz-zoom:focus-visible::after { opacity: 1; transform: scale(1); }
}
@media (max-width: 560px) {
  .cz-zoom::after { right: 6px; bottom: 6px; width: 26px; height: 26px; background-size: 10px 2px, 2px 10px; }
}

/* Filter changes: shown cards settle in. */
@keyframes cz-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.cz-js .cz-group.is-pop .cz-method, .cz-js .cz-fab.is-pop { animation: cz-pop .38s var(--ease) both; }
.cz-js .cz-group.is-pop .cz-method:nth-child(2), .cz-js .cz-fab.is-pop.d1 { animation-delay: .03s; }
.cz-js .cz-group.is-pop .cz-method:nth-child(3), .cz-js .cz-fab.is-pop.d2 { animation-delay: .06s; }
.cz-js .cz-group.is-pop .cz-method:nth-child(n+4), .cz-js .cz-fab.is-pop.d3 { animation-delay: .09s; }

/* ---------- decoration: photo viewer (dialog built by JS) ---------- */
.cz-lb { width: min(960px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--ink); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); overflow: hidden; box-shadow: 0 30px 80px -30px rgba(14, 27, 44, .6); overscroll-behavior: contain; }
.cz-lb::backdrop { background: rgba(14, 27, 44, .72); }
.cz-lb[open] { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.cz-lb-stage { position: relative; aspect-ratio: 1; max-height: calc(100dvh - 34px); background: var(--surface-2); overflow: hidden; touch-action: none; cursor: grab; }
.cz-lb-stage:active { cursor: grabbing; }
.cz-lb-stage img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; will-change: transform; }
.cz-lb-stage .cz-code { left: 12px; top: 12px; font-size: .7rem; padding: 5px 8px; }
.cz-lb-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 20px 20px; overflow-y: auto; }
.cz-lb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.cz-lb-count { font: 600 .72rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.cz-lb h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.2; }
.cz-lb dl { margin: 0; display: grid; }
.cz-lb dl div { display: grid; gap: 4px; padding: 10px 0; border-top: 1px dashed var(--rule-strong); }
.cz-lb dt { font: 500 .64rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.cz-lb .is-limit dt { color: var(--warn); }
.cz-lb dd { margin: 0; font-size: 1rem; line-height: 1.5; }
.cz-lb-note { margin: 0; font-size: .9rem; color: var(--ink-2); }
.cz-lb-nav { display: flex; gap: 8px; margin-top: auto; }
.cz-lb-nav .btn { flex: 1 1 0; }
.cz-lb-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -10px -8px 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; transition: background-color .2s, transform .14s; }
.cz-lb-x:hover { background: var(--surface-2); }
.cz-lb-x:active { transform: scale(.92); }
.cz-lb-x svg { width: 20px; height: 20px; }
.cz-lb-hint { display: none; margin: 0; font: 500 .66rem/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
@media (pointer: coarse) { .cz-lb-hint { display: block; } }
@keyframes cz-lb-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cz-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .cz-lb[open] { animation: cz-lb-in .32s var(--ease); }
  .cz-lb[open]::backdrop { animation: cz-fade .25s ease; }
  .cz-lb-stage img.is-swap { animation: cz-fade .28s ease; }
}
html.cz-lock, html.cz-lock body { overflow: hidden; }

@media (max-width: 760px) {
  .cz-lb { width: 100vw; max-height: 100dvh; height: auto; margin: auto 0 0; border-radius: 12px 12px 0 0; border-width: 1px 0 0; }
  .cz-lb[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .cz-lb-stage { aspect-ratio: auto; height: min(100vw, 52dvh); max-height: none; }
  .cz-lb-side { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); gap: 10px; }
  .cz-lb h2 { font-size: 1.3rem; }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes cz-lb-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
    .cz-lb[open] { animation: cz-lb-up .34s var(--ease); }
  }
}

/* ---------- production chain (custom page) ---------- */
.chain-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.chain-nav .cnt { font: 600 .74rem/1 var(--f-mono); letter-spacing: .08em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chain-nav .cnt b { color: var(--accent-ink); }
.chain-nav .btn { min-width: 44px; padding-inline: 14px; }
.chain-nav .btn[disabled] { opacity: .4; pointer-events: none; }
.chain-nav .prev .icon { transform: scaleX(-1); }
.chain-nav .prev:hover .icon-arrow { transform: scaleX(-1) translateX(4px); }
.chain-panel { touch-action: pan-y; }
.chain-panel.is-drag { transition: none; }
@keyframes cz-panel-r { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes cz-panel-l { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .cz-js .chain-panel.is-in-r { animation: cz-panel-r .34s var(--ease); }
  .cz-js .chain-panel.is-in-l { animation: cz-panel-l .34s var(--ease); }
}
@media (max-width: 639px) {
  .chain-nav .btn span.lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- fabric library ---------- */
.cz-js .cz-gsm .bar i { transform: scaleX(0); transform-origin: 0 50%; }
.cz-js .cz-fab.is-in .cz-gsm .bar i { transform: scaleX(1); transition: transform .8s var(--ease) .1s; }
.cz-empty { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 16px 18px; border: 1px dashed var(--rule-strong); border-radius: var(--radius-lg); background: var(--surface); font-size: 1rem; }
.cz-empty[hidden] { display: none; }
.cz-ffilter .hint .cz-reset { margin-left: 8px; vertical-align: middle; }
.cz-reset { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent-ink); font: 600 .9rem/1 var(--f-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cz-reset[hidden] { display: none; }

/* ---------- spec cards: options become shortlist toggles (JS adds .is-pick) ---------- */
.cz-pick-hint { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 500 .72rem/1.4 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.cz-pick-hint::before { content: ""; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--accent); border-radius: 3px; }
@media (max-width: 639px) { .cz-pick-hint { align-items: flex-start; font: 500 .95rem/1.45 var(--f-body); letter-spacing: 0; text-transform: none; } .cz-pick-hint::before { margin-top: .2em; } }
.cz-cards.is-picker .cz-card:active { scale: none; }
.cz-list.is-pick li { padding: 0; }
.cz-list.is-pick li::before { display: none; }
.cz-pick {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 44px; margin: 0; padding: 10px 4px 10px 0;
  border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; line-height: 1.45; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.cz-pick::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: .1em; border: 1.5px solid var(--rule-strong); border-radius: 4px;
  background: var(--surface) no-repeat center / 12px 12px; transition: background-color .15s, border-color .15s, transform .18s var(--ease);
}
.cz-pick[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.cz-pick[aria-pressed="true"]::before {
  border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.cz-pick:active::before { transform: scale(.86); }
.cz-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes cz-tick { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: none; } }
.cz-pick.is-tick::before { animation: cz-tick .3s var(--ease); }
@media (hover: hover) {
  .cz-pick:hover::before { border-color: var(--accent); }
  .cz-pick:hover { color: var(--ink); }
}

/* ---------- sticky order bar (built by JS) ---------- */
.cz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cz-mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--navy); color: #fff; border-top: 3px solid var(--accent); box-shadow: 0 -10px 30px rgba(14, 27, 44, .25);
  transform: translateY(calc(100% + 32px)); opacity: 0; visibility: hidden;
  transition: transform .35s var(--ease), opacity .25s, visibility 0s linear .35s;
}
.cz-mbar.is-on { transform: none; opacity: 1; visibility: visible; transition: transform .35s var(--ease), opacity .25s; }
.cz-mbar-txt { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cz-mbar-txt b { font: 600 .98rem/1.2 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-mbar-txt span { font: 500 .7rem/1.3 var(--f-mono); letter-spacing: .03em; color: #9db6ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-mbar .btn { flex: none; min-height: 44px; padding-inline: 16px; }
.cz-mbar .cz-copy { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.cz-mbar .cz-copy[hidden] { display: none; }
.cz-mbar .cz-copy:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; }
.cz-mbar .btn:active { scale: .96; transition-duration: .08s; }
@media (min-width: 861px) {
  .cz-mbar {
    left: 50%; right: auto; bottom: 20px; width: min(640px, calc(100vw - 48px)); translate: -50% 0;
    padding: 10px 12px 10px 18px; border: 1px solid var(--ink); border-top: 3px solid var(--accent); border-radius: 12px;
    box-shadow: 0 24px 50px -20px rgba(14, 27, 44, .6);
  }
}
@media (max-width: 400px) {
  .cz-mbar { gap: 8px; padding-inline: 12px; }
  .cz-mbar .btn { padding-inline: 12px; }
  .cz-mbar-txt span { display: none; }
}
/* Lift the WhatsApp button above the bar on phones. */
.cz-js .wa-float { transition: transform .3s var(--ease), translate .35s var(--ease); }
.cz-js.cz-mbar-on .wa-float { translate: 0 -72px; }

/* ---------- reduced motion: nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  .cz-mbar, .cz-mbar.is-on { transition: none; }
  .cz-pick::before, .cz-js .wa-float { transition: none; }
  .cz-pick.is-tick::before { animation: none; }
  .cz-pick:active::before, .cz-mbar .btn:active { transform: none; scale: none; }
  .cz-method:active, .cz-card:active, .cz-fab:active,
  [data-chain] .chain-steps button:active, .cz-filter .chip:active, .cz-ffilter .chip:active { scale: none; }
  .cz-how li::before, .cz-js .cz-how.is-in li::before { transform: scaleX(1); transition: none; }
  .cz-js .cz-gsm .bar i { transform: none; transition: none; }
  .cz-js .cz-group.is-pop .cz-method, .cz-js .cz-fab.is-pop, .cz-lb[open], .cz-lb-stage img { animation: none; }
  .cz-zoom::after { transition: none; }
}
