/* Floating cart pill + fly-to-cart animation + bottom drawer */
:root {
  --fcart-ink: #14151a;
  --fcart-ink-soft: #4b4b57;
  --fcart-muted: #8a8a95;
  --fcart-line: #ecebf0;
  --fcart-accent: var(--bs-primary, #5b4bf5);
  --fcart-accent-soft: #efecfe;
  --fcart-success: #17b26a;
}

/* ---------- FLYING IMAGE ---------- */
.fcart-flying-img {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  object-fit: cover;
  pointer-events: none;
  box-shadow: 0 10px 24px -8px rgba(20, 21, 26, 0.35);
  will-change: transform, border-radius, opacity;
}

/* ---------- FLOATING PILL ---------- */
@keyframes fcartPillPulse {
  0% { transform: translateX(-50%) scale(1); }
  45% { transform: translateX(-50%) scale(1.08); }
  100% { transform: translateX(-50%) scale(1); }
}

.fcart-pill {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  opacity: 0;
  background: linear-gradient(135deg, var(--fcart-accent), #7a6bff);
  color: #fff;
  border-radius: 999px;
  padding: 10px 10px 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 20px 45px -15px rgba(91, 75, 245, 0.55);
  cursor: pointer;
  z-index: 1050;
  border: none;
  transition: transform 0.45s cubic-bezier(0.22, 0.68, 0, 1.01), opacity 0.35s ease;
}

.fcart-pill.fcart-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.fcart-pill.fcart-pulse {
  animation: fcartPillPulse 0.35s ease-out;
}

.fcart-pill-thumbs {
  display: flex;
}

.fcart-pill-thumbs img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--fcart-accent);
  margin-inline-end: -10px;
  background: #fff;
}

.fcart-pill-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: start;
}

.fcart-pill-text b {
  font-size: 13.5px;
  font-weight: 800;
}

.fcart-pill-text span {
  font-size: 11px;
  opacity: 0.85;
}

.fcart-pill-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fcart-pill-arrow svg {
  width: 15px;
  height: 15px;
}

[dir="rtl"] .fcart-pill-arrow svg {
  transform: scaleX(-1);
}

/* ---------- OVERLAY + DRAWER ---------- */
.fcart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 21, 26, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1090;
}

.fcart-overlay.fcart-visible {
  opacity: 1;
  pointer-events: auto;
}

.fcart-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 420px;
  max-width: 94vw;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(20, 21, 26, 0.4);
  transform: translate(-50%, 100%);
  transition: transform 0.45s cubic-bezier(0.22, 0.68, 0, 1.01);
  z-index: 1100;
  padding: 20px 20px 24px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.fcart-drawer.fcart-open {
  transform: translate(-50%, 0);
}

.fcart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.fcart-drawer-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--fcart-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.fcart-drawer-head .fcart-count {
  background: var(--fcart-accent-soft);
  color: var(--fcart-accent);
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
}

.fcart-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--fcart-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fcart-ink-soft);
}

.fcart-close-btn svg {
  width: 14px;
  height: 14px;
}

.fcart-items {
  overflow-y: auto;
  margin-bottom: 14px;
}

/* Reused site cart-dropdown markup rendered inside the drawer body */
.fcart-items .cart-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fcart-items .cart-footer {
  display: none;
}

.fcart-delivery-check {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--fcart-accent-soft);
  color: var(--fcart-accent);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.fcart-delivery-check.fcart-free {
  background: rgba(23, 178, 106, 0.12);
  color: var(--fcart-success);
}

.fcart-delivery-check .fcart-spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(91, 75, 245, 0.3);
  border-top-color: var(--fcart-accent);
  animation: fcartSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes fcartSpin {
  to { transform: rotate(360deg); }
}

.fcart-subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--fcart-ink-soft);
  margin-bottom: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--fcart-line);
}

.fcart-subtotal-row b {
  color: var(--fcart-ink);
  font-size: 16px;
}

.fcart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--fcart-ink);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 15px 18px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
}

.fcart-checkout-btn:hover {
  background: #000;
  color: #fff;
}

.fcart-empty-state {
  text-align: center;
  padding: 30px 10px;
  color: var(--fcart-muted);
  font-size: 13.5px;
}

@media (prefers-reduced-motion: reduce) {
  .fcart-pill,
  .fcart-drawer,
  .fcart-overlay,
  .fcart-pill.fcart-pulse {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .fcart-drawer {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
  }
}
