/* ======== CART BADGE ======== */
.cart-icon-wrap {
  position: relative;
  display: inline-flex;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
}

/* ======== CART OVERLAY ======== */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  visibility: hidden;
}

.cart-overlay.show {
  visibility: visible;
}

.cart-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s;
}

.cart-overlay.show .cart-overlay-bg {
  opacity: 1;
}

/* ======== CART PANEL ======== */
.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100vw, 420px);
  height: 100%;
  background: var(--card-bg, #1e2330);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.35);
}

.cart-overlay.show .cart-panel {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.cart-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.cart-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ======== CART ITEMS ======== */
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}

.cart-empty {
  text-align: center;
  padding: 56px 0;
  color: var(--muted);
}

.cart-empty svg {
  opacity: 0.25;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.cart-empty p {
  font-size: 0.95rem;
  margin: 0;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-img {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--primary);
  margin-top: 3px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.qty-value {
  font-size: 0.88rem;
  color: var(--text);
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-item-remove:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

/* ======== CART FOOTER ======== */
.cart-footer {
  padding: 20px 24px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.cart-total-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.cart-total-value {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
}

#checkoutBtn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
}

#checkoutBtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
