/* ==========================================================================
   APEXION — product page, cart, checkout, dashboard, collections, journal, auth
   ========================================================================== */

.crumbs {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: var(--sp-3) 0;
}
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--text); }

/* ---------- product detail page ---------- */
.pdp {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--sp-6);
  padding: var(--sp-4) 0 var(--sp-10);
}
.pdp__gallery {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16/11;
  background: var(--surface);
}
.pdp__gallery img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.pdp__name { font-size: clamp(2.25rem, 4.4vw, 3.5rem); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 8px; }
.pdp__price { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin: var(--sp-3) 0; }
.pdp__tagline { color: var(--text-muted); font-size: var(--fs-body-lg); margin-bottom: var(--sp-4); }
.pdp__actions { display: flex; gap: 10px; margin-bottom: var(--sp-4); }
.pdp__actions .btn { flex: 1; justify-content: center; }
.pdp__meta { border-top: 1px solid var(--border); padding-top: var(--sp-3); display: grid; gap: 10px; }
.pdp__meta-row { display: flex; justify-content: space-between; font-size: var(--fs-small); }
.pdp__meta-row span:first-child { color: var(--text-faint); }
.pdp__features { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pdp__features li { font-size: var(--fs-small); color: var(--text-muted); padding-left: 20px; position: relative; }
.pdp__features li::before { content: "→"; position: absolute; left: 0; color: var(--text); }

@media (max-width: 900px) { .pdp { grid-template-columns: 1fr; } }

/* ---------- cart page ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--sp-6); align-items: start; }
.cart-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
}
.cart-row__thumb { width: 64px; height: 48px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }
.cart-row__name { font-family: var(--font-display); font-weight: 700; }
.cart-row__cat { font-size: var(--fs-caption); font-weight: 600; color: var(--text-faint); text-transform: uppercase; }
.cart-summary {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  background: var(--surface);
  position: sticky;
  top: 90px;
}
.cart-summary__row { display: flex; justify-content: space-between; font-size: var(--fs-small); padding: 8px 0; }
.cart-summary__total { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; padding-top: var(--sp-2); margin-top: var(--sp-2); border-top: 1px solid var(--border); }
.empty-state { text-align: center; padding: var(--sp-10) 0; color: var(--text-muted); }
.empty-state h2 { margin-bottom: 8px; color: var(--text); }
@media (max-width: 780px) { .cart-layout { grid-template-columns: 1fr; } .cart-row { grid-template-columns: 48px 1fr auto; } .cart-row .btn { grid-column: 1 / -1; } }

/* ---------- checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: var(--sp-6); padding: var(--sp-4) 0 var(--sp-10); align-items: start; }
.field { display: grid; gap: 6px; margin-bottom: var(--sp-2); }
.field label { font-size: var(--fs-caption); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.field input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  padding: 12px 14px;
}
.field input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.checkout-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-small); }
.checkout-note { font-size: var(--fs-caption); color: var(--text-faint); margin-top: var(--sp-2); }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }

/* ---------- dashboard ---------- */
.lib-row {
  display: grid;
  grid-template-columns: 96px 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
  background: var(--surface);
}
.lib-row__thumb { width: 96px; height: 64px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }
.lib-row__name { font-family: var(--font-display); font-weight: 700; }
.lib-row__cat { font-size: var(--fs-caption); font-weight: 600; color: var(--text-faint); text-transform: uppercase; }
@media (max-width: 700px) { .lib-row { grid-template-columns: 64px 1fr; } .lib-row .btn { grid-column: 2; } }

/* ---------- collections ---------- */
.t-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 900px) { .t-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .t-grid-3 { grid-template-columns: 1fr; } }

.collection-tile {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: border-color .15s ease, transform .15s ease;
}
.collection-tile:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.collection-tile__count { color: var(--text-faint); font-size: var(--fs-small); font-weight: 600; }

/* ---------- journal ---------- */
.post-card { border-bottom: 1px solid var(--border); padding: var(--sp-4) 0; display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-4); color: inherit; text-decoration: none; }
.post-card__media { aspect-ratio: 4/3; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card h3 { font-size: 1.25rem; margin: 8px 0; transition: opacity .15s ease; }
a.post-card:hover h3 { opacity: .65; }
@media (max-width: 700px) { .post-card { grid-template-columns: 1fr; } }

/* long-form journal article body */
.article-head { max-width: 70ch; margin-bottom: var(--sp-5); }
.article-head h1 { font-size: 2rem; margin: 10px 0 12px; letter-spacing: -0.01em; }
.article-meta { font-size: var(--fs-small); color: var(--text-faint); font-family: var(--font-mono, monospace); text-transform: uppercase; letter-spacing: .06em; }
.article-hero { width: 100%; aspect-ratio: 16/9; border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--sp-6); border: 1px solid var(--border); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prose { max-width: 70ch; padding-bottom: var(--sp-8); }
.prose h2 { font-size: 1.4rem; font-weight: 800; margin: var(--sp-5) 0 var(--sp-2); letter-spacing: -0.01em; }
.prose p { color: var(--text-muted); line-height: 1.75; margin-bottom: var(--sp-3); }
.prose ul { margin: 0 0 var(--sp-3) 1.25em; color: var(--text-muted); line-height: 1.75; }
.prose li { margin-bottom: 8px; }
.prose li strong { color: var(--text); }
.prose code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: .9em; }
.prose pre { background: var(--bg-dark); color: var(--text-inverse); border-radius: var(--r-sm); padding: var(--sp-3); overflow-x: auto; margin-bottom: var(--sp-3); }
.prose pre code { background: none; border: none; padding: 0; color: inherit; }

/* ---------- auth ---------- */
.auth-card {
  max-width: 400px;
  margin: var(--sp-10) auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  background: var(--surface);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card p.text-muted { margin-bottom: var(--sp-3); font-size: var(--fs-small); }
