/* ============================================================
   Cart & Wishlist CSS — SmartHub IT Store
   ============================================================ */

/* ── Cart Page ───────────────────────────────────────────────── */
.cart-page { padding: 32px 0 48px; }
.cart-page .container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

/* ── Empty State ─────────────────────────────────────────────── */
.cart-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.cart-empty__icon {
  width: 96px; height: 96px;
  background: var(--color-bg-tint);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.cart-empty__icon svg { width: 48px; height: 48px; color: var(--color-gray-300); }
.cart-empty h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}
.cart-empty p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  max-width: 460px;
  margin: 0 auto 28px;
  line-height: 1.7;
}
.cart-empty__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Cart Panel ──────────────────────────────────────────────── */
.cart-panel { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.cart-panel__header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-panel__header h2 { font-size: 1rem; font-weight: 700; }
.cart-panel__header span { font-size: 0.82rem; color: var(--color-text-muted); }

/* ── Cart Item Row ───────────────────────────────────────────── */
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-gray-100);
  transition: background 0.18s, opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.4s ease, padding 0.35s ease, margin 0.35s ease;
  max-height: 200px;
  box-sizing: border-box;
}
.cart-item:hover { background: var(--color-gray-50); }
.cart-item:last-child { border-bottom: none; }
.cart-item.is-removing {
  opacity: 0 !important;
  transform: translateX(40px) scale(0.96) !important;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  border-bottom: none !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.cart-item__img-wrap {
  width: 80px; height: 80px;
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.cart-item__img-wrap img { max-width: 70px; max-height: 70px; object-fit: contain; }

.cart-item__info { min-width: 0; }
.cart-item__brand {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gray-400);
  margin-bottom: 3px;
}
.cart-item__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item__sku {
  font-size: 0.7rem;
  color: var(--color-gray-400);
  margin-top: 2px;
}
.cart-item__price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-top: 6px;
}

.cart-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.cart-item__remove {
  width: 28px; height: 28px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-full);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-gray-400);
}
.cart-item__remove:hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.cart-item__remove svg { width: 13px; height: 13px; }
.cart-item__subtotal {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ── Order Summary ───────────────────────────────────────────── */
.order-summary {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-total) + 16px);
}
.order-summary__header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  padding: 18px 22px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}
.order-summary__body { padding: 20px 22px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.88rem;
}
.summary-row + .summary-row { border-top: 1px dashed var(--color-gray-100); }
.summary-row__label { color: var(--color-text-muted); }
.summary-row__value { font-weight: 600; color: var(--color-text); }
.summary-row--total {
  border-top: 2px solid var(--color-gray-200) !important;
  margin-top: 8px;
  padding-top: 14px;
}
.summary-row--total .summary-row__label { font-weight: 700; color: var(--color-text); font-size: 0.95rem; }
.summary-row--total .summary-row__value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-primary);
}
.order-summary__footer { padding: 0 22px 20px; }
.order-summary__note {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.order-summary__note svg { width: 12px; height: 12px; color: var(--color-success); }

/* ── Wishlist Page ───────────────────────────────────────────── */
.wishlist-page { padding: 32px 0 48px; }
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.wishlist-empty {
  text-align: center;
  padding: 64px 24px;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.wishlist-empty__icon {
  width: 96px; height: 96px;
  background: var(--color-bg-tint);
  border-radius: var(--radius-full);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wishlist-empty__icon svg {
  width: 48px; height: 48px;
  color: var(--color-gray-300);
}
.wishlist-empty h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.wishlist-empty p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cart-page .container { grid-template-columns: 1fr; }
  .order-summary { position: static; }
  .wishlist-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .cart-item { grid-template-columns: 64px 1fr; }
  .cart-item__actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
  .wishlist-grid { grid-template-columns: repeat(2, 1fr); }
}
