/**
 * Commerce Sticky Action System — signature floating luxury bar.
 * Types: checkout (cart) · purchase (product) · place_order (checkout)
 */

.sg-commerce-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 130;
  padding: 0.85rem var(--sg-container-pad, 0.85rem) calc(0.85rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  transform: translateY(calc(110% + 1rem));
  opacity: 0;
  transition:
    transform .62s cubic-bezier(.34, 1.25, .64, 1),
    opacity .42s cubic-bezier(.22, 1, .36, 1);
}
.sg-commerce-sticky.is-visible {
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
}
.sg-commerce-sticky.is-exiting {
  transform: translateY(calc(110% + 0.5rem));
  opacity: 0;
  transition-duration: .48s;
}

.sg-commerce-sticky__inner {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  min-height: 3.75rem;
  border-radius: 1.35rem;
  background: color-mix(in srgb, var(--sg-page-bg) 82%, transparent);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  border: 1px solid color-mix(in srgb, var(--sg-border) 58%, transparent);
  box-shadow:
    0 -4px 6px color-mix(in srgb, var(--sg-ink) 3%, transparent),
    0 -16px 48px color-mix(in srgb, var(--sg-ink) 14%, transparent),
    0 -32px 80px color-mix(in srgb, var(--sg-accent) 8%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 32%, transparent);
}

.sg-commerce-sticky__amount-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.sg-commerce-sticky__amount-label {
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sg-muted);
}
.sg-commerce-sticky__amount {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  transition: transform .35s cubic-bezier(.34, 1.2, .64, 1);
}
.sg-commerce-sticky__amount.is-pulse {
  animation: sg-sticky-amount-pop .42s cubic-bezier(.34, 1.2, .64, 1);
}
@keyframes sg-sticky-amount-pop {
  0% { transform: scale(0.92); opacity: 0.6; }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

.sg-commerce-sticky__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.sg-commerce-sticky__cta {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform .32s cubic-bezier(.22, 1, .36, 1), box-shadow .32s ease;
  white-space: nowrap;
}
.sg-commerce-sticky__cta--primary {
  background: var(--sg-ink);
  color: var(--sg-page-bg);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--sg-ink) 24%, transparent);
}
.sg-commerce-sticky__cta--primary:hover { transform: translateY(-1px); }
.sg-commerce-sticky__cta--primary:active,
.sg-commerce-sticky__cta--primary.is-pressed { transform: scale(0.96); }

.sg-commerce-sticky__cta--secondary {
  background: transparent;
  color: var(--sg-ink);
  border: 1px solid color-mix(in srgb, var(--sg-border) 70%, transparent);
  box-shadow: none;
  padding: 0.75rem 1rem;
}
.sg-commerce-sticky__cta--secondary:active,
.sg-commerce-sticky__cta--secondary.is-pressed { transform: scale(0.96); }

.sg-commerce-sticky__cta--tertiary {
  background: color-mix(in srgb, #25d366 12%, var(--sg-surface));
  color: #128c7e;
  border: 1px solid color-mix(in srgb, #25d366 35%, transparent);
  box-shadow: none;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Premium bag icon */
.sg-commerce-sticky__cta-icon {
  width: 1rem;
  height: 1rem;
  position: relative;
  flex-shrink: 0;
}
.sg-commerce-sticky__cta-icon--bag::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 55%;
  width: 0.72rem;
  height: 0.62rem;
  border: 1.5px solid currentColor;
  border-radius: 0 0 3px 3px;
  transform: translate(-50%, -50%);
}
.sg-commerce-sticky__cta-icon--bag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 22%;
  width: 0.42rem;
  height: 0.32rem;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  transform: translate(-50%, 0);
}

/* Family personality */
.sg-commerce-sticky__inner--luxury .sg-commerce-sticky__cta--primary {
  background: var(--sg-accent);
  color: var(--sg-accent-contrast, #fff);
  box-shadow: 0 12px 36px color-mix(in srgb, var(--sg-accent) 32%, transparent);
}
.sg-commerce-sticky__inner--editorial {
  border-radius: 0;
}
.sg-commerce-sticky__inner--editorial .sg-commerce-sticky__cta--primary {
  border-radius: 0;
}
.sg-commerce-sticky__inner--minimal .sg-commerce-sticky__inner,
.sg-commerce-sticky__inner--minimal {
  border-radius: 14px;
}
.sg-commerce-sticky__inner--minimal .sg-commerce-sticky__cta--primary {
  border-radius: 10px;
  box-shadow: none;
}
.sg-commerce-sticky__inner--glass {
  background: color-mix(in srgb, var(--sg-surface) 50%, transparent);
  box-shadow:
    0 -20px 60px color-mix(in srgb, var(--sg-accent) 14%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent);
}
.sg-commerce-sticky__inner--organic {
  border-radius: 1.5rem;
}

/* ── Shop page: cart left · checkout pill right (fashion bar spacing) ── */
.sg-commerce-sticky--shop .sg-commerce-sticky__inner {
  justify-content: stretch;
  gap: 0.75rem;
}

.sg-commerce-sticky--shop .sg-commerce-sticky__actions {
  flex: 1;
  min-width: 0;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.sg-commerce-sticky--shop .sg-commerce-sticky__cta--secondary {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.5rem 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--sg-ink);
}

.sg-commerce-sticky--shop .sg-commerce-sticky__cta--secondary:hover {
  opacity: 0.82;
}

.sg-commerce-sticky--shop .sg-commerce-sticky__cta--primary {
  flex-shrink: 0;
  margin-left: auto;
}
