/* Cart floating action button — fixed to the viewport, stays put over scroll */
.cart-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 15;
  appearance: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 62px;
  padding: 0 23px;
  border: none;
  border-radius: 31px;
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  box-shadow: var(--md-elevation-2);
}

.cart-fab[hidden] {
  display: none;
}

.cart-fab-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

#cartCount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  border-radius: 13px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-size: 16px;
  font-weight: 700;
}

/* Stacks the struck-through full price above the (possibly discounted) total. */
.cart-fab-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.cart-fab-was {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.75;
  text-decoration: line-through;
}

.cart-fab-was[hidden] {
  display: none;
}

#cartTotal.discount {
  color: #e53935;
}

/* A red countdown bubble floating just above the cart button, only while an
   item actually in the cart is on discount — same live ticker as everywhere
   else (discounts.js:startCountdownTicker reads any [data-discount-timer]). */
.cart-fab-timer {
  position: absolute;
  top: -28px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 10px;
  background: #e53935;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--md-elevation-1);
}

.cart-fab-timer[hidden] {
  display: none;
}

/* Plays once, exactly when the cart's total actually turns into a discounted
   one (see cart.js) — old price rises into its struck-through slot as the new
   red total pops in underneath it. */
@keyframes cart-was-rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 0.75;
  }
}

@keyframes cart-total-pop {
  from {
    transform: translateY(8px) scale(0.85);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.cart-fab-was.cart-price-pop {
  animation: cart-was-rise 0.32s ease;
}

#cartTotal.cart-price-pop {
  animation: cart-total-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
  .cart-fab-was.cart-price-pop,
  #cartTotal.cart-price-pop {
    animation: none;
  }
}

/* Support FAB — same height as the cart FAB, mirrored to the left edge.
   Starts as a wide pill with a label, then collapses to a bare circle
   (see the setTimeout in catalog.js that adds .collapsed). */
.support-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 15;
  display: flex;
  align-items: center;
  height: 62px;
  padding: 0 18px;
  border-radius: 31px;
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  box-shadow: var(--md-elevation-2);
  text-decoration: none;
}

.support-fab-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--md-primary);
  color: var(--md-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.support-fab-label {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  max-width: 160px;
  margin-left: 8px;
  opacity: 1;
  transition: max-width 0.4s ease, opacity 0.25s ease, margin-left 0.4s ease;
}

.support-fab.collapsed .support-fab-label {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
}

/* "Уведомлять о скидках и новинках" — floating push opt-in over the catalog,
   shown for a few seconds after load (see public/js/push.js), above the FABs. */
.push-prompt {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 16;
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  appearance: none;
  cursor: pointer;
  max-width: calc(100vw - 32px);
  padding: 14px 22px;
  border: none;
  border-radius: 28px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--md-elevation-2), 0 0 0 4px rgba(244, 196, 48, 0.25);
}

.push-prompt[hidden] {
  display: none;
}

.push-prompt.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.push-prompt:disabled {
  cursor: default;
}

@media (max-width: 400px) {
  .push-prompt {
    font-size: 14px;
    padding: 12px 18px;
    white-space: normal;
    text-align: center;
  }
}
