/* Base: reset, typography, page frame, section rhythm. Breakpoints used site-wide: 480 / 768 / 1024 / 1280. */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  background: var(--c-page);
  color: var(--c-text);
  font: 400 var(--fs-lg) / 1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
:focus-visible { outline: 2px solid var(--c-green); outline-offset: 2px; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.icon-sprite { display: none; }
.icon { flex: none; }
.icon--flip { scale: -1 1; }
.icon-plus-stroke { opacity: var(--plus-stroke, 1); } /* circle-plus: --plus-stroke: 0 makes it a minus (category tree) */

/* Page frame: content 1344px centred, fluid side gutter (16px on phones, 48px from ~1200px) */
.container {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* main stacks the page's sections; each page sets its own rhythm */
.page-main {
  --main-top: clamp(16px, 1.67vw, 24px); /* header -> first block */
  --section-gap: 40px;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  padding-block: var(--main-top) var(--section-gap);
}
.page-main > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* Section: title row + content. Product rows space their title 48px from the content, centred rows 40px. */
.section {
  --head-gap: clamp(24px, 3.33vw, 48px);
  display: flex;
  flex-direction: column;
  gap: var(--head-gap);
  min-width: 0;
}
.section--center { --head-gap: clamp(24px, 2.78vw, 40px); }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.section__title {
  font-size: var(--fs-display);
  line-height: 1.21; /* 58px at 48px: Figma rounds text boxes up to whole pixels */
}
.section--center .section__head { justify-content: center; text-align: center; }
/* phones: a heading's button goes centred on the row under the title (user 10-05) */
.section__head:has(> .btn) { justify-content: center; }
.section__head:has(> .btn) > .section__title { flex-basis: 100%; }

/* white rounded panel with the raised shadow; the most common surface in the design */
.panel {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
}
.panel__title {
  font-size: var(--fs-h3);
  line-height: 1.3125;
  letter-spacing: 1px;
}

@media (min-width: 768px) {
  .section__head:has(> .btn) { justify-content: space-between; }
  .section__head:has(> .btn) > .section__title { flex-basis: auto; }
}

/* page-loading mask (ctheme2.js sets html.is-loading when a link or form leaves the page, and during in-place
   updates): a light grey layer with a white tile and a green ring, shown only after 0.25s; never blocks clicks */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--ease), visibility var(--ease);
}
body::before {
  inset: 0;
  background: var(--c-dim) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Crect width='72' height='72' rx='16' fill='%23fff'/%3E%3C/svg%3E") center / 72px no-repeat;
}
body::after {
  top: calc(50% - 18px);
  left: calc(50% - 18px);
  width: 36px;
  height: 36px;
  border: 4px solid var(--c-border);
  border-top-color: var(--c-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.is-loading body::before, .is-loading body::after { opacity: 1; visibility: visible; transition-delay: 0.25s; }
@keyframes spin { to { rotate: 1turn; } }
@media (prefers-reduced-motion: reduce) { body::after { animation-duration: 2.4s; } }
