/* Shared cart upsell card (mini-cart + checkout).
 * Dark navy surface — teal accent for emphasis against light cart chrome. */

.veylo-cart-upsell.veylo-cart-upsell--dark {
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, var(--color-black));
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-primary-dark);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-black) 28%, transparent);
  overflow: hidden;
}

.veylo-cart-upsell--dark .veylo-cart-upsell__topbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: color-mix(in srgb, var(--color-black) 18%, var(--color-primary-dark));
  border-bottom: 1px solid color-mix(in srgb, var(--color-on-primary) 12%, transparent);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent) 35%, transparent);
  animation: veylo-upsell-pulse 2.4s ease-out infinite;
}

@keyframes veylo-upsell-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent) 35%, transparent);
  }
  70% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-accent) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .veylo-cart-upsell--dark .veylo-cart-upsell__pulse {
    animation: none;
  }
}

.veylo-cart-upsell--dark .veylo-cart-upsell__tagline {
  color: var(--color-accent);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.veylo-cart-upsell--dark .veylo-cart-upsell__count {
  margin-left: auto;
  color: color-mix(in srgb, var(--color-on-primary) 78%, transparent);
  font-weight: var(--font-weight-medium);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__subline {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: color-mix(in srgb, var(--color-on-primary) 82%, transparent);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__card + .veylo-cart-upsell__card {
  border-top: 1px solid color-mix(in srgb, var(--color-on-primary) 12%, transparent);
  padding-top: var(--space-3);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__media {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid color-mix(in srgb, var(--color-on-primary) 14%, transparent);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__media-link {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.veylo-cart-upsell--dark .veylo-cart-upsell__image,
.veylo-cart-upsell--dark .veylo-cart-upsell__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.veylo-cart-upsell--dark .veylo-cart-upsell__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-snug, 1.3);
  color: var(--color-on-primary);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__title-link {
  color: inherit;
  text-decoration: none;
}

.veylo-cart-upsell--dark .veylo-cart-upsell__title-link:hover {
  text-decoration: underline;
}

.veylo-cart-upsell--dark .veylo-cart-upsell__price {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: color-mix(in srgb, var(--color-on-primary) 78%, transparent);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__price .amount,
.veylo-cart-upsell--dark .veylo-cart-upsell__price .woocommerce-Price-amount {
  color: var(--color-on-primary);
  font-weight: var(--font-weight-bold);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--size-touch);
  min-height: var(--size-touch);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-accent) 35%, transparent);
  transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

.veylo-cart-upsell--dark .veylo-cart-upsell__add:hover:not(:disabled) {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--color-accent) 42%, transparent);
}

.veylo-cart-upsell--dark .veylo-cart-upsell__add:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.veylo-cart-upsell--dark .veylo-cart-upsell__add:disabled,
.veylo-cart-upsell--dark .veylo-cart-upsell__add.is-loading {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

/* Free shipping progress bar (mini-cart + checkout). */
.veylo-free-shipping {
  --progress: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--color-accent) 28%, var(--color-border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
  box-shadow: var(--shadow-sm);
}

.veylo-free-shipping.is-unlocked {
  border-color: color-mix(in srgb, var(--color-promo-bg) 55%, var(--color-border));
  background: color-mix(in srgb, var(--color-promo-bg) 14%, var(--color-surface));
}

.veylo-free-shipping__icon,
.veylo-bogo-nudge__icon {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--color-accent-fill);
  color: var(--color-on-accent);
  box-shadow: none;
}

/* Span message + progress track while free shipping is still locked. */
.veylo-free-shipping:not(.is-unlocked) .veylo-free-shipping__icon {
  grid-row: 1 / span 2;
}

/* Span message + disclaimer rows only when the footnote is present. */
.veylo-bogo-nudge:has(.veylo-bogo-nudge__disclaimer) .veylo-bogo-nudge__icon {
  grid-row: 1 / span 2;
}

.veylo-bogo-nudge:not(:has(.veylo-bogo-nudge__disclaimer)) .veylo-bogo-nudge__message {
  align-self: center;
}

.veylo-free-shipping__icon--badge {
  background: var(--color-promo-bg);
  color: var(--color-promo-text);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--color-promo-bg) 40%, transparent),
    0 2px 8px color-mix(in srgb, var(--color-promo-bg) 35%, transparent);
}

.veylo-free-shipping__glyph,
.veylo-bogo-nudge__glyph {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  line-height: 0;
}

.veylo-free-shipping__icon svg.veylo-icon,
.veylo-bogo-nudge__icon svg.veylo-icon,
.veylo-free-shipping__glyph svg,
.veylo-bogo-nudge__glyph svg {
  display: block;
  width: 14px;
  height: 14px;
}

.veylo-free-shipping__message {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-snug);
  color: var(--color-primary);
}

.veylo-free-shipping.is-unlocked .veylo-free-shipping__message {
  color: var(--color-accent-fill);
}

.veylo-free-shipping__track {
  position: relative;
  grid-column: 2 / -1;
  grid-row: 2;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-background-muted));
}

.veylo-free-shipping__fill {
  position: relative;
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-accent) 85%, var(--color-primary)),
    var(--color-accent)
  );
  transition: width 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Leading-edge "token" — reads as a game progress marker at rest, no motion
 * required, so the bar stays calm and doesn't compete with surrounding copy. */
.veylo-free-shipping__fill::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-on-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent) 45%, transparent);
  transform: translate(50%, -50%);
}

/* Single sparkle sweep — plays once while the bar animates to a new value
 * (see .is-js-animating below) instead of looping forever at rest. */
.veylo-free-shipping__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    color-mix(in srgb, var(--color-on-primary) 40%, transparent) 50%,
    transparent 70%
  );
  background-size: 220% 100%;
  background-position: 130% 0;
  opacity: 0;
  pointer-events: none;
}

.veylo-free-shipping__fill.is-js-animating::after {
  /* Matches the 450ms width transition driven by order-summary.js so the
   * sweep fades out in step with the JS class removal — no abrupt cut. */
  animation: veylo-progress-shimmer 0.45s ease-out 1;
}

.veylo-free-shipping.is-unlocked .veylo-free-shipping__fill {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-promo-bg) 90%, var(--color-accent)),
    var(--color-promo-bg)
  );
}

.veylo-free-shipping.is-unlocked .veylo-free-shipping__fill::before {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-promo-bg) 50%, transparent);
}

.veylo-free-shipping__fill.is-js-animating {
  transition: none;
}

@keyframes veylo-progress-shimmer {
  0% {
    background-position: 130% 0;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    background-position: -40% 0;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .veylo-free-shipping__fill {
    transition: none;
  }

  .veylo-free-shipping__fill.is-js-animating::after {
    animation: none;
  }
}

/* BOGO nudge — distinct from the free-shipping perk. */
.veylo-bogo-nudge {
  --progress: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
  box-shadow: var(--shadow-sm);
}

.veylo-bogo-nudge.is-active {
  border-style: solid;
  border-color: color-mix(in srgb, var(--color-promo-bg) 55%, var(--color-border));
  background: color-mix(in srgb, var(--color-promo-bg) 12%, var(--color-surface));
}

.veylo-bogo-nudge__message {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-snug);
  color: var(--color-primary);
}

/* BOGO disclaimer — compact Apple-style footnote under the nudge message. */
.veylo-bogo-nudge__disclaimer {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: flex-start;
  gap: 0.35em;
  margin: 0;
  min-width: 0;
  padding-top: 1px;
  color: var(--color-text-secondary);
  font-size: var(--text-2xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  letter-spacing: 0.005em;
}

.veylo-bogo-nudge__disclaimer-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  margin-top: 0.15em;
  color: var(--color-accent-fill);
  opacity: 0.9;
}

.veylo-bogo-nudge__disclaimer-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.veylo-bogo-nudge__disclaimer-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Free-gift / BOGO-savings unlocked nudges — matches free-shipping unlocked treatment. */
.veylo-free-gift-nudge,
.veylo-bogo-savings-nudge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--color-promo-bg) 55%, var(--color-border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-promo-bg) 12%, var(--color-surface));
  box-shadow: var(--shadow-sm);
}

.veylo-free-gift-nudge__icon,
.veylo-bogo-savings-nudge__icon {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
  color: var(--color-accent);
}

.veylo-free-gift-nudge__icon--badge,
.veylo-bogo-savings-nudge__icon--badge {
  background: var(--color-promo-bg);
  color: var(--color-promo-text);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--color-promo-bg) 40%, transparent),
    0 2px 8px color-mix(in srgb, var(--color-promo-bg) 35%, transparent);
}

.veylo-bogo-savings-nudge__icon--locked {
  background: color-mix(in srgb, var(--color-text-secondary) 14%, var(--color-surface));
  color: var(--color-text-secondary);
  box-shadow: none;
}

.veylo-bogo-savings-nudge.is-locked .veylo-bogo-savings-nudge__message {
  /* Disabled (muted) but still clearly readable. */
  color: color-mix(in srgb, var(--color-text-secondary) 78%, var(--color-surface));
}

.veylo-free-gift-nudge__glyph,
.veylo-bogo-savings-nudge__glyph {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  line-height: 0;
}

.veylo-free-gift-nudge__icon svg.veylo-icon,
.veylo-free-gift-nudge__glyph svg,
.veylo-bogo-savings-nudge__icon svg.veylo-icon,
.veylo-bogo-savings-nudge__glyph svg {
  display: block;
  width: 14px;
  height: 14px;
}

.veylo-free-gift-nudge__message,
.veylo-bogo-savings-nudge__message {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-snug);
  color: var(--color-accent-fill);
}
