/* ==========================================================================
   Chapino base — reset, typography, shared components (header, footer, buttons)
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.3; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 700; line-height: 1.6; }
p { text-wrap: pretty; }

.num-latin { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* ---- Accessibility ---- */
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-control); }

.skip-link {
  position: absolute;
  inset-block-start: -4rem;
  inset-inline-start: var(--sp-4);
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--ink);
  color: var(--sheet);
  border-radius: var(--r-control);
  transition: inset-block-start var(--dur) var(--ease);
}
.skip-link:focus { inset-block-start: var(--sp-2); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Layout ---- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--section-y); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 3rem; padding: 0.5rem 1.375rem;
  border: 2px solid transparent; border-radius: var(--r-control);
  font-weight: 700; font-size: var(--fs-body); line-height: 1.4; white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { border-radius: var(--r-control); }

.btn--primary { background: var(--spot-orange); color: var(--ink); }
.btn--primary:hover { background: var(--spot-orange-hover); }

.btn--secondary { background: transparent; color: var(--press-blue); border-color: var(--press-blue); }
.btn--secondary:hover { background: var(--press-blue-tint); }

.btn--ghost { background: transparent; color: var(--press-blue); padding-inline: var(--sp-3); }
.btn--ghost:hover { background: var(--press-blue-tint); }

.btn--on-ink { background: transparent; color: var(--sheet); border-color: rgba(251, 251, 249, 0.55); }
.btn--on-ink:hover { background: rgba(251, 251, 249, 0.1); }

.btn--block { width: 100%; }

/* ---- Chips / status ---- */
.chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.125rem 0.75rem; border-radius: var(--r-pill);
  font-size: var(--fs-small); font-weight: 500; line-height: 1.8;
  background: var(--press-blue-tint); color: var(--press-blue-deep);
}
.chip .icon { width: 0.95rem; height: 0.95rem; }
.chip--ok { background: var(--ok-tint); color: var(--ok); }
.chip--warn { background: var(--warn-tint); color: var(--warn); }
.chip--danger { background: var(--danger-tint); color: var(--danger); }
.chip--spot { background: var(--spot-orange-tint); color: var(--spot-orange-deep); }

/* ---- CMYK registration strip (decorative) ---- */
.cmyk { display: inline-flex; gap: 3px; }
.cmyk span { width: 1.5rem; height: 0.375rem; border-radius: 1px; }
.cmyk span:nth-child(1) { background: var(--ink-c); }
.cmyk span:nth-child(2) { background: var(--ink-m); }
.cmyk span:nth-child(3) { background: var(--ink-y); }
.cmyk span:nth-child(4) { background: var(--ink-k); }

.site-footer .cmyk span:nth-child(4) { background: var(--paper); }

/* ---- Header ---- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: var(--z-header);
  background: rgba(227, 229, 220, 0.92);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.site-header.is-scrolled { border-block-end-color: var(--fold-line); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 3.75rem; }

.brand { display: inline-flex; align-items: center; gap: var(--sp-3); }
.brand img { height: 2.375rem; width: auto; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; color: var(--press-blue-deep); line-height: 1; }

.site-nav { display: none; }
.site-nav ul { display: flex; gap: var(--sp-6); }
.site-nav a { display: inline-block; padding: var(--sp-2) var(--sp-1); font-weight: 500; color: var(--ink-soft); border-block-end: 2px solid transparent; transition: color var(--dur-fast), border-color var(--dur-fast); }
.site-nav a:hover { color: var(--press-blue); border-block-end-color: var(--spot-orange); }

.header-actions { display: none; align-items: center; gap: var(--sp-2); }
.header-actions .btn { min-height: 2.75rem; padding-inline: 1.125rem; }

.menu-toggle {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem;
  background: transparent; border: 1px solid var(--fold-line); border-radius: var(--r-control); cursor: pointer; color: var(--ink);
}
.menu-toggle .icon { width: 1.5rem; height: 1.5rem; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.mobile-menu {
  position: absolute; inset-inline: 0; inset-block-start: 100%;
  background: var(--sheet); border-block: 1px solid var(--fold-line);
  box-shadow: var(--shadow-lift);
  padding: var(--sp-4) var(--gutter) var(--sp-6);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a:not(.btn) { display: block; padding: var(--sp-3) var(--sp-2); font-weight: 500; border-block-end: 1px solid var(--fold); }
.mobile-menu .btn { margin-block-start: var(--sp-4); }

@media (min-width: 64rem) {
  .site-nav { display: block; }
  .header-actions { display: flex; }
  .menu-toggle, .mobile-menu { display: none; }
}

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: var(--paper); padding-block: var(--sp-12) var(--sp-6); }
.site-footer__grid { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
.site-footer .brand img { height: 2.75rem; }
.site-footer .brand__name { color: var(--paper); }
.site-footer p { color: rgba(242, 243, 239, 0.72); max-width: 30ch; margin-block-start: var(--sp-4); }
.site-footer h2 { font-family: var(--font-body); font-size: var(--fs-body); font-weight: 700; color: var(--spot-orange); margin-block-end: var(--sp-3); }
.site-footer li a { display: inline-block; padding-block: 0.25rem; color: rgba(242, 243, 239, 0.8); }
.site-footer li a:hover { color: var(--sheet); text-decoration: underline; text-underline-offset: 4px; }
.site-footer :focus-visible { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--spot-orange); }
.site-footer__legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-block-start: var(--sp-8); padding-block-start: var(--sp-4); border-block-start: 1px solid rgba(242, 243, 239, 0.16); font-size: var(--fs-small); color: rgba(242, 243, 239, 0.62); }

@media (min-width: 48rem) {
  .site-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: var(--sp-8); }
}

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

/* ---- header shell: same bar, a role badge next to the brand ---- */
.brand-wrap { display: inline-flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.role-badge {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.125rem 0.75rem; border-radius: var(--r-pill);
  font-size: 0.8125rem; font-weight: 700; line-height: 1.8; white-space: nowrap;
}
.role-badge::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 1px; background: currentColor; }
.role-badge--customer { background: var(--press-blue-tint); color: var(--press-blue-deep); }
.role-badge--shop { background: var(--ink); color: var(--sheet); }
.role-badge--shop::before { background: var(--spot-orange); }
.api-error { position:fixed; z-index:10000; inset:1rem 1rem auto; padding:1rem; background:var(--slip,white); border:2px solid currentColor; }
