/* src/styles/app.css — global base + component styles used by the Astro shell.
 * Depends on tokens.css for the design system. Server-rendered, no runtime JS
 * for layout; client scripts are only for interactive pieces (catalog filter,
 * mobile nav, cart, COA search).
 */

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

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

@media (prefers-reduced-motion: reduce) {
   html { scroll-behavior: auto; }
   *, *::before, *::after {
     animation-duration: 0.001ms !important;
     animation-iteration-count: 1 !important;
     transition-duration: 0.001ms !important;
    }
}

body {
   margin: 0;
   font-family: var(--font-sans);
   font-size: var(--fs-base);
   line-height: 1.6;
   color: var(--ink);
   background: var(--bg);
   -webkit-font-smoothing: antialiased;
   text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-strong); text-decoration: none; }
a:hover { color: var(--teal); }

/* ---------- Theme-aware brand mark (.pc-brandmark via <BrandMark variant="auto">) ----------
   Both the standard (full) and reversed mark are rendered; CSS shows the correct
   approved asset for the current theme. No color filters -- the two real SVGs
   are simply toggled on :root[data-theme], so the header mark is legible on both
   the light off-white nav and the dark navy nav and switches instantly on toggle. */
.pc-brandmark { display: inline-flex; line-height: 0; vertical-align: middle; }
.pc-brandmark__img { display: block; }
.pc-brandmark__dark { display: none; }
:root[data-theme="dark"] .pc-brandmark__light { display: none; }
:root[data-theme="dark"] .pc-brandmark__dark { display: block; }

h1, h2, h3, h4 {
   color: var(--ink);
   line-height: 1.15;
   letter-spacing: -0.01em;
   font-weight: 800;
   margin: 0 0 var(--space-4);
}
h1 { font-size: clamp(2rem, 5vw, var(--fs-3xl)); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--fs-2xl)); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

hr { border: none; border-top: 1px solid var(--line); margin: var(--space-6) 0; }

:focus-visible {
   outline: none;
   box-shadow: var(--ring);
   border-radius: var(--radius-sm);
}

/* ---------- Layout primitives ---------- */
.container {
   width: 100%;
   max-width: var(--maxw);
   margin-inline: auto;
   padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--maxw-narrow); }
.stack { display: flex; flex-direction: column; }
.center { text-align: center; }
.muted { color: var(--muted); }
.eyebrow {
   font-size: var(--fs-sm);
   font-weight: 700;
   letter-spacing: 0.14em;
   text-transform: uppercase;
   color: var(--teal-strong);
   margin-bottom: var(--space-3);
}
.lead { font-size: var(--fs-md); color: var(--ink-2); max-width: 60ch; }
.section { padding-block: var(--space-8); }
.section--tight { padding-block: var(--space-7); }

/* ---------- Page header (shared gutter wrapper, M1) ----------
   Headings now always sit inside .container, so they carry the same
   responsive horizontal gutter as every section instead of flushing to the
   viewport edge. */
.page-header { padding: var(--space-7) 0 var(--space-6); }
.page-header .lead { margin-bottom: 0; }
.page-header.center { text-align: center; }
.page-header.center h1,
.page-header.center .eyebrow { text-align: center; }
.page-header.center .lead { margin-inline: auto; }

/* Widen the header container for feature pages (catalog, coa) without breaking
   the narrow read-width used by content pages. */
.page-header--wide .container { max-width: var(--maxw); }

/* ---------- Buttons / links ---------- */
.btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.5ch;
   font: inherit;
   font-weight: 700;
   line-height: 1;
   padding: 0.75rem 1.25rem;
   border-radius: var(--radius-pill);
   border: 1px solid transparent;
   cursor: pointer;
   transition: transform 0.12s var(--ease), background 0.12s var(--ease),
    box-shadow 0.12s var(--ease);
   text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
   background: var(--teal);
   color: #fff;
   box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--teal-strong); color: #fff; }
.btn--ghost {
   background: transparent;
   color: var(--ink);
   border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--teal); color: var(--teal-strong); }
.btn--on-dark {
   background: var(--teal);
   color: #fff;
}
.btn--on-dark:hover { background: var(--teal-soft); color: var(--navy); }
.btn--block { width: 100%; }
.btn--sm { padding: 0.5rem 0.85rem; font-size: var(--fs-sm); }

/* ---------- Badges / pills / states ---------- */
.badge {
   display: inline-flex;
   align-items: center;
   gap: 0.4ch;
   font-size: var(--fs-xs);
   font-weight: 700;
   letter-spacing: 0.04em;
   padding: 0.2rem 0.6rem;
   border-radius: var(--radius-pill);
   text-transform: uppercase;
   line-height: 1.4;
}
.badge--available { background: var(--ok-bg); color: var(--ok); }
.badge--inquire { background: var(--pale-mint); color: var(--teal-strong); }
.badge--not-available { background: #f0e2e2; color: #a23b3b; }
.badge--draft {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px dashed var(--warn);
}
.badge--contradictory {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px dashed var(--warn);
}
.badge--demo {
  background: var(--pale-mint);
  color: var(--teal-strong);
  border: 1px solid var(--line);
}
:root[data-theme="dark"] .badge--demo {
  background: #1a3a3e;
  color: #b8e0dc;
  border-color: #2c6d70;
}
:root[data-theme="dark"] .callout--demo {
  background: #1a3a3e;
  border-color: #2c6d70;
}

/* ---------- Callout ---------- */
.callout {
  border: 1px solid var(--notice-border);
  background: var(--notice-surface);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}
.callout--warn {
  background: var(--warn-bg);
  border-color: #ecd9b0;
}
.callout--info {
  background: var(--info-bg);
  border-color: #cfe4df;
}
.callout--demo {
  border: 1px dashed var(--teal);
  background: var(--pale-mint);
}
.callout .callout__title {
  font-weight: 800;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: 0.5ch;
  color: var(--notice-title-text);
}
/* Ensure nested headings, paragraphs, links, and emphasized text inherit correctly */
.callout h1,
.callout h2,
.callout h3,
.callout h4,
.callout p,
.callout a,
.callout strong,
.callout em {
  color: var(--notice-text);
}
.callout a {
  text-decoration: underline;
}
.callout a:hover {
  text-decoration: none;
}
/* Theme-aware notice backgrounds */
:root[data-theme="dark"] .callout--warn {
  background: var(--on-dark--warn-bg);
}
:root[data-theme="dark"] .callout--info {
  background: var(--on-dark--info-bg);
}
:root[data-theme="dark"] .callout--demo {
  background: #1a3a3e; /* Dark teal for demo notice */
  border-color: #2c6d70;
}

/* ---------- Demo banner (sticky top, dismissible client-side) ----------
   Compact by default; on narrow viewports the text wraps to at most two
   lines and the vertical padding shrinks so the banner never occupies more
   than a small fraction of the initial mobile viewport (M2). */
.demo-banner {
   background: var(--navy);
   color: var(--on-dark);
   font-size: var(--fs-sm);
   line-height: 1.35;
   text-align: center;
   padding: 0.5rem calc(var(--gutter) + 1.5rem);
   position: relative;
   z-index: 40;
}
.demo-banner__text { margin: 0; max-width: 60ch; margin-inline: auto; }
.demo-banner a { color: var(--teal-soft); font-weight: 600; }
.demo-banner__close {
   position: absolute;
   right: 0.75rem;
   top: 50%;
   transform: translateY(-50%);
   background: transparent;
   border: none;
   color: var(--on-dark-muted);
   cursor: pointer;
   font-size: 1rem;
   line-height: 1;
   padding: 0.25rem;
}
.demo-banner__close:hover { color: #fff; }

@media (max-width: 520px) {
 .demo-banner {
  font-size: var(--fs-xs);
  padding: 0.4rem calc(var(--gutter) + 1.75rem);
 }
}
[data-hidden] { display: none !important; }

/* ---------- Cards / grid ---------- */
.card {
   background: var(--surface);
   border: 1px solid var(--line);
   border-radius: var(--radius-lg);
   padding: var(--space-5);
   box-shadow: var(--shadow-sm);
}
.grid {
   display: grid;
   gap: var(--space-5);
}
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
   .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
   .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */
label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
input, select, textarea {
   font: inherit;
   color: inherit;
   background: var(--surface);
   border: 1px solid var(--line);
   border-radius: var(--radius);
   padding: 0.7rem 0.85rem;
   width: 100%;
}
input:focus, select:focus, textarea:focus {
   outline: none;
   border-color: var(--teal);
   box-shadow: var(--ring);
}
textarea { min-height: 7rem; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: var(--space-4); }
.form-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.form-row > * { flex: 1 1 180px; }
.checkbox {
   display: flex;
   align-items: flex-start;
   gap: 0.6rem;
   font-size: var(--fs-sm);
   margin-bottom: var(--space-3);
}
.checkbox input { width: auto; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data {
   width: 100%;
   border-collapse: collapse;
   font-size: var(--fs-sm);
}
table.data th, table.data td {
   text-align: left;
   padding: 0.65rem 0.75rem;
   border-bottom: 1px solid var(--line-soft);
   vertical-align: top;
}
table.data th { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: var(--fs-xs); }
table.data tr:hover td { background: var(--surface-2); color: var(--ink); }

/* ---------- Empty state ---------- */
.empty {
   text-align: center;
   padding: var(--space-8) var(--space-5);
   border: 1px dashed var(--line);
   border-radius: var(--radius-lg);
   background: var(--surface);
   color: var(--muted);
}
.empty__mark {
   width: 64px;
   height: 64px;
   margin: 0 auto var(--space-4);
   color: var(--line);
}
.empty h3 { color: var(--ink); margin-bottom: var(--space-2); }

/* ---------- Utility ---------- */
.sr-only {
   position: absolute;
   width: 1px; height: 1px;
   padding: 0; margin: -1px;
   overflow: hidden;
   clip: rect(0, 0, 0, 0);
   white-space: nowrap;
   border: 0;
}
.skip-link {
   position: absolute;
   left: -999px;
   top: 0;
   background: var(--navy);
   color: #fff;
   padding: 0.6rem 1rem;
   z-index: 100;
   border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }
.divider { height: 1px; background: var(--line); border: none; }
.mono { font-family: var(--font-mono); }
.muted-strong { color: var(--ink-2); font-weight: 600; }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.wrap { flex-wrap: wrap; }

/* ---------- Request journey + summary (storefront, M3) ----------
   A compact 4-step customer path shown above the request form. */
.journey {
   list-style: none;
   display: grid;
   grid-template-columns: repeat(4, 1fr);
   gap: var(--space-4);
   margin: 0 0 var(--space-6);
   padding: 0;
   counter-reset: journey;
}
.journey li {
   display: flex;
   gap: var(--space-3);
   align-items: flex-start;
}
.journey__n {
   flex: 0 0 auto;
   width: 1.75rem;
   height: 1.75rem;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   border-radius: var(--radius-pill);
   background: var(--pale-mint);
   color: var(--teal-strong);
   font-weight: 800;
   font-size: var(--fs-sm);
}
.journey strong { font-size: var(--fs-sm); }
@media (max-width: 640px) {
 .journey { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
 .journey { grid-template-columns: 1fr; }
}

/* Request summary key/value rows. */
.summary-grid {
   display: grid;
   grid-template-columns: max-content 1fr;
   gap: var(--space-2) var(--space-4);
   margin: 0;
   font-size: var(--fs-sm);
}
.summary-grid dt { color: var(--ink-2); }
.summary-grid dd { margin: 0; }

/* Configuration-ready payment placeholder — a clear "not active yet" state. */
.payment-placeholder {
   border: 1px dashed var(--line);
   border-radius: var(--radius);
   padding: var(--space-4);
   text-align: center;
   color: var(--muted);
}

/* Preserve semantic hidden state even when layout utilities set display. */
[hidden] { display: none !important; }
/* Shared primary action contrast: retain teal identity with a readable white label. */
.btn--primary{background:color-mix(in srgb,var(--teal-strong) 85%,var(--navy) 15%);color:#fff}
