/* ═══════════════════════════════════════════════════════════════
   panels.css — Cart & Wishlist dropdown panels
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper (trigger + dropdown) ───────────────────────────── */
.panel-wrap {
  position: relative;
}

/* ── Trigger button (the icon) ──────────────────────────────── */
.panel-trigger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  transition: background 0.15s;
}

.panel-trigger:hover { background: var(--bg-surface-alt); }

@keyframes panelFlash {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}
.panel-flash { animation: panelFlash 0.4s ease; }

/* ── Badge ──────────────────────────────────────────────────── */
.panel-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-primary);
  color: var(--accent-inverted-text);
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

/* ── Dropdown panel ─────────────────────────────────────────── */
.panel-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 40px var(--shadow-lg);
  z-index: 1200;
  overflow: hidden;
  animation: dropdownIn 0.15s ease;
}

.panel-dropdown.panel-open { display: flex; flex-direction: column; }

/* ── Header ─────────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-surface-alt);
}

.panel-clear-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  width: auto;
  border-radius: 0;
  transition: color 0.15s;
  display: inline;
  margin: 0;
}
.panel-clear-btn:hover { color: var(--text-primary); background: none; }

/* ── List ───────────────────────────────────────────────────── */
.panel-list {
  flex: 1;
  max-height: 340px;
  overflow-y: auto;
  padding: 8px 0;
}

.panel-empty {
  padding: 30px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Item row ───────────────────────────────────────────────── */
.panel-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.1s;
}

.panel-item:last-child { border-bottom: none; }
.panel-item:hover      { background: var(--bg-surface-alt); }

/* Image thumbnail */
.panel-item-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--skeleton-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-img-placeholder {
  font-size: 22px;
}

/* Info column */
.panel-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.panel-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-item-price {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 700;
}

/* Qty controls (cart only) */
.panel-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.panel-item-qty button {
  background: var(--bg-surface-alt);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-primary);
  transition: background 0.15s;
  margin: 0;
}

.panel-item-qty button:hover { background: var(--border-color); }

.panel-item-qty span {
  font-size: 12px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  color: var(--text-primary);
}

/* Move to cart (wishlist only) */
.panel-move-btn {
  margin-top: 5px;
  background: var(--accent-primary);
  color: var(--accent-inverted-text);
  border: none;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s;
  width: auto;
  display: inline-block;
  margin-left: 0;
}
.panel-move-btn:hover { background: var(--accent-hover); }

/* Remove × button */
.panel-item-remove {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
  display: flex;
  align-self: flex-start;
  margin: 0;
  width: auto;
}
.panel-item-remove:hover { color: var(--text-primary); background: none; }

/* ── Footer (cart total + checkout) ─────────────────────────── */
.panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-checkout-btn {
  background: var(--accent-primary);
  color: var(--accent-inverted-text);
  border: none;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  width: auto;
  display: inline-block;
  margin: 0;
}
.panel-checkout-btn:hover { background: var(--accent-hover); }

/* ── Footer actions (Quotation + Checkout side by side) ───── */
.panel-footer-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.panel-quote-btn {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color-hover);
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  width: auto;
  display: inline-block;
  margin: 0;
}
.panel-quote-btn:hover {
  background: var(--bg-surface-alt);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ── Responsive Panels ── */
@media (max-width: 768px) {
  .panel-wrap { 
    position: static; /* Dropdowns align to the fixed header-right-panel */
  }
  .panel-dropdown {
    width: calc(100% - 40px); /* 100% of side panel minus 20px padding * 2 */
    left: 20px;
    right: auto;
    top: 85px; /* Immediately under the icon group border */
  }
  .panel-list {
    max-height: 40vh;
  }
}

@media (max-width: 480px) {
  .panel-dropdown {
    /* No major changes needed here anymore since it's aligned to the 260px side panel safely */
  }
}
