/*-----------------------------------------------------------------------------------

    Project : Fitness Fuel - Health & Fitness Supplement Store
    File    : Cart UI - header cart button, cart drawer, add-to-cart toast
    Loads   : after fitness-fuel.css

    01. Header cart button
    02. Drawer
    03. Quantity stepper
    04. Toast

-----------------------------------------------------------------------------------*/
.ff-cart-btn,
.ff-cart,
.ff-toast {
  --ffc-neon: #39D353;
  --ffc-accent: var(--ff-green, #EDC001);
  --ffc-ink: #F4F7F5;
  --ffc-muted: rgba(244, 247, 245, 0.62);
  --ffc-line: rgba(255, 255, 255, 0.1);
  --ffc-surface: #0D1411;
  --ffc-ease: cubic-bezier(0.22, 0.8, 0.22, 1);
}

/*----------------------------------------*/
/*  01. Header cart button
/*----------------------------------------*/
.eg-menu__header-actions {
  gap: 18px;
}

/* spacing now comes from the flex gap above */
.eg-menu__header-actions .eg-menu__header-btn {
  margin-right: 0;
}

.ff-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ffc-ink);
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.ff-cart-btn:hover {
  background: #fff;
  border-color: #fff;
  color: #0A0D0C;
}

.ff-cart-btn:focus-visible {
  outline: 2px solid var(--ffc-neon);
  outline-offset: 3px;
}

.ff-cart-btn__count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--ffc-accent);
  box-shadow: 0 0 0 2px #0A0D0C;
  color: #0A0D0C;
  font-family: var(--eg-body-font-family);
  font-size: 11px;
  font-weight: 800;
  line-height: 21px;
  text-align: center;
}

.ff-cart-btn__count[hidden] {
  display: none;
}

.ff-cart-btn__count.is-bumped {
  animation: ffCartBump 0.45s var(--ffc-ease);
}

@keyframes ffCartBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@media (max-width: 1199.98px) {
  /* sits just left of the round mobile menu toggler */
  .eg-menu__header-actions {
    margin-right: 12px;
  }

  .ff-cart-btn {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 575.98px) {
  .eg-menu__header-actions {
    margin-right: 10px;
  }

  .ff-cart-btn {
    width: 48px;
    height: 48px;
  }
}

/*----------------------------------------*/
/*  02. Drawer
/*----------------------------------------*/
.ff-cart {
  position: fixed;
  inset: 0;
  z-index: 1090;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.42s;
}

.ff-cart.is-open {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.ff-cart__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 5, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.ff-cart.is-open .ff-cart__backdrop {
  opacity: 1;
}

.ff-cart__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  height: 100%;
  border-left: 1px solid var(--ffc-line);
  background: var(--ffc-surface);
  box-shadow: -30px 0 70px rgba(0, 0, 0, 0.45);
  color: var(--ffc-ink);
  transform: translateX(100%);
  transition: transform 0.42s var(--ffc-ease);
}

.ff-cart.is-open .ff-cart__panel {
  transform: none;
}

.ff-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--ffc-line);
}

.ff-cart .ff-cart__title {
  margin: 0;
  color: #fff;
  font-family: var(--eg-heading-font-family);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ff-cart__count {
  color: var(--ffc-muted);
  font-weight: 400;
}

.ff-cart__close,
.ff-cart__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--ffc-line);
  background: transparent;
  color: var(--ffc-muted);
  transition: all 0.25s ease;
}

.ff-cart__close {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.ff-cart__close:hover {
  background: var(--ffc-accent);
  border-color: var(--ffc-accent);
  color: #0A0D0C;
}

.ff-cart__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 24px;
}

.ff-cart__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-cart__item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ffc-line);
}

.ff-cart__thumb {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 72px;
  height: 88px;
  padding: 8px 6px 6px;
  border-radius: 14px;
  background: radial-gradient(90% 60% at 50% 100%, rgba(57, 211, 83, 0.12), rgba(255, 255, 255, 0.03));
}

.ff-cart__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
}

.ff-cart__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ff-cart__name {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.ff-cart__meta {
  margin-top: 2px;
  color: var(--ffc-muted);
  font-size: 12px;
}

.ff-cart__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.ff-cart__price {
  color: #fff;
  font-family: var(--eg-heading-font-family);
  font-size: 19px;
  font-weight: 600;
}

.ff-cart__remove {
  width: 36px;
  height: 36px;
  border-color: transparent;
  font-size: 14px;
}

.ff-cart__remove:hover {
  border-color: var(--ffc-accent);
  color: var(--ffc-accent);
}

.ff-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 70px 10px;
  color: var(--ffc-muted);
  font-size: 14px;
  text-align: center;
}

.ff-cart__empty strong {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.ff-cart__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: rgba(57, 211, 83, 0.12);
  color: var(--ffc-neon);
}

.ff-cart__empty-icon svg {
  width: 26px;
  height: 26px;
}

.ff-cart__foot {
  padding: 20px 24px 26px;
  border-top: 1px solid var(--ffc-line);
  background: rgba(0, 0, 0, 0.2);
}

.ff-cart__subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ffc-muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ff-cart__subtotal strong {
  color: #fff;
  font-family: var(--eg-heading-font-family);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0;
}

.ff-cart .ff-cart__note {
  margin: 6px 0 18px;
  color: var(--ffc-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ff-cart .ff-cart__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
}

.ff-cart .eg-btn::after {
  background-color: #fff;
}

.ff-cart .eg-btn:hover {
  color: #0A0D0C;
  border-color: #fff;
}

.ff-cart__close:focus-visible,
.ff-cart__remove:focus-visible,
.ff-cart .eg-btn:focus-visible,
.ff-qty__btn:focus-visible {
  outline: 2px solid var(--ffc-neon);
  outline-offset: 2px;
}

/*----------------------------------------*/
/*  03. Quantity stepper
/*----------------------------------------*/
.ff-qty {
  display: inline-flex;
  align-items: center;
  border-radius: 50px;
  border: 1px solid var(--ffc-line);
}

.ff-qty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ffc-ink);
  font-size: 18px;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ff-qty__btn:hover:not([disabled]) {
  background: rgba(255, 255, 255, 0.08);
}

.ff-qty__btn[disabled] {
  color: rgba(255, 255, 255, 0.25);
  cursor: not-allowed;
}

.ff-qty__value {
  min-width: 26px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/*----------------------------------------*/
/*  04. Toast
/*----------------------------------------*/
.ff-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(470px, calc(100% - 32px));
  padding: 10px 10px 10px 10px;
  border: 1px solid rgba(57, 211, 83, 0.35);
  border-radius: 18px;
  background: rgba(13, 20, 17, 0.97);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color: var(--ffc-ink);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 20px);
  transition: opacity 0.3s ease, transform 0.35s var(--ffc-ease), visibility 0.3s ease;
}

.ff-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.ff-toast.is-warning {
  border-color: rgba(237, 192, 1, 0.5);
}

.ff-toast__thumb {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 58px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(57, 211, 83, 0.1);
}

.ff-toast__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
}

.ff-toast__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
}

.ff-toast__text strong {
  color: #fff;
  font-weight: 700;
}

.ff-toast__sub {
  margin-top: 2px;
  color: var(--ffc-muted);
  font-size: 12px;
}

.ff-toast__action {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 50px;
  border: 1px solid rgba(57, 211, 83, 0.5);
  background: transparent;
  color: var(--ffc-neon);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.ff-toast__action:hover {
  background: var(--ffc-neon);
  color: #0A0D0C;
}

.ff-toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ffc-muted);
  font-size: 13px;
}

.ff-toast__close:hover {
  color: #fff;
}

.ff-toast__action:focus-visible,
.ff-toast__close:focus-visible {
  outline: 2px solid var(--ffc-neon);
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .ff-toast {
    bottom: 14px;
    gap: 10px;
  }

  .ff-toast__action {
    padding: 9px 11px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ff-cart__panel,
  .ff-cart__backdrop,
  .ff-toast {
    transition: none;
  }

  .ff-cart-btn__count.is-bumped {
    animation: none;
  }
}
