/* Storefront stylesheet.
 *
 * Every colour and face comes from the custom properties the theme emits, so
 * one stylesheet serves jewellery, fashion and electronics. Nothing here names
 * a literal colour except pure black/white overlays.
 */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: 74rem;
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2.5rem);
}
.wrap.narrow { max-width: 44rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.mono { font-family: var(--font-mono); font-size: 0.85em; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand { display: flex; align-items: center; gap: 0.8rem; margin-right: auto; }

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  letter-spacing: 0.06em;
  font-weight: 500;
}

.brand-rule { width: 2rem; height: 1px; background: var(--accent); opacity: 0.7; }

.nav { display: flex; gap: clamp(1rem, 3vw, 2rem); font-size: 0.9rem; }
.nav a { color: var(--ink-muted); padding: 0.35rem 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.bag { font-size: 0.9rem; color: var(--ink-muted); }
.bag:hover { color: var(--ink); }
.bag-count {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem;
  text-align: center;
}

@media (max-width: 46rem) {
  .nav { display: none; }
}

/* ---------- hero ---------- */

.hero { padding: calc(5rem * var(--space)) 0 calc(3rem * var(--space)); }
.hero--compact { padding: calc(3rem * var(--space)) 0 calc(1.5rem * var(--space)); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.hero-body {
  max-width: 42ch;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.9vw, 1.12rem);
  margin: 0 0 1.8rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.7rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- sections ---------- */

.section { padding: calc(3rem * var(--space)) 0; }
.section--tall { padding: calc(6rem * var(--space)) 0; }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  margin: 0 0 1.6rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.empty { color: var(--ink-muted); }

.notice {
  border-left: 2px solid var(--accent);
  background: var(--surface-alt);
  padding: 0.8rem 1rem;
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
}

/* ---------- collections ---------- */

.collections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.collection {
  background: var(--surface);
  padding: 1.6rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: background 0.15s ease;
}
.collection:hover { background: var(--surface-alt); }
.collection-name { font-family: var(--font-display); font-size: 1.25rem; }
.collection-count { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--ink-muted); text-transform: uppercase; }
.collections--large .collection { padding: 2.2rem 1.5rem; }

/* ---------- product grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: calc(2rem * var(--space)) 1.4rem;
}

.card-link { display: block; }

.card-art {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
}
.card-art .artwork { width: 100%; height: 100%; transition: transform 0.5s ease; }
.card:hover .card-art .artwork { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  background: var(--ground);
  color: var(--ink);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
}

.card-body { padding-top: 0.9rem; display: flex; flex-direction: column; gap: 0.25rem; }
.card-meta { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); margin: 0; }
.card-name { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; margin: 0; line-height: 1.25; }
.card-price { margin: 0.2rem 0 0; font-size: 1rem; font-variant-numeric: tabular-nums; }
.card-price s { color: var(--ink-muted); font-size: 0.85em; margin-left: 0.4rem; }
.card-price--request { color: var(--ink-muted); font-size: 0.9rem; font-style: italic; }
.card-note { margin: 0; font-size: 0.72rem; color: var(--ink-muted); }

/* ---------- product detail ---------- */

.pdp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  padding-top: calc(2.5rem * var(--space));
}
@media (max-width: 54rem) { .pdp-grid { grid-template-columns: 1fr; } }

.pdp-art {
  align-self: start;
  position: sticky;
  top: 6rem;
}
@media (max-width: 54rem) { .pdp-art { position: static; } }

.pdp-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.1;
  margin: 0 0 0.4rem;
  text-wrap: balance;
}

.pdp-sku { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-muted); margin: 0 0 1.4rem; letter-spacing: 0.05em; }

.pdp-price { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0; font-variant-numeric: tabular-nums; }
.pdp-price--request { font-size: 1.05rem; color: var(--ink-muted); font-style: italic; }
.pdp-price-note { font-size: 0.78rem; color: var(--ink-muted); margin: 0.25rem 0 1.2rem; }

.pdp-stock { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--success); margin: 0 0 1.6rem; }
.pdp-stock.is-out { color: var(--ink-muted); }

.pdp-actions { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.5rem; }
.pdp-feedback { font-size: 0.82rem; color: var(--success); }
.pdp-feedback.is-error { color: var(--danger); }

.pdp-copy { color: var(--ink-muted); margin-bottom: 2.5rem; max-width: 46ch; }

/* ---------- price breakup ---------- */

.breakup {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.4rem 1.4rem 1.1rem;
  margin-bottom: 2.5rem;
}

.breakup-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.breakup-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.breakup-table th {
  text-align: left;
  font-weight: 400;
  padding: 0.5rem 0;
  color: var(--ink);
}
.breakup-table td {
  text-align: right;
  padding: 0.5rem 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.breakup-detail { display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-muted); margin-top: 0.1rem; }
.breakup-subtotal th, .breakup-subtotal td { border-top: 1px solid var(--line); padding-top: 0.7rem; }
.breakup-tax th, .breakup-tax td { color: var(--ink-muted); font-size: 0.85rem; padding: 0.3rem 0; }
.breakup-total th, .breakup-total td { border-top: 1px solid var(--line); padding-top: 0.7rem; font-size: 1.05rem; }
.breakup-rate { margin: 1rem 0 0; font-size: 0.72rem; color: var(--ink-muted); font-family: var(--font-mono); }

/* ---------- specification ---------- */

.spec { border-top: 1px solid var(--line); padding-top: 1.6rem; }
.spec-title { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 0 0 1.1rem; }

.spec-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem 1.4rem; margin: 0 0 1.5rem; }
.spec-list div { display: flex; flex-direction: column; gap: 0.15rem; }
.spec-list dt { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.spec-list dd { margin: 0; font-size: 0.95rem; }

.spec-stones { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 1.2rem; }
.spec-stones th { text-align: left; font-weight: 400; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--line); padding: 0.4rem 0.6rem 0.4rem 0; }
.spec-stones td { padding: 0.45rem 0.6rem 0.45rem 0; border-bottom: 1px solid var(--line); }
.spec-note { font-size: 0.78rem; color: var(--ink-muted); margin: 0; }

/* ---------- cart ---------- */

.cart-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cart-table th { text-align: left; font-weight: 400; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--line); padding: 0.6rem 0.8rem 0.6rem 0; }
.cart-table td { padding: 0.9rem 0.8rem 0.9rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.cart-piece a { display: flex; align-items: center; gap: 0.9rem; }
.cart-thumb { width: 3.2rem; height: 3.2rem; display: block; flex: none; border: 1px solid var(--line); overflow: hidden; color: var(--accent); }
.cart-expired { display: block; font-family: var(--font-mono); font-size: 0.65rem; color: var(--accent); margin-top: 0.25rem; }
.cart-table tfoot th { border-bottom: 0; text-align: right; padding-top: 1rem; }
.cart-table tfoot td { border-bottom: 0; padding-top: 1rem; }
.cart-total th, .cart-total td { font-size: 1.1rem; color: var(--ink); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: calc(4rem * var(--space)); padding: calc(3rem * var(--space)) 0 2.5rem; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; }
@media (max-width: 46rem) { .footer-inner { grid-template-columns: 1fr; } }
.footer-name { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 0.4rem; }
.footer-note { color: var(--ink-muted); margin: 0; max-width: 40ch; font-size: 0.9rem; }
.footer-meta p { margin: 0 0 0.3rem; color: var(--ink-muted); font-size: 0.88rem; }
.footer-legal { grid-column: 1 / -1; margin: 1.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--ink-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- photography ---------- */

.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .card-art .photo { transform: scale(1.04); }

/* The artwork placeholder and a real photograph occupy the same box, so a
 * catalogue that is half photographed does not render as a ragged grid. */
.card-art .photo, .card-art .artwork { display: block; }

.pdp-art-main {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-alt);
  color: var(--accent);
}

.pdp-thumbs {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

.pdp-thumb {
  width: 4.5rem;
  height: 4.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-alt);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.pdp-thumb:hover { opacity: 0.9; }
.pdp-thumb.is-active { opacity: 1; border-color: var(--accent); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cart-thumb .photo, .cart-thumb .artwork { width: 100%; height: 100%; }
