/* Checkout + cart drawer + terms — Phase 3.
   Matches the frontend design system (--bg, --gold, etc.). */

.checkout-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 7.5rem 1.5rem 4rem;
  min-height: 70vh;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2rem;
  margin-top: 2rem;
}

.co-card {
  background: #141416;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.75rem;
}

.co-card h3 { margin: 0 0 1.1rem; font-size: 1.25rem; }
.co-sub { margin-top: 2rem !important; }

.co-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.co-item h4 { margin: 0 0 0.25rem; font-size: 1rem; }
.co-item p { margin: 0; font-size: 0.82rem; color: var(--muted, #9a9aa0); }

.co-totals { margin-top: 1.25rem; }
.co-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.95rem;
}
.co-totals .grand {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 0.5rem;
  padding-top: 0.9rem;
  font-size: 1.15rem;
}
.co-totals .grand strong { color: var(--gold); }

/* ---------- form ---------- */
.field { margin-bottom: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #9a9aa0);
  margin-bottom: 0.4rem;
}
.field .opt { text-transform: none; letter-spacing: 0; opacity: 0.7; }
.field input, .field select {
  width: 100%;
  background: #0b0b0d;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: var(--text, #f2f0ea);
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
}

.ship-opt {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  margin-bottom: 0.7rem;
  cursor: pointer;
}
.ship-opt:hover { border-color: var(--gold); }
.ship-opt input { accent-color: var(--gold); width: 1.1rem; height: 1.1rem; }
.ship-opt span { font-size: 0.95rem; }
.ship-opt em { font-style: normal; color: var(--gold); margin-left: 0.4rem; }

.terms-check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 1.4rem 0 1rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.terms-check input { accent-color: var(--gold); width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; }
.terms-check a { color: var(--gold); }

.form-error {
  background: rgba(200, 60, 60, 0.12);
  border: 1px solid rgba(200, 60, 60, 0.4);
  color: #f0a0a0;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin: 0 0 1rem;
}

.co-fineprint { font-size: 0.78rem; color: var(--muted, #9a9aa0); margin-top: 0.6rem; }
.co-secure { font-size: 0.82rem; color: var(--muted, #9a9aa0); margin-top: 1rem; }

/* ---------- cart drawer ---------- */
.cart-button {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.4rem;
}
.cart-count[hidden] { display: none; }
.cart-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--gold);
  color: #0b0b0d;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  background: #141416;
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 95;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.28s ease;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cart-head h3 { margin: 0; }
.cart-close {
  background: none;
  border: none;
  color: var(--text, #f2f0ea);
  font-size: 1.6rem;
  cursor: pointer;
}
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-empty { color: var(--muted, #9a9aa0); text-align: center; margin-top: 3rem; line-height: 1.7; }

.cart-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cart-row-info h4 { margin: 0 0 0.3rem; font-size: 0.98rem; }
.cart-row-info p { margin: 0; font-size: 0.8rem; color: var(--muted, #9a9aa0); }
.cart-row-price { color: var(--gold) !important; margin-top: 0.3rem !important; }
.cart-row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.qty { display: flex; align-items: center; gap: 0.6rem; }
.qty button {
  width: 1.7rem; height: 1.7rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: none; color: var(--text, #f2f0ea);
  border-radius: 6px; cursor: pointer; font-size: 1rem;
}
.qty button:hover { border-color: var(--gold); color: var(--gold); }
.cart-remove {
  background: none; border: none; color: #c07878;
  font-size: 0.78rem; cursor: pointer; text-decoration: underline;
}
.cart-foot { padding: 1.25rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.08); }
.cart-foot .btn { margin-top: 0.7rem; }
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}
.cart-total strong { color: var(--gold); }
.cart-note { font-size: 0.78rem; color: var(--muted, #9a9aa0); margin: 0 0 0.4rem; }

/* ---------- confirmation ---------- */
.confirm-card {
  max-width: 640px;
  margin: 2rem auto;
  background: #141416;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 2.5rem;
  text-align: center;
}
.confirm-card h2 { margin: 0.4rem 0 0.6rem; }
.confirm-no { font-size: 1.05rem; color: var(--muted, #9a9aa0); }
.confirm-no strong { color: var(--gold); }
.confirm-card .co-item { text-align: left; margin: 1.5rem 0; }
.confirm-card h3 { margin-top: 2rem; text-align: left; }
.next-steps { text-align: left; line-height: 1.8; padding-left: 1.3rem; }
.next-steps li { margin-bottom: 0.6rem; }
.confirm-card .btn { margin-top: 1.5rem; }

/* ---------- demo PayPal dialog ---------- */
.pp-demo { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; }
.pp-demo[hidden] { display: none; }
.pp-demo-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.pp-demo-panel {
  position: relative;
  background: #1c1c20;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 2rem;
  width: min(400px, 90vw);
  text-align: center;
}
.pp-demo-logo { font-size: 1.4rem; margin-top: 0; }
.pp-demo-logo span {
  font-size: 0.7rem;
  background: var(--gold-soft, rgba(201,168,106,0.14));
  color: var(--gold);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  vertical-align: middle;
}
.pp-demo-btns { display: flex; gap: 0.8rem; margin-top: 1.4rem; }
.pp-demo-btns .btn { flex: 1; }

/* ---------- terms page ---------- */
.terms-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 7.5rem 1.5rem 4rem;
  line-height: 1.75;
}
.terms-main h1 { margin-bottom: 0.3rem; }
.terms-main h2 {
  margin-top: 2.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(201,168,106,0.3);
}
.terms-main h3 { margin-top: 1.6rem; color: var(--gold); }
.terms-main ul { padding-left: 1.3rem; }
.terms-main li { margin-bottom: 0.5rem; }
.terms-date { color: var(--muted, #9a9aa0); font-size: 0.85rem; }
.terms-note {
  background: var(--gold-soft, rgba(201,168,106,0.14));
  border: 1px solid rgba(201,168,106,0.4);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  font-size: 0.88rem;
  margin-top: 2.5rem;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .checkout-main { padding-top: 6rem; }
}
