/* Engine components (demo notice, policy pages, map, product buy bar, cookie banner, consent checkbox).
   site.css loads after this file and maps the --sw-* tokens to the store theme. */

:root {
  --sw-ink: #16181b;
  --sw-paper: #ffffff;
  --sw-muted: #5d5a55;
  --sw-line: #e6ddd0;
  --sw-accent: #7a2e1f;
  --sw-accent-ink: #ffffff;
  --sw-notice-bg: #16181b;
  --sw-notice-ink: #ffffff;
  --sw-radius: 14px;
  --sw-display: inherit;
  --sw-measure: 76ch;
  --sw-bar-h: 0px;
}

/* Honeypot field */
.sw-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Demo notice */
.sw-demo {
  background: var(--sw-notice-bg);
  color: var(--sw-notice-ink);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-align: center;
  padding: 0.4rem 1rem;
}
.sw-demo p { margin: 0; }
.sw-demo a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Policy, thank-you and 404 pages */
.sw-doc__body { max-width: var(--sw-measure); padding-bottom: 1rem; line-height: 1.65; font-size: 1rem; }
.sw-doc__body h2 { font-family: var(--sw-display); font-size: 1.375rem; margin: 2rem 0 0.5rem; }
.sw-doc__body h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }
.sw-doc__body ul:not(.sw-doc__links) { list-style: disc; padding-left: 1.25rem; margin: 0 0 1em; }
.sw-doc__body li + li { margin-top: 0.35rem; }
.sw-doc__date { font-size: 0.875rem; color: var(--sw-muted); }
.sw-doc__promise { font-weight: 700; }
.sw-doc__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}
.sw-doc__links a {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--sw-line);
  border-radius: 999px;
  text-decoration: none;
}

/* Shared buttons */
.sw-btn {
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--sw-accent);
  border-radius: 999px;
  background: var(--sw-accent);
  color: var(--sw-accent-ink);
  cursor: pointer;
}
.sw-btn:hover { filter: brightness(1.12); }
.sw-linkish {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  min-height: 24px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Footer legal links */
.sw-legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

/* Click-to-load map */
.sw-map {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1.5px dashed var(--sw-line);
  border-radius: var(--sw-radius);
}
.sw-map p { margin: 0; }
.sw-map__addr { font-weight: 700; }
.sw-map__note { font-size: 0.875rem; color: var(--sw-muted); }
.sw-map__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}
.sw-map__link { display: inline-block; min-height: 24px; color: inherit; text-underline-offset: 2px; }
.sw-map iframe {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: var(--sw-radius);
}

/* Required consent checkbox on forms */
.sw-agree {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.75rem 0 1rem;
  line-height: 1.45;
}
.sw-agree input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.1rem 0 0;
  accent-color: var(--sw-accent);
}
.sw-agree a { color: inherit; text-underline-offset: 2px; }

/* Product buy bar: phones only; the body gets matching bottom padding so nothing is hidden */
.sw-bar { display: none; }
@media (max-width: 959px) {
  :root:has(.sw-bar) { --sw-bar-h: calc(4rem + env(safe-area-inset-bottom, 0px)); }
  body:has(.sw-bar) { padding-bottom: var(--sw-bar-h); }
  .sw-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: var(--sw-bar-h);
    padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    background: var(--sw-paper);
    border-top: 1px solid var(--sw-line);
    box-shadow: 0 -6px 18px rgb(0 0 0 / 8%);
  }
  .sw-bar__price { margin: 0; font-weight: 800; font-size: 1.25rem; }
  .sw-bar__action {
    flex: 1;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: var(--sw-accent);
    color: var(--sw-accent-ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
  }
  .sw-bar__action:disabled { opacity: 0.45; cursor: not-allowed; }
}

/* Cookie banner (only rendered when analytics is configured) */
.sw-consent {
  position: fixed;
  inset: auto 1rem calc(var(--sw-bar-h) + 1rem) 1rem;
  z-index: 90;
  max-width: 34rem;
  padding: 1.25rem;
  background: var(--sw-paper);
  color: var(--sw-ink);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-radius);
  box-shadow: 0 12px 40px rgb(0 0 0 / 22%);
}
.sw-consent[hidden] { display: none; }
.sw-consent__title { font-family: var(--sw-display); font-size: 1.125rem; margin: 0 0 0.4rem; }
.sw-consent__title:focus { outline: none; }
.sw-consent p { margin: 0 0 0.75rem; font-size: 0.9375rem; line-height: 1.5; }
.sw-consent a { color: inherit; text-underline-offset: 2px; }
.sw-consent fieldset { border: 1px solid var(--sw-line); border-radius: var(--sw-radius); margin: 0 0 0.75rem; padding: 0.5rem 0.9rem 0.75rem; }
.sw-check { display: flex; align-items: center; gap: 0.5rem; min-height: 32px; }
.sw-check input { width: 1.15rem; height: 1.15rem; accent-color: var(--sw-accent); }
.sw-consent__prefs { margin-bottom: 0.75rem; }
.sw-consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.sw-consent__actions .sw-btn { flex: 1 1 10rem; }

/* Store reviews and team blocks (render only when real entries exist) */
.sw-reviews ul,
.sw-team ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}
.sw-review { margin: 0; padding: 1.25rem; border-radius: var(--sw-radius); background: var(--sw-paper); }
.sw-review blockquote { margin: 0 0 0.75rem; }
.sw-review__meta { color: var(--sw-muted); }
.sw-team img { width: 100%; height: auto; border-radius: var(--sw-radius); }
.sw-team__name { font-weight: 700; margin: 0.5rem 0 0; }
.sw-team__role { color: var(--sw-muted); margin: 0; }
