/*
 * Page styles for the catalogue, cart, checkout and status pages.
 *
 * Loaded before nx.css, which holds the storefront look and must keep the last
 * word on anything the two both define — the same order the stylesheets were
 * stacked in before the move to CakePHP.
 */

/* ============================== catalogue ============================== */

/* ==========================================================================
   Catalogue, product detail and content pages (Phase 2 of the migration).
   Built on the token set in globals.css so the ported pages match the
   marketing pages rather than introducing a second visual language.
   ========================================================================== */

.page-head { margin-bottom: 24px; }
.page-head h1, .page-head h2 { font-family: var(--font-display); margin: 0 0 8px; }
.page-head a { color: var(--c-p1a); text-decoration: underline; font-size: 14px; }

.breadcrumb { font-size: 14px; color: var(--c-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--c-p1a); text-decoration: underline; }

/* --------------------------------------------------------------- chip row */

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }

.chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--c-line);
  background: var(--c-n3);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chip:hover { border-color: var(--c-p1); }
.chip.is-active { background: var(--c-p1); border-color: var(--c-p1); color: #fff; }

/* ---------------------------------------------------------- product cards */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.product-card-media { display: block; aspect-ratio: 4 / 3; background: var(--c-n1); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; }

.product-card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.product-card-category {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
}

.product-card-title { margin: 0; font-size: 17px; font-family: var(--font-display); }
.product-card-title a { text-decoration: none; }
.product-card-title a:hover { color: var(--c-p1a); }

.product-card-desc {
  margin: 0;
  font-size: 14px;
  color: var(--c-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-price { margin: auto 0 0; font-weight: 700; font-size: 18px; }
.product-card-from { font-size: 12px; font-weight: 500; color: var(--c-muted); }
.product-card-quote { font-size: 14px; font-weight: 600; color: var(--c-p1a); }

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

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

@media (max-width: 860px) { .product-detail-grid { grid-template-columns: 1fr; } }

.product-detail-media {
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.product-detail-media img { width: 100%; height: auto; }
.product-detail-info h1 { font-family: var(--font-display); margin: 0 0 8px; font-size: 30px; }
.product-detail-lead { color: var(--c-muted); margin: 0 0 20px; }

.product-description { margin-top: 48px; }
.product-description h2 { font-family: var(--font-display); }

/* ---------------------------------------------------------- configurator */

.configurator {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.option-group { border: 0; padding: 0; margin: 0; }

.option-group legend {
  font-weight: 700;
  font-size: 14px;
  text-transform: capitalize;
  margin-bottom: 8px;
  padding: 0;
}

.option-values { display: flex; flex-wrap: wrap; gap: 8px; }

.option-chip {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-line);
  background: var(--c-n1);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.option-chip:hover { border-color: var(--c-p1); }
.option-chip.is-selected { background: var(--c-p1); border-color: var(--c-p1); color: #fff; }

/* Still selectable: choosing it re-narrows the other options rather than
   dead-ending the customer. */
.option-chip.is-unavailable { opacity: 0.45; }

.addon-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-line);
  font-size: 14px;
}

.addon-row:last-child { border-bottom: 0; }
.addon-price { font-weight: 700; white-space: nowrap; }

.quantity-field { max-width: 140px; }

.price-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 16px;
  border-top: 2px solid var(--c-line);
  font-size: 15px;
}

.price-summary strong { font-size: 24px; font-family: var(--font-display); }

/* -------------------------------------------------------- artwork upload */

.artwork-upload {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--c-a1);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.artwork-upload h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-family: var(--font-sans);
}

.artwork-existing {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ search */

.search-form { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
  padding: 0 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-n3);
  color: var(--c-muted);
}

.search-input-wrap input {
  flex: 1;
  border: 0;
  background: none;
  padding: 12px 0;
  outline: none;
  color: var(--c-n4);
}

.search-summary { color: var(--c-muted); margin-bottom: 20px; }

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

.hero { padding: 56px 0 24px; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: center;
}

@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } }

.hero-copy h1 { font-family: var(--font-display); font-size: 44px; margin: 0 0 12px; }
.hero-copy h1 span { color: var(--c-p1); }
.hero-sub { color: var(--c-muted); font-size: 18px; max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-media img { width: 100%; height: auto; border-radius: var(--radius); }

/* ---------------------------------------------------------------- features */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 24px;
}

.feature-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.feature-card h2, .feature-card h3 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 18px;
}

.feature-card p { margin: 0; color: var(--c-muted); font-size: 14px; }

/* --------------------------------------------------------------------- faq */

.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}

.faq-item summary { font-weight: 700; cursor: pointer; }
.faq-item[open] summary { margin-bottom: 10px; }
.faq-item > div { color: var(--c-muted); font-size: 15px; }
.faq-footer { margin-top: 24px; color: var(--c-muted); }
.faq-footer a, .empty-state a { color: var(--c-p1a); text-decoration: underline; }

/* ----------------------------------------------------------------- contact */

.contact-panel {
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 640px;
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------- about */

.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 48px;
}

@media (max-width: 860px) { .about-intro { grid-template-columns: 1fr; } }

.about-intro img { width: 100%; height: auto; border-radius: var(--radius); }
.about-contact { margin-top: 48px; }
.about-contact h2 { font-family: var(--font-display); }
.about-contact a { color: var(--c-p1a); }

/* ------------------------------------------------------------------- legal */

.legal-page { max-width: 820px; }
.legal-head { text-align: center; margin-bottom: 40px; }

.legal-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(1, 171, 157, 0.12);
  color: var(--c-p1a);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legal-updated { font-size: 13px; color: var(--c-muted); }
.legal-sections { list-style: none; padding: 0; margin: 0; }
.legal-sections > li { margin-bottom: 36px; }

.legal-sections h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 12px;
}

.legal-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--c-p1);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.legal-sections p { color: var(--c-muted); }
.legal-list { color: var(--c-muted); padding-left: 20px; }
.legal-callout { margin-top: 12px; }
.legal-contact { margin-top: 40px; text-align: center; color: var(--c-muted); }
.legal-contact a { color: var(--c-p1a); text-decoration: underline; }

.catalogue-search { margin-bottom: 20px; }

/* =============================== checkout ============================== */

/* ==========================================================================
   Cart, checkout, order and invoice pages (Phase 3 of the migration).
   ========================================================================== */

.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; line-height: 0; }

.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }

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

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

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

.cart-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 18px;
}

@media (max-width: 720px) {
  .cart-line { grid-template-columns: minmax(0, 1fr) auto; }
  .cart-line-main { grid-column: 1 / -1; }
}

.cart-line.is-unavailable { border-color: #f5c2c2; background: #fffafa; }

.cart-line-main h2 { margin: 0 0 4px; font-size: 16px; font-family: var(--font-display); }
.cart-line-main h2 a { text-decoration: none; }
.cart-line-main h2 a:hover { color: var(--c-p1a); }

.cart-line-options { margin: 0; font-size: 13px; color: var(--c-muted); }
.cart-line-addons { margin: 4px 0 0; padding-left: 16px; font-size: 13px; color: var(--c-muted); }
.cart-line-artwork { margin: 4px 0 0; font-size: 13px; color: var(--c-p1a); font-weight: 600; }

.cart-line-qty { display: flex; gap: 6px; align-items: center; }
.cart-line-qty input {
  width: 68px;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-n3);
}

.cart-line-price { display: flex; flex-direction: column; align-items: flex-end; }
.cart-line-price strong { font-size: 17px; }
.cart-line-price span { font-size: 12px; }

/* --------------------------------------------------------------- summary */

.cart-summary {
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 24px;
}

.cart-summary h2 { margin: 0 0 16px; font-size: 18px; font-family: var(--font-display); }
.cart-summary dl { margin: 0 0 20px; }

.cart-summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}

.cart-summary dt { color: var(--c-muted); }
.cart-summary dd { margin: 0; font-weight: 600; }

.cart-summary-total {
  border-top: 2px solid var(--c-line);
  margin-top: 8px;
  padding-top: 12px !important;
  font-size: 17px !important;
}

.cart-summary-total dd { font-size: 20px; font-family: var(--font-display); }

.cart-continue {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--c-p1a);
  text-decoration: underline;
}

/* --------------------------------------------------------------- checkout */

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

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

.checkout-main { display: flex; flex-direction: column; gap: 24px; }

.checkout-section {
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-section h2 { margin: 0; font-size: 17px; font-family: var(--font-display); }

.fulfilment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .fulfilment-options { grid-template-columns: 1fr; } }

.fulfilment-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.fulfilment-option.is-selected { border-color: var(--c-p1); background: rgba(1, 171, 157, 0.06); }
.fulfilment-option span { display: flex; flex-direction: column; gap: 2px; }
.fulfilment-option .muted { font-size: 13px; }

.checkout-summary { position: sticky; top: 24px; }

.checkout-items {
  list-style: none;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--c-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.checkout-items li { display: flex; justify-content: space-between; gap: 12px; }
.checkout-items li > span { display: flex; flex-direction: column; }
.checkout-item-options { font-size: 12px; }
.checkout-note { font-size: 12px; margin: 12px 0 0; text-align: center; }

/* ---------------------------------------------------------- confirmation */

.confirmation { max-width: 820px; }
.confirmation-head { text-align: center; margin-bottom: 32px; }
.confirmation-head svg { color: var(--c-p1); }
.confirmation-head h1 { font-family: var(--font-display); margin: 12px 0 8px; }

.confirmation-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* --------------------------------------------------------------- invoice */

.invoice-sheet { max-width: 860px; }

.invoice-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--c-line);
}

.invoice-head h1 { font-family: var(--font-display); margin: 0; color: var(--c-p1a); }
.invoice-business { text-align: right; font-size: 14px; }

/* ------------------------------------------------------------ pagination */

.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }

/* ------------------------------------------------------------- print */

@media print {
  .site-header, .site-footer, .confirmation-actions, .skip-link { display: none !important; }
  body { background: #fff; }
  .invoice-sheet { max-width: none; }
}

/* ================================ status =============================== */

/* ---------------------------------------------------- status pages (403/404/500)
 *
 * Shared by forbidden, not-found, the error boundaries and the cancelled
 * payment. Centred, generous and quiet: a visitor who lands here has already
 * had something go wrong, so the page should read as a calm signpost rather
 * than a warning box.
 */

.status-page {
  max-width: 34rem;
  margin-inline: auto;
  padding: 8px 0 24px;
  text-align: center;
}

/*
 * The numeral is scenery, not information — it is aria-hidden, and the heading
 * below says the same thing in words. Sized off the viewport so it stays
 * proportionate on a phone.
 */
.status-code {
  font-family: var(--font-display);
  font-size: clamp(72px, 16vw, 132px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: 0 0 4px;
  color: var(--c-p1a);
  opacity: 0.16;
  user-select: none;
}

/*
 * Two classes deep so it beats `.section h1`, which these pages sit inside and
 * which would otherwise impose the much larger page-title size.
 */
.status-page .status-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--c-n4);
}

.status-body {
  color: var(--c-muted);
  line-height: 1.65;
}

.status-body p { margin: 0 0 12px; }
.status-body p:last-child { margin-bottom: 0; }

.status-reference {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--c-muted);
}

.status-reference code {
  background: var(--c-n2);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 12px;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}

/* The admin shell already supplies its own padding and background. */
.admin-content .status-page { padding-top: 0; text-align: left; margin-inline: 0; }
.admin-content .status-actions { justify-content: flex-start; }
.admin-content .status-code { display: none; }

/* ------------------------------------------------------- product add-ons */

/*
 * Selectable add-on rows on the product page. The add-to-cart script toggles
 * `.selected` and writes the per-unit price into `.addon-unit-price` once a
 * variant is chosen, so the tier shown always matches what will be charged.
 */
.addon-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-n1);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.addon-toggle:hover { border-color: var(--c-p1); }
.addon-toggle.selected { border-color: var(--c-p1); background: #f0fffe; }

.addon-toggle .addon-check {
  width: 22px;
  height: 22px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  flex-shrink: 0;
}

.addon-toggle.selected .addon-check {
  background: var(--c-p1);
  border-color: var(--c-p1);
  color: #fff;
}

.addon-toggle .addon-name { display: block; font-weight: 700; }
.addon-toggle .muted { display: block; font-size: 13px; }
.addon-toggle .addon-unit-price {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-p1a);
}

/* ----------------------------------------------------- artwork size guide */

.size-guide {
  margin-top: 24px;
  background: var(--c-n3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.size-guide-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.size-guide-head p { margin: 0 0 20px; font-size: 13px; }

.size-guide-body {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 640px) {
  .size-guide-body { grid-template-columns: 1fr; }
}

.size-guide-diagram { width: 100%; height: auto; }

.size-guide-diagram rect { fill: none; }
.size-guide-bleed { stroke: var(--c-n2); stroke-width: 2; stroke-dasharray: 6 5; }
.size-guide-trim { stroke: var(--c-n4); stroke-width: 2; fill: rgba(1, 171, 157, 0.06); }
.size-guide-safe { stroke: var(--c-p1); stroke-width: 2; stroke-dasharray: 5 4; }

.size-guide-specs { margin: 0; display: flex; flex-direction: column; gap: 14px; }

.size-guide-spec dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.size-guide-spec dd { margin: 2px 0 0 20px; display: flex; flex-direction: column; gap: 2px; }
.size-guide-spec dd strong { font-size: 15px; }
.size-guide-spec dd .muted { font-size: 12px; line-height: 1.45; }

/* Swatches tie each measurement to its outline in the diagram. */
.size-guide-key {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 3px;
  border: 2px solid var(--c-n2);
}

.size-guide-key-trim { border-color: var(--c-n4); background: rgba(1, 171, 157, 0.06); }
.size-guide-key-safe { border-color: var(--c-p1); border-style: dashed; }

.size-guide-notes {
  margin: 20px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.5;
}

.size-guide-key-bleed { border-style: dashed; }
