@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
@import url('theme.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-2);
  color: var(--text-1);
  min-height: 100vh;
}

/* ── Wordmark ── */
.wordmark {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.w1 { color: var(--text-1); }
.w2 {
  background: var(--grad-a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-back {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--primary); }

/* ── Layout ── */
.checkout-layout {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .nav-inner { padding: 0 14px; height: 54px; }
  .checkout-layout { margin: 20px auto; padding: 0 16px; }
}
@media (max-width: 480px) {
  .checkout-layout { padding: 0 12px; margin: 14px auto; gap: 16px; }
  .checkout-left h2 { font-size: 1.1rem; margin-bottom: 14px; }
  .cart-item { padding: 12px; gap: 10px; }
  .cart-item-img { width: 56px; height: 56px; }
  .cart-item-title { font-size: 0.84rem; }
  .order-summary { padding: 16px; position: static; }
  .btn-checkout { padding: 13px; font-size: 0.9rem; }
}
@media (max-width: 360px) {
  .checkout-layout { padding: 0 10px; }
  .cart-item-img { width: 48px; height: 48px; }
}

/* ── Left column ── */
.checkout-left h2 {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}

/* ── Cart Item ── */
.cart-item {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.cart-item:hover {
  box-shadow: var(--shadow);
}

.cart-item-img {
  width: 72px;
  height: 72px;
  border-radius: var(--r);
  background: var(--bg-2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cart-item-img svg {
  width: 40%;
  height: 40%;
  opacity: 0.3;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 3px;
}

.cart-item-price {
  font-size: 1rem;
  font-weight: 900;
  background: var(--grad-a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm, 8px);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-remove:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.06);
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 24px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
}
.empty-state svg {
  color: var(--text-3);
  margin-bottom: 16px;
}
.empty-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 6px;
}
.empty-sub {
  font-size: 0.875rem;
  color: var(--text-3);
  margin-bottom: 24px;
}
.btn-browse {
  display: inline-block;
  padding: 11px 24px;
  background: var(--grad-a);
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--r-md);
  transition: opacity 0.2s, transform 0.2s;
}
.btn-browse:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* ── Order Summary ── */
.order-summary {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl, 24px);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}
.order-summary h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.summary-rows {
  display: flex;
  flex-direction: column;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-2);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child {
  border-bottom: none;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-1);
  padding: 16px 0 20px;
  border-top: 2px solid var(--border);
  margin-top: 4px;
}

.btn-checkout {
  width: 100%;
  padding: 15px;
  background: var(--grad-a);
  border: none;
  border-radius: var(--r-md);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(123, 110, 255, 0.3);
  transition: opacity 0.2s, transform 0.2s;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}
.btn-checkout:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}
.btn-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.checkout-note {
  font-size: 0.78rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  animation: toastIn 0.25s ease;
}
.toast-error { background: #dc2626; }
.toast-success { background: #16a34a; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
