/* Alan's Print Lab — shop styles.
   Colours: background #0F1115, hairlines #262A33, text white, secondary #9aa0a6,
   red #E53935 for the primary button, the selected chip and the active menu item only. */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0F1115;
  --line: #262A33;
  --line-strong: #3a3f47;
  --text: #ffffff;
  --muted: #9aa0a6;
  --red: #E53935;
  --red-dark: #c62f2b;
  --field: #151820;
}

* { box-sizing: border-box; }

/* Everything sized in rem scales with this one number. */
html { color-scheme: dark; font-size: 118.75%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

main.wrap { flex: 1; padding-top: 32px; padding-bottom: 64px; }

h1, h2, h3, .price, .brand span { font-family: 'Space Grotesk', system-ui, sans-serif; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 20px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
p { margin: 0 0 14px; }

a { color: inherit; }
.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.lead { font-size: 1.05rem; max-width: 60ch; }
.prose { white-space: pre-line; max-width: 60ch; }

[hidden] { display: none !important; }

:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 4.4rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}
.brand img { display: block; width: 3rem; height: 3rem; }
.site-nav { display: flex; gap: 24px; margin-left: auto; }
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 150ms;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--text); border-bottom-color: var(--red); }

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  color: var(--text);
  transition: color 150ms;
}
.cart-link:hover { color: var(--muted); }
.cart-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.notice-bar {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.site-footer .wrap { display: flex; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
}
.card { text-decoration: none; display: block; }
.card img, .no-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--field);
}
.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.875rem;
  border: 1px solid var(--line);
}
.card h2 { margin: 12px 0 4px; font-size: 1.05rem; }
.card:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.card p { margin: 0 0 4px; font-size: 0.9rem; }
.card .price { color: var(--text); font-weight: 500; font-size: 1rem; margin-top: 6px; }

/* ---------- product page ---------- */
.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.slider-wrap { position: relative; }
.slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.slider::-webkit-scrollbar { display: none; }
.slider img {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  scroll-snap-align: center;
  background: var(--field);
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 150ms;
}
.arrow:hover { border-color: var(--text); }
.prev { left: 10px; }
.next { right: 10px; }

.product-info h1 { font-size: 2rem; margin-bottom: 12px; }
.unavailable { color: var(--muted); border: 1px solid var(--line); padding: 12px 16px; display: inline-block; margin-top: 12px; }

fieldset { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 1rem;
  transition: border-color 150ms, background-color 150ms;
}
.chip:hover > span { border-color: var(--muted); }
.chip input:checked + span { border-color: var(--red); background: rgba(229, 57, 53, 0.14); }
.chip input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.chip-price { color: var(--muted); font-size: 0.85rem; }
.swatch { width: 1rem; height: 1rem; flex: none; }
.swatch circle { stroke: var(--line-strong); stroke-width: 1; }

.price.big { font-size: 1.75rem; font-weight: 700; margin: 24px 0 16px; }

.buy-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.qty { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; color: var(--muted); }
.qty input { width: 5.5rem; }
.added { margin-top: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms;
}
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--red); border-color: var(--red); }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn.wide { width: 100%; }
.btn-plain {
  background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 0.875rem;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.btn-plain:hover { color: var(--text); }

/* ---------- forms ---------- */
.form { max-width: 34rem; }
.field { margin: 0 0 16px; }
.field label, .field legend { display: block; margin-bottom: 6px; font-size: 0.9rem; text-transform: none; letter-spacing: 0; color: var(--text); }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="number"], input[type="password"], textarea, select {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: #6b7078; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field-row .field.narrow { flex: 0 0 110px; }
.hint { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }
.field-error { margin: 6px 0 0; font-size: 0.875rem; color: #ff8a80; }
.check { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--red); flex: none; }
fieldset.field .check { margin-bottom: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- cart ---------- */
.cart-lines, .summary-lines { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--line); }
.cart-lines li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-lines img, .cart-lines .no-photo { width: 72px; height: 72px; object-fit: cover; }
.cart-lines .line-name { font-weight: 600; text-decoration: none; }
.cart-lines .line-name:hover { text-decoration: underline; }
.cart-lines .line-controls { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.cart-lines .line-controls input { width: 72px; min-height: 38px; padding: 6px 10px; }
.cart-lines .line-price { text-align: right; white-space: nowrap; font-family: 'Space Grotesk', sans-serif; }
.cart-lines li.gone .line-name { color: var(--muted); }

.summary-lines li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.summary-lines li > span:last-child { white-space: nowrap; }

.totals { max-width: 360px; margin: 0 0 20px auto; }
.totals.narrow { margin-left: 0; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.totals .total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem; }
[data-cart-content] > .btn { float: right; }

/* ---------- checkout ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 48px; align-items: start; }
.summary { border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.summary .totals { max-width: none; margin-left: 0; }

/* ---------- order page ---------- */
.status {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.875rem;
  margin-bottom: 18px;
}
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 24px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.summary-lines { max-width: 560px; }
.totals.narrow { max-width: 560px; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  main.wrap { padding-top: 24px; }
  .wrap { padding: 0 16px; }
  .header-row { flex-wrap: wrap; gap: 0 12px; padding-top: 8px; }
  .brand { margin-right: auto; font-size: 1rem; }
  .brand img { width: 2.4rem; height: 2.4rem; }
  .cart-link { order: 2; }
  .site-nav { order: 3; width: 100%; margin: 0; gap: 20px; }
  .site-nav a { padding: 8px 0 10px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
  .product { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .product-info h1 { font-size: 1.6rem; }
  .checkout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cart-lines li { grid-template-columns: 56px 1fr auto; gap: 12px; }
  .cart-lines img, .cart-lines .no-photo { width: 56px; height: 56px; }
  [data-cart-content] > .btn { float: none; width: 100%; }
  .totals { max-width: none; }
}

.summary .summary-lines { max-width: none; }

.cart-link svg { width: 1.7rem; height: 1.7rem; }
@media (max-width: 760px) { html { font-size: 112.5%; } }

input[type="file"] { display: block; width: 100%; color: var(--muted); font: inherit; font-size: 0.95rem; }
input[type="file"]::file-selector-button {
  min-height: 2.6rem;
  margin-right: 0.8rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 150ms;
}
input[type="file"]::file-selector-button:hover { border-color: var(--text); }

.model-choice { border: 1px solid var(--line); border-radius: 6px; padding: 0.9rem 1rem 0.2rem; }
.model-choice legend { padding: 0 0.4rem; margin-left: -0.4rem; font-size: 0.9rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.model-choice.has-error { border-color: #ff8a80; }
.model-choice .hint.first { margin: 0 0 0.9rem; }
.model-choice > .field-error { margin: -0.4rem 0 0.9rem; }

.quote-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.quote-actions form { margin: 0; }
