.how-section { position: relative; z-index: 1; max-width: var(--container); margin: 20px auto 0; padding: 20px; opacity: 0; animation: rise-in 0.8s var(--ease) 1.9s forwards; }
.how-title { font-family: var(--font); font-size: 20px; font-weight: 600; color: #ffffff; text-align: center; letter-spacing: -0.02em; margin: 0; }
.how-subtitle { margin: 6px auto 0; font-size: 13px; color: var(--white-45); text-align: center; }
.how-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 48px; align-items: center; margin-top: 32px; }

/* ---- steps ---- */
.how-steps { list-style: none; display: flex; flex-direction: column; gap: 26px; width: 100%; max-width: 380px; margin: 0 auto; padding: 0; }
.how-step { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.how-step:not(:first-child)::before { content: ''; position: absolute; left: 14px; top: -24px; width: 2px; height: 22px; background: #262626; }
.how-step-num { width: 29px; height: 29px; flex-shrink: 0; border-radius: 50%; background: var(--bg-card); border: 1px solid #262626; color: var(--white-50); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; position: relative; z-index: 1; transition: all 0.3s ease; }
.how-step-num .fas { display: none; font-size: 11px; }
.how-step.is-active .how-step-num { border-color: var(--accent); color: var(--accent); background: var(--accent-10); box-shadow: 0 0 0 4px var(--accent-08); }
.how-step.is-done .how-step-num { border-color: var(--green-40); color: var(--green); background: var(--green-08); }
.how-step.is-done .how-step-num .fas { display: block; }
.how-step.is-done .how-step-num .num { display: none; }
.how-step-name { display: block; font-size: 14px; font-weight: 600; color: var(--white-75); transition: color 0.3s ease; }
.how-step.is-active .how-step-name { color: #ffffff; }
.how-step-desc { display: block; margin-top: 2px; font-size: 12px; color: var(--white-40); line-height: 1.5; }

/* ---- mockup window ---- */
.how-mock { width: 100%; max-width: 560px; margin-left: auto; border-radius: var(--radius-2xl); background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow-card); overflow: hidden; transition: opacity 0.5s ease; user-select: none; }
.how-mock.is-fading { opacity: 0; }
.how-mock.is-waiting .how-panel { opacity: 0; }
.how-chrome { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; background: #1b1b1b; border-bottom: 1px solid var(--border); }
.how-chrome .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.how-chrome .dot-r { background: #ff5f57; }
.how-chrome .dot-y { background: #febc2e; }
.how-chrome .dot-g { background: #28c840; }
.how-url { margin: 0 auto; padding: 3px 14px; background: rgba(255, 255, 255, 0.05); border-radius: var(--radius-sm); font-size: 10px; color: var(--white-40); }
.how-screen { position: relative; height: 350px; background: var(--bg-page); overflow: hidden; }
.how-screen::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(#1a1a1a 1px, transparent 1px), linear-gradient(90deg, #1a1a1a 1px, transparent 1px); background-size: 20px 20px; }
.how-screen::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% -10%, rgba(255, 82, 88, 0.14), transparent 55%); }

/* ---- panels ---- */
.how-panel { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; padding: 14px; opacity: 0; transform: translateX(24px); pointer-events: none; transition: opacity 0.45s ease, transform 0.45s ease; }
.how-panel.is-active { opacity: 1; transform: none; pointer-events: auto; }
.how-panel.is-leaving { transform: translateX(-24px); }

/* shared mini elements (mirroring product/checkout/invoice pages) */
.how-thumb { position: relative; width: 32px; height: 32px; flex-shrink: 0; border-radius: 7px; background: var(--bg-well); border: 1px solid var(--line); overflow: hidden; }
.how-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; display: block; }
.how-thumb img.is-show { z-index: 1; }
.how-thumb img.is-show + .how-thumb-fallback { display: none; }

/* ---- product page panel (banner on top, detail card below) ---- */
.how-panel-product { padding: 0; }
.how-media { position: relative; height: 152px; flex-shrink: 0; overflow: hidden; background: var(--bg-well); border-bottom: 1px solid var(--border-strong); }
.how-banner-img { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.how-banner-img.is-show { display: block; }
.how-detail-card { display: flex; flex: 1; min-height: 0; margin: 12px 12px 18px; padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.how-purchase { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.how-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 8px; }
.how-product-name { font-size: 15px; font-weight: 600; color: #ffffff; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; }
.how-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border: 1px solid var(--white-10); border-radius: var(--radius-pill); background: var(--white-04); color: var(--white-58); font-size: 8px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; flex-shrink: 0; }
.how-badge .fas { font-size: 7px; }
.how-badge.is-instant, .how-badge.is-updated { border-color: var(--green-25); background: var(--green-08); color: var(--green); }
.how-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--white-07); }
.how-price-label { font-size: 10px; font-weight: 600; letter-spacing: 0.5px; color: var(--white-42); }
.how-product-price { font-size: 13px; font-weight: 600; color: var(--white-85); }
.how-variant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.how-variant { display: flex; flex-direction: column; gap: 1px; padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-page); }
.how-variant.is-selected { border-color: var(--accent); background: var(--accent-08); }
.how-variant-name { font-size: 10.5px; font-weight: 600; color: #ffffff; }
.how-variant-price { font-size: 9.5px; color: var(--white-40); }
.how-purchase-row { display: grid; grid-template-columns: 62px 1fr; gap: 8px; margin-top: 6px; }
.how-qty { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-page); }
.how-qty span { color: var(--white-62); font-size: 12px; }
.how-qty b { color: #ffffff; font-size: 11px; font-weight: 600; }
.how-add-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; border: 1px solid var(--accent); border-radius: var(--radius-md); background: var(--accent); color: #ffffff; font-family: var(--font); font-size: 11px; font-weight: 600; transition: transform 0.15s ease, filter 0.15s ease; }
.how-add-btn .fas { font-size: 10px; }
.how-add-btn.is-pressed, .how-pay-btn.is-pressed { transform: scale(0.96); filter: brightness(0.88); }

/* ---- checkout panel (split view like checkout.html) ---- */
.how-panel-checkout { flex-direction: row; padding: 0; }
.how-checkout-left { display: flex; flex-direction: column; width: 40%; flex-shrink: 0; padding: 12px 12px 20px; background: var(--bg-deep); border-right: 1px solid var(--line); }
.how-brand-row { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.how-brand-logo { width: 16px; height: 16px; object-fit: contain; }
.how-brand-name { font-size: 10.5px; font-weight: 600; color: var(--ink-muted); }
.how-summary-card { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--bg-well); border: 1px solid var(--line); border-radius: var(--radius-md); }
.how-summary-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.how-summary-name { font-size: 11px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.how-summary-variant { font-size: 9.5px; color: var(--ink-muted); }
.how-summary-price { font-size: 11px; font-weight: 500; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.how-totals { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.how-totals-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-muted); }
.how-totals-row.is-grand { padding-top: 6px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--ink); }
.how-checkout-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 14px 18px 22px; background: var(--bg-page); }
.how-checkout-right > * { width: 100%; max-width: 272px; margin-left: auto; margin-right: auto; }
.how-form-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.how-field { display: block; }
.how-field-label { display: block; font-size: 9.5px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.how-field-label em, .how-field-label .req { color: var(--accent); font-style: normal; }
.how-input { position: relative; height: 30px; border-radius: var(--radius-md); background: var(--bg-well); border: 1px solid var(--line); display: flex; align-items: center; padding: 0 9px; font-size: 11px; color: var(--ink); letter-spacing: 0.4px; font-variant-numeric: tabular-nums; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.how-input.is-typing { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-15); }
.how-caret { display: none; width: 1.5px; height: 13px; margin-left: 1px; background: var(--accent); animation: howBlink 1s steps(1) infinite; }
.how-input.is-typing .how-caret { display: block; }
@keyframes howBlink {
  50% { opacity: 0; }
}
.how-pay-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.how-pay-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 40px; background: var(--bg-well); border: 1px solid var(--line); border-radius: var(--radius-md); }
.how-pay-tile img { width: 15px; height: 15px; object-fit: contain; }
.how-pay-tile span { font-size: 8.5px; font-weight: 500; color: var(--ink); }
.how-pay-tile.is-selected { border: 2px solid var(--accent); background: rgba(92, 32, 34, 0.55); box-shadow: 0 0 0 3px var(--accent-15); }
.how-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.how-pay-btn { margin-top: auto; height: 34px; border: none; border-radius: var(--radius-md); background: var(--accent); color: var(--ink); font-family: var(--font); font-size: 11.5px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.15s ease, filter 0.15s ease; }
.how-spinner { display: none; width: 13px; height: 13px; border: 2px solid rgba(8, 8, 8, 0.35); border-top-color: var(--bg-deep); border-radius: 50%; animation: spin 0.8s linear infinite; }
.how-pay-btn.is-loading .how-spinner { display: inline-block; }

/* ---- invoice panel (like invoice.html) ---- */
.how-invoice-pill { display: flex; align-items: center; gap: 7px; width: fit-content; margin: 0 auto; padding: 4px 6px 4px 11px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-pill); box-shadow: var(--shadow-card); }
.how-pill-label { font-size: 8.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--white-40); }
.how-invoice-id { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; font-weight: 600; color: #ffffff; }
.how-invoice-paid { padding: 2px 7px; border-radius: var(--radius-pill); font-size: 8px; font-weight: 700; letter-spacing: 0.6px; color: var(--green); background: var(--green-08); border: 1px solid var(--green-35); opacity: 0; transform: scale(0.6); transition: all 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55); }
.how-invoice-paid.is-show { opacity: 1; transform: scale(1); }
.how-invoice-card { display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px; margin-top: 10px; padding: 11px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); }
.how-inv-left { display: flex; flex-direction: column; min-width: 0; }
.how-inv-right { display: flex; flex-direction: column; min-width: 0; padding-left: 14px; border-left: 1px solid var(--white-06); }
.how-inv-header { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; color: var(--ink); margin-bottom: 9px; }
.how-inv-header .fas { font-size: 9px; color: var(--accent); }
.how-invoice-product { display: flex; align-items: center; gap: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--white-06); }
.how-inv-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.how-inv-name { font-size: 12px; font-weight: 600; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.how-inv-sub { font-size: 9.5px; font-weight: 500; color: var(--white-45); }
.how-inv-price { font-size: 11px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.how-key { position: relative; overflow: hidden; margin-top: 9px; padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--accent-22); background: var(--accent-07); text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; font-weight: 500; letter-spacing: 0.8px; color: #ffffff; transition: border-color 0.4s ease, box-shadow 0.4s ease; }
.how-key::after { content: ''; position: absolute; top: -40%; left: -70%; width: 45%; height: 180%; background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.22), transparent); transform: skewX(-20deg); }
.how-key.is-highlight { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-10), 0 0 28px var(--accent-22); }
.how-key.is-highlight::after { animation: howShine 1.3s ease 0.1s forwards; }
@keyframes howShine {
  to { left: 130%; }
}
.how-total-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.how-total-label { font-size: 8.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--white-45); }
.how-inv-total { font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.how-info-rows { display: flex; flex-direction: column; gap: 5px; }
.how-info-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.how-info-label { flex-shrink: 0; min-width: 82px; font-size: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.6px; color: var(--white-40); }
.how-info-value { font-size: 9.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.how-status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--green-28); background: var(--green-10); color: var(--green); font-size: 8.5px; font-weight: 600; }
.how-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* confetti */
.how-confetti { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.how-confetti span { position: absolute; top: -12px; width: 6px; height: 10px; border-radius: 2px; opacity: 0; animation: howConfettiFall var(--dur, 1.8s) cubic-bezier(0.25, 0.4, 0.6, 1) var(--delay, 0s) forwards; }
@keyframes howConfettiFall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift, 0px), 390px) rotate(var(--spin, 360deg)); }
}

/* cursor */
.how-cursor { position: absolute; top: 0; left: 0; z-index: 6; width: 22px; height: 22px; transform: translate(-40px, -40px); opacity: 0; pointer-events: none; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); transition: transform 0.7s var(--ease), opacity 0.3s ease; will-change: transform; }
.how-cursor.is-visible { opacity: 1; }
.how-cursor svg { display: block; transition: transform 0.12s ease; }
.how-cursor.is-clicking svg { transform: scale(0.78); }

/* responsive */
@media (max-width: 900px) {
  .how-grid { grid-template-columns: 1fr; gap: 32px; }
  .how-mock { margin: 0 auto; }
}
@media (max-width: 560px) {
  .how-screen { height: 360px; }
  .how-media { height: 102px; }
  .how-detail-card { margin: 10px; }
  .how-banner-fallback { font-size: 34px; }
  .how-panel-checkout { flex-direction: column; }
  .how-checkout-left { width: 100%; flex-direction: row; align-items: center; gap: 12px; padding: 8px 12px; border-right: none; border-bottom: 1px solid var(--line); }
  .how-brand-row { margin-bottom: 0; }
  .how-summary-card, .how-totals-row:not(.is-grand) { display: none; }
  .how-totals { margin-top: 0; margin-left: auto; padding-top: 0; border-top: none; }
  .how-totals-row.is-grand { padding-top: 0; border-top: none; }
  .how-invoice-card { grid-template-columns: 1fr; gap: 10px; }
  .how-inv-right { padding-left: 0; border-left: none; border-top: 1px solid var(--white-06); padding-top: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .how-section { opacity: 1; animation: none; }
  .how-cursor { display: none; }
}
