/* ============================================================================
 * AlterSmoke — Checkout V2 · Lot 2 · deported step CTA in the sidebar
 * ----------------------------------------------------------------------------
 * Reference: Claude Design "Checkout AlterSmoke V2" (shell.jsx Sidebar
 * `.ck-loyal__cta`, app-v2.jsx `sidebarFire()`). One large sticky button inside
 * the order summary; its label follows the current step ("Continuer" on steps
 * 1-3, "Payer {total}" + lock on payment) and it proxies the step's native
 * action button (wired in alter-checkout-cta.js).
 *
 * Brand tokens only (Brockmann --as-font-family, amaranth --as-amaranth) — NOT
 * the maquette's DM Sans / approximate red.
 *
 * Desktop only: on <992px the wrap is hidden and the native buttons + the
 * existing mobile sticky total take over (no fight with the small layout).
 * ========================================================================== */

/* Hidden by default — alter-checkout-cta.js reveals it once a target exists
   (progressive enhancement: JS off → native inline buttons stay the control). */
.ck-sidebar-cta-wrap {
  position: -webkit-sticky;
  position: sticky;
  bottom: 12px;
  z-index: 5;
  margin-top: 18px;
  padding-top: 12px;
  /* Opaque fade so summary content scrolling underneath never bleeds through. */
  background: linear-gradient(to top, var(--as-white, #FFFFFF) 72%, rgba(255, 255, 255, 0));
}

.ck-sidebar-cta-wrap[hidden] {
  display: none;
}

.ck-sidebar-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  border: 0;
  border-radius: var(--as-radius-main, 8px);
  background: var(--as-amaranth, #E62249);
  color: #FFFFFF;
  font-family: var(--as-font-family, 'Brockmann', sans-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: var(--as-shadow-elevated, 0 8px 24px rgba(0, 0, 0, 0.12));
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.ck-sidebar-cta:hover {
  background: var(--as-amaranth-hover, #C71D40);
}

.ck-sidebar-cta:active {
  background: var(--as-amaranth-active, #A8163A);
  transform: translateY(1px);
}

.ck-sidebar-cta:focus-visible {
  outline: var(--as-focus-ring, 2px solid var(--as-amaranth));
  outline-offset: 3px;
}

/* Lock icon: only on the payment step. */
.ck-sidebar-cta__lock {
  display: none;
  align-items: center;
}

.ck-sidebar-cta--pay .ck-sidebar-cta__lock {
  display: inline-flex;
}

.ck-sidebar-cta__lock .material-icons {
  font-size: 18px;
  line-height: 1;
}

.ck-sidebar-cta__amount {
  font-weight: 700;
}

/* Collapsed (no amount yet / non-payment step) → no stray gap. */
.ck-sidebar-cta__amount:empty {
  display: none;
}

/* ── Desktop: the CTA replaces the proxied inline button ──────────────────── */
@media (min-width: 992px) {
  /* Hide exactly the native button the CTA mirrors on steps 1-3 (tagged in JS).
     The payment "Commander" button is never tagged → always stays visible. */
  body.ck-cta-ready .ck-cta-proxied {
    display: none !important;
  }
}

/* ── Mobile: native buttons + existing mobile sticky total drive the tunnel ── */
@media (max-width: 991px) {
  .ck-sidebar-cta-wrap {
    display: none !important;
  }
}
