/* ===== Carkeymaster base: reset, typography, layout primitives ===== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: 16px;
  line-height: var(--lh-base);
  color: var(--c-body);
  background: var(--c-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}
img, picture, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  color: var(--c-ink-2);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
}
h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem); }
h3 { font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }

/* ---- Layout container ---- */
.ckm-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
@media (max-width: 480px) { .ckm-container { padding-inline: 12px; } }

.site-main { min-height: 40vh; padding-block: var(--space-6); }

/* ---- Buttons ---- */
.ckm-btn,
.button, button.button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .7em 1.25em;
  font-family: inherit;
  font-weight: var(--fw-semibold);
  font-size: .95rem;
  line-height: 1.1;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .05s ease;
  text-decoration: none;
}
.ckm-btn:active, .button:active { transform: translateY(1px); }

.ckm-btn--primary, .button {
  background: var(--c-primary);
  color: var(--c-primary-ink);
}
.ckm-btn--primary:hover, .button:hover {
  background: var(--c-accent);
  color: var(--c-accent-ink);
  text-decoration: none;
}
.ckm-btn--ghost {
  background: transparent;
  color: var(--c-ink);
  border: 1px solid var(--c-border-strong);
}

/* ---- Forms ---- */
input[type="text"], input[type="search"], input[type="email"], input[type="tel"],
input[type="number"], input[type="password"], select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--c-ink-2);
  background: var(--c-control-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: .6em .8em;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--c-accent);
  outline-offset: 1px;
  border-color: var(--c-accent);
}

/* ---- Accessibility helpers ---- */
.screen-reader-text {
  position: absolute !important;
  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: -9999px; top: 0;
  background: var(--c-ink-2); color: var(--c-on-dark);
  padding: .6em 1em; z-index: var(--z-overlay);
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* ---- Utilities ---- */
.ckm-visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.ckm-sr-only-focusable:focus { position:static; width:auto; height:auto; clip:auto; }

/* ---- Page title banner (cart/checkout/account/legal pages) ---- */
.ckm-page-banner {
  background-color: var(--c-ink-2);
  background-image: var(--ckm-bg-main);
  background-size: cover;
  background-position: center;
  color: var(--c-on-dark);
  text-align: center;
}
.ckm-page-banner__title {
  color: var(--c-on-dark);
  margin: 0;
  padding: 44px 0;
  font-weight: 700;
  text-transform: none;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
}
.ckm-page-banner + .site-main { padding-top: var(--space-5); }

/* Native controls and autofill must remain legible in both colour schemes. */
input::placeholder,
textarea::placeholder { color: var(--c-placeholder); opacity: 1; }

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--c-ink-2);
  box-shadow: 0 0 0 1000px var(--c-control-bg) inset;
  caret-color: var(--c-ink-2);
}
