/* ===================================================================
   COMMERCE UI — Shared funnel components (cart, checkout, catalog)
   v1.0 — Jun 2026
   =================================================================== */

/* --- Hero (checkout-aligned) --- */
.commerce-hero {
  position: relative;
  padding: 28px 0 44px;
  background: linear-gradient(135deg, #006e53, #008c69, #523db8);
  margin-bottom: -12px;
  z-index: 1;
  overflow: hidden;
}

.commerce-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(160deg, hsl(160, 40%, 92%) 0%, hsl(160, 40%, 92%) 40%, hsl(35, 18%, 90%) 100%);
  border-radius: 20px 20px 0 0;
}

.commerce-hero .hero-background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 40%);
  pointer-events: none;
}

.commerce-hero .hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.commerce-hero__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.commerce-hero__subtitle {
  font-size: 0.92rem;
  color: hsla(35, 25%, 92%, 0.88);
  margin: 0 0 12px;
}

.commerce-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  background: hsla(35, 12%, 80%, 0.18);
  border: 1px solid hsla(35, 14%, 82%, 0.28);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

/* --- Funnel progress steps --- */
.commerce-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.commerce-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.commerce-progress__icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: hsla(35, 10%, 80%, 0.15);
  border: 2px solid hsla(35, 12%, 80%, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.commerce-progress__icon i {
  font-size: 1.15rem;
  color: #fff;
}

.commerce-progress__step.active .commerce-progress__icon {
  background: hsl(35, 25%, 92%);
  border-color: #fff;
  box-shadow: 0 4px 14px hsla(35, 14%, 82%, 0.28);
}

.commerce-progress__step.active .commerce-progress__icon i {
  color: #008c69;
}

.commerce-progress__step.completed .commerce-progress__icon {
  background: linear-gradient(135deg, #10b981, #34d399);
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.commerce-progress__label {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  max-width: 88px;
}

.commerce-progress__line {
  width: 48px;
  height: 3px;
  background: hsla(35, 14%, 82%, 0.3);
  border-radius: 2px;
  align-self: flex-start;
  margin-top: 24px;
  flex-shrink: 0;
}

.commerce-progress__line.completed {
  background: #10b981;
}

/* --- Commerce card --- */
.commerce-card {
  background: var(--pw-surface, hsl(35, 25%, 92%));
  border-radius: var(--pw-r-lg, 18px);
  border: 1px solid var(--pw-border, hsl(35, 15%, 82%));
  box-shadow: var(--pw-shadow-md, 0 4px 12px rgba(0,0,0,0.06));
  overflow: hidden;
}

/* --- Trust strip --- */
.commerce-trust-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #008c69;
}

.commerce-trust-strip i {
  margin-inline-end: 4px;
}

/* --- Mobile sticky checkout CTA --- */
.commerce-sticky-cta {
  display: none;
}

@media (max-width: 991px) {
  body.cart-page.has-sticky-cta {
    padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.cart-page.has-sticky-cta:has(#pwa-install-banner.show) {
    padding-bottom: calc(240px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .commerce-sticky-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    z-index: 10050;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--pw-border, hsl(35, 15%, 82%));
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
  }

  /* Push sticky CTA above PWA install banner when visible */
  body.cart-page:has(#pwa-install-banner.show) .commerce-sticky-cta {
    bottom: calc(68px + 92px + env(safe-area-inset-bottom, 0px));
  }

  .commerce-sticky-cta__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .commerce-sticky-cta__label {
    font-size: 0.72rem;
    color: var(--pw-text-3, hsl(215, 12%, 52%));
    font-weight: 600;
  }

  .commerce-sticky-cta__amount {
    font-size: 1.15rem;
    font-weight: 800;
    color: #008c69;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .commerce-sticky-cta__currency {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pw-text-3, hsl(215, 12%, 52%));
    margin-inline-start: 4px;
  }

  .commerce-sticky-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 18px;
    min-height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #008c69, #523db8);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 140, 105, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .commerce-sticky-cta__btn:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 140, 105, 0.35);
  }

  /* Keep checkout button visible inside order summary on mobile */
  body.cart-page .receipt-sidebar .btn-checkout {
    display: flex !important;
    min-height: 48px;
  }

  body.cart-page .receipt-sidebar .checkout-note {
    display: flex !important;
  }
}

@media (max-width: 576px) {
  .commerce-hero {
    padding: 22px 0 36px;
  }

  .commerce-hero__title {
    font-size: 1.45rem;
  }

  .commerce-progress {
    gap: 8px;
  }

  .commerce-progress__icon {
    width: 42px;
    height: 42px;
  }

  .commerce-progress__icon i {
    font-size: 1rem;
  }

  .commerce-progress__line {
    width: 24px;
    margin-top: 20px;
  }

  .commerce-progress__label {
    font-size: 0.68rem;
    max-width: 72px;
  }
}

/* Product page sticky footer spacing */
@media (max-width: 991px) {
  body.product-page {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .commerce-progress__icon,
  .commerce-sticky-cta__btn {
    transition: none;
  }
}