/* ──────────────────────────────────────────────────────────
   Utility: Badges
   ────────────────────────────────────────────────────────── */
.discount-badge {
  background: #e74c3c;
  color: #fff;
}
.stock-badge {
  background: #3498db;
  color: #fff;
}

/* ──────────────────────────────────────────────────────────
   Utility: Confetti
   ────────────────────────────────────────────────────────── */
.confetti {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
@keyframes fall {
  0%   { transform: translateY(-20px); }
  100% { transform: translateY(100vh); }
}
.confetti span {
  position: absolute;
  width: 6px; height: 6px;
  background: gold;
  animation: fall 1.5s linear infinite;
}

/* ──────────────────────────────────────────────────────────
   Fixed Cart/Wish Toggles (always visible at bottom)
   ────────────────────────────────────────────────────────── */
.shop-controls-fixed {
  position: fixed;
  left: 0; right: 0; bottom: 1rem;
  height: 3.5rem;
  pointer-events: none; /* allow children to receive clicks */
  z-index: 2000;
}

/* Toggle buttons (Cart & Wish) */
.toggle-btn {
  position: absolute;
  bottom: 0;
  transform: translateY(50%);
  pointer-events: auto;
  z-index: 2001;
  font-size: 1.2rem; /* adjust icon/button size */
}

/* Cart on left, Wishlist on right */
.toggle-btn.left  { left: 1rem;  }
.toggle-btn.right { right: 1rem; }

/* ──────────────────────────────────────────────────────────
   Unified Panel Styles (Cart & Wishlist Popups)
   ────────────────────────────────────────────────────────── */
.panel {
  display: none;               /* hidden by default */
  position: fixed;             /* float above content */
  bottom: calc(3.5rem + 0.5rem); /* toggles height + gap */
  width: 320px;
  height: 45vh;                /* ~half viewport */
  max-height: 90vh;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  z-index: 2000;
}

/* Show panel when JS toggles .show */
.panel.show {
  display: flex;
}

/* Position each panel under its toggle */
.panel-cart { left: 1rem;  }
.panel-wish { right: 1rem; }

/* ──────────────────────────────────────────────────────────
   Panel Sections & Scrollable Body
   ────────────────────────────────────────────────────────── */
.panel-header,
.panel-footer {
  flex: none;
  padding: 0.5rem;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move; /* drag by header */
}


.panel-footer {
  border-top: 1px solid #ddd;
  border-bottom: none;
}
.panel-body {
  flex: 1;
  padding: 0.5rem;
  overflow-y: auto;
}

/* ──────────────────────────────────────────────────────────
   Header‐Control Buttons (Minimize / Maximize / Close)
   ────────────────────────────────────────────────────────── */
.header-controls button {
  margin-left: 0.25rem;
  padding: 0 0.4rem;
  font-size: 0.9rem;
}

/* ──────────────────────────────────────────────────────────
   Minimized & Maximized States
   ────────────────────────────────────────────────────────── */
.panel.minimized .panel-body,
.panel.minimized .panel-footer {
  display: none;
}
.panel.maximized {
  top: 1rem !important;
  left: 1rem !important;
  right: 1rem !important;
  bottom: 1rem !important;
  width: auto !important;
  height: auto !important;
  max-width: none;
  max-height: none;
}

/* ──────────────────────────────────────────────────────────
   Edge Resizer Handles (drag any edge to resize)
   ────────────────────────────────────────────────────────── */
.resizer {
  position: absolute;
  background: transparent;
  z-index: 2500;
}
.resizer.top,
.resizer.bottom {
  left: 0; right: 0; height: 6px;
  cursor: ns-resize;
}
.resizer.left,
.resizer.right {
  top: 0; bottom: 0; width: 6px;
  cursor: ew-resize;
}
.resizer.top    { top: 0; }
.resizer.bottom { bottom: 0; }
.resizer.left   { left: 0; }
.resizer.right  { right: 0; }

/* Make panel headers sit above the resizer handles */
.panel-header {
  position: relative;
  z-index: 2;
}

/* Keep edge handles underneath header controls */
.resizer {
  z-index: 1;
}
