/*
 * Foxco Cart & Checkout — Floating Cart
 * ====================================== */

/* ── FAB Wrapper ──────────────────────────────────────────────── */
.fcc-fab-wrap {
  position: fixed;
  z-index: 99990;
  transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
}

/* Positions */
.fcc-fab-wrap.fcc-pos-bottom-right { bottom: 28px; right: 28px; }
.fcc-fab-wrap.fcc-pos-bottom-left  { bottom: 28px; left: 28px; }
.fcc-fab-wrap.fcc-pos-top-right    { top: 80px; right: 28px; }
.fcc-fab-wrap.fcc-pos-top-left     { top: 80px; left: 28px; }

/* Hidden state */
.fcc-fab-wrap.fcc-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.8);
}

/* ── FAB Button ───────────────────────────────────────────────── */
.fcc-fab-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--fcc-primary, #3b82f6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22), 0 1px 4px rgba(0,0,0,0.12);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.fcc-fab-btn:hover {
  background: var(--fcc-primary-dark, #2563eb);
  transform: scale(1.07);
  box-shadow: 0 8px 28px rgba(0,0,0,0.26);
}
.fcc-fab-btn:focus-visible {
  outline: 3px solid var(--fcc-primary, #3b82f6);
  outline-offset: 3px;
}
.fcc-fab-btn:active { transform: scale(0.96); }

.fcc-fab-icon { display: block; }

.fcc-fab-custom-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Count badge */
.fcc-count-bubble {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.20);
  border: 2px solid #fff;
  transition: transform .2s ease, opacity .2s ease;
}
.fcc-count-bubble.fcc-hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

/* Bounce animation on add-to-cart */
.fcc-fab-wrap.fcc-bounce .fcc-fab-btn {
  animation: fcc-bounce 0.55s ease;
}
@keyframes fcc-bounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.22); }
  55%  { transform: scale(0.90); }
  75%  { transform: scale(1.10); }
  100% { transform: scale(1); }
}

/* ── Shared Panel Styles (dropdown + drawer) ──────────────────── */
.fcc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fcc-border, #e2e8f0);
  background: var(--fcc-heading-bg, #1e293b);
  color: var(--fcc-heading-color, #fff);
}
.fcc-panel-header strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.fcc-panel-close {
  background: transparent;
  border: none;
  color: var(--fcc-heading-color, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  opacity: 0.75;
  transition: opacity .15s, background .15s;
}
.fcc-panel-close:hover { opacity: 1; background: rgba(255,255,255,0.15); }

/* Panel body */
.fcc-panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Mini-cart inner */
.fcc-mc-inner { display: flex; flex-direction: column; height: 100%; }

/* Empty state */
.fcc-mc-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--fcc-text-muted, #64748b);
  gap: 12px;
}
.fcc-mc-empty svg { opacity: 0.35; }
.fcc-mc-empty p { font-size: 14px; margin: 0 0 8px; }

/* Items list */
.fcc-mc-items {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}
.fcc-mc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--fcc-border, #e2e8f0);
  transition: background .15s;
}
.fcc-mc-item:hover { background: var(--fcc-accent-bg, #f0f9ff); }
.fcc-mc-item:last-child { border-bottom: none; }

.fcc-mc-thumb img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--fcc-radius, 8px);
  display: block;
  flex-shrink: 0;
}

.fcc-mc-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fcc-mc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fcc-text, #0f172a);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  transition: color .15s;
}
.fcc-mc-name:hover { color: var(--fcc-primary, #3b82f6); }
.fcc-mc-qty {
  font-size: 12px;
  color: var(--fcc-text-muted, #64748b);
}
.fcc-mc-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--fcc-primary, #3b82f6);
  flex-shrink: 0;
}

/* Footer */
.fcc-mc-footer {
  border-top: 1px solid var(--fcc-border, #e2e8f0);
  padding: 16px 18px;
  background: var(--fcc-surface, #fff);
}
.fcc-mc-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 14px;
}
.fcc-mc-total strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--fcc-primary, #3b82f6);
}

.fcc-mc-actions {
  display: flex;
  gap: 8px;
}

/* Shared button styles for mini-cart */
.fcc-btn-primary,
.fcc-btn-sec {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: var(--fcc-radius, 8px);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
  border: none;
  line-height: 1;
}
.fcc-btn-primary {
  background: var(--fcc-primary, #3b82f6);
  color: #fff !important;
}
.fcc-btn-primary:hover {
  background: var(--fcc-primary-dark, #2563eb);
  box-shadow: 0 4px 14px rgba(var(--fcc-primary-rgb, 59,130,246), 0.35);
  transform: translateY(-1px);
}
.fcc-btn-sec {
  background: var(--fcc-accent-bg, #eff6ff);
  color: var(--fcc-text, #0f172a) !important;
  border: 1px solid var(--fcc-border, #dde6f0);
}
.fcc-btn-sec:hover {
  background: var(--fcc-border, #dde6f0);
  transform: translateY(-1px);
}

/* ── DROPDOWN PANEL ───────────────────────────────────────────── */
.fcc-dropdown {
  position: absolute;
  width: 330px;
  max-height: 500px;
  background: var(--fcc-surface, #fff);
  border-radius: var(--fcc-radius-lg, 14px);
  box-shadow: 0 16px 50px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  border: 1px solid var(--fcc-border, #dde6f0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Positioning relative to FAB */
  bottom: calc(100% + 12px);
  right: 0;
  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
}

/* Left-aligned positions */
.fcc-pos-bottom-left .fcc-dropdown,
.fcc-pos-top-left .fcc-dropdown {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}

/* Top positions */
.fcc-pos-top-right .fcc-dropdown,
.fcc-pos-top-left .fcc-dropdown {
  bottom: auto;
  top: calc(100% + 12px);
  transform-origin: top right;
}
.fcc-pos-top-left .fcc-dropdown { transform-origin: top left; }

.fcc-dropdown.fcc-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* ── DRAWER ───────────────────────────────────────────────────── */
.fcc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  background: var(--fcc-surface, #fff);
  z-index: 99995;
  box-shadow: -8px 0 40px rgba(0,0,0,0.16);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.fcc-pos-bottom-left ~ .fcc-drawer,
.fcc-pos-top-left ~ .fcc-drawer {
  left: 0;
  right: auto;
  transform: translateX(-100%);
  box-shadow: 8px 0 40px rgba(0,0,0,0.16);
}

.fcc-drawer.fcc-open { transform: translateX(0); }

/* Drawer overlay */
.fcc-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99994;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.fcc-drawer-overlay.fcc-open {
  opacity: 1;
  visibility: visible;
}

/* Body lock when drawer open */
body.fcc-drawer-active {
  overflow: hidden;
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .fcc-fab-wrap.fcc-pos-bottom-right { bottom: 20px; right: 16px; }
  .fcc-fab-wrap.fcc-pos-bottom-left  { bottom: 20px; left: 16px; }
  .fcc-fab-wrap.fcc-pos-top-right    { top: 70px; right: 16px; }
  .fcc-fab-wrap.fcc-pos-top-left     { top: 70px; left: 16px; }

  .fcc-dropdown {
    width: calc(100vw - 32px);
    right: 0;
    left: auto;
  }
  .fcc-pos-bottom-left .fcc-dropdown,
  .fcc-pos-top-left .fcc-dropdown {
    left: 0;
    right: auto;
  }

  .fcc-drawer { width: 100vw; max-width: 100vw; }
}
