/* ================================
   MARKETBLOX — CART DRAWER
   ================================ */

/* CART ICON in navbar */
.cart-nav-btn {
  position: relative;
  background: var(--navy);
  border: none;
  color: white;
  width: 40px; height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.cart-nav-btn:hover { background: var(--green); transform: scale(1.05); }
.cart-count {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--green);
  color: white;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  display: none;
}
.cart-count.visible { display: flex; }

/* OVERLAY */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(2px);
}
.cart-overlay.open { opacity: 1; visibility: visible; }

/* DRAWER */
.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 95vw;
  background: white;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}
.cart-drawer.open { transform: translateX(0); }

/* DRAWER HEADER */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: white;
  flex-shrink: 0;
}
.drawer-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.drawer-title span {
  background: var(--navy);
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}
.drawer-close {
  background: var(--bg);
  border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: var(--text);
}
.drawer-close:hover { background: var(--border); }

/* DRAWER ITEMS */
.drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.di-new-badge {
  position: absolute;
  top: -8px; left: 10px;
  background: var(--green);
  color: white;
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.drawer-item-img {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: var(--green-light);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 1px solid var(--border);
}
.drawer-item-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.drawer-item-info { flex: 1; min-width: 0; }
.drawer-item-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}
.drawer-item-game {
  font-size: 0.75rem;
  color: var(--text3);
  margin-bottom: 0.4rem;
}
.drawer-item-price-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.drawer-item-price {
  font-weight: 800;
  color: var(--green);
  font-size: 0.95rem;
  font-family: var(--font-display);
}
.drawer-item-original {
  font-size: 0.78rem;
  color: var(--text3);
  text-decoration: line-through;
}

.drawer-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text);
  transition: all 0.15s;
  line-height: 1;
}
.qty-btn:hover { border-color: var(--navy); background: var(--navy); color: white; }
.qty-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.drawer-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 1.1rem;
  padding: 0.25rem;
  transition: color 0.2s;
  line-height: 1;
}
.drawer-item-remove:hover { color: #ff5252; }

/* EMPTY STATE */
.drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 0.75rem;
  color: var(--text3);
  text-align: center;
  padding: 3rem;
}
.drawer-empty-icon { font-size: 3.5rem; opacity: 0.5; }
.drawer-empty h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text2);
}
.drawer-empty p { font-size: 0.85rem; }
.drawer-empty-btn {
  background: var(--navy);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 100px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s, transform 0.2s;
}
.drawer-empty-btn:hover { background: var(--green); transform: translateY(-2px); }

/* YOU MAY ALSO LIKE */
.drawer-suggestions {
  padding: 0 1.5rem 1rem;
  flex-shrink: 0;
}
.drawer-suggestions-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.suggestions-row {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.suggestions-row::-webkit-scrollbar { display: none; }
.suggestion-card {
  flex-shrink: 0;
  width: 90px;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg);
  transition: border-color 0.2s, transform 0.2s;
}
.suggestion-card:hover { border-color: var(--green); transform: translateY(-2px); }
.suggestion-img {
  width: 90px; height: 80px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
}
.suggestion-img img { width: 100%; height: 100%; object-fit: cover; }
.suggestion-info { padding: 0.4rem 0.5rem; }
.suggestion-name {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-price { font-size: 0.7rem; color: var(--green); font-weight: 700; }

/* DRAWER FOOTER */
.drawer-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  background: white;
  flex-shrink: 0;
}
.drawer-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 0.4rem;
}
.drawer-delivery {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 0.75rem;
}
.drawer-delivery span:last-child { color: var(--green); font-weight: 700; }
.drawer-total {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.drawer-total span:last-child { color: var(--text); }

.drawer-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text2);
  cursor: pointer;
}
.drawer-terms input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--green);
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}

.drawer-checkout-btn {
  width: 100%;
  background: var(--green);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}
.drawer-checkout-btn:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}
.drawer-checkout-btn:disabled {
  background: var(--border);
  color: var(--text3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.drawer-view-cart {
  width: 100%;
  background: transparent;
  color: var(--text2);
  border: 1.5px solid var(--border);
  padding: 0.7rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.drawer-view-cart:hover { border-color: var(--navy); color: var(--navy); }

.drawer-pay-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.875rem;
  flex-wrap: wrap;
}
.dpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text2);
}

/* TOAST */
.cart-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  white-space: nowrap;
}
.cart-toast.show { transform: translateX(-50%) translateY(0); }
