/* ==========================================================================
   Storefront base: type, layout wrapper, buttons and links.
   Loaded after app.css, so these win over the older global rules while pages
   that have not moved to sp/ yet keep their own classes.
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body.sp {
    font-family: var(--sp-font);
    font-size: var(--sp-fs-body);
    line-height: var(--sp-lh-body);
    color: var(--sp-ink);
    background: var(--sp-paper);
    -webkit-font-smoothing: antialiased;
}
body.sp a { color: inherit; }
body.sp a:hover { color: inherit; }
body.sp :focus-visible { outline: 3px solid var(--sp-focus); outline-offset: 2px; }
body.sp button, body.sp input, body.sp select, body.sp textarea { font-family: inherit; }

.sp-wrap { max-width: var(--sp-max); margin: 0 auto; padding: 0 var(--sp-gutter); }

/* Pages that have not moved to sp/ still render inside .container */
body.sp .site-main > .container { max-width: var(--sp-max); padding: 0 var(--sp-gutter); }
body.sp .site-main { min-height: 40vh; }

.sp-h1, .sp-h2, .sp-h3 { font-weight: 600; letter-spacing: var(--sp-track-tight); text-wrap: balance; }
.sp-h1 { font-size: var(--sp-fs-h1); line-height: 1.08; }
.sp-h2 { font-size: var(--sp-fs-h2); line-height: 1.12; letter-spacing: -0.025em; }
.sp-h3 { font-size: var(--sp-fs-h3); line-height: 1.2; letter-spacing: -0.01em; }
.sp-muted { color: var(--sp-ink-soft); }
.sp-num { font-variant-numeric: tabular-nums; }

.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;
}

/* --- Buttons ------------------------------------------------------------- */
.sp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 48px; padding: 0 22px;
    border: 0; border-radius: var(--sp-r-ctl);
    background: var(--sp-action); color: var(--sp-paper);
    font: 600 var(--sp-fs-lg)/1 var(--sp-font);
    white-space: nowrap; cursor: pointer; text-decoration: none;
    transition: background var(--sp-fast);
}
body.sp .sp-btn:hover { background: var(--sp-action-hover); color: var(--sp-paper); }
/* A filled link button keeps white text over `body.sp a { color: inherit }` */
body.sp a.sp-btn:not(.sp-btn--soft, .sp-btn--quiet, .sp-btn--outline),
body.sp a.sp-btn:not(.sp-btn--soft, .sp-btn--quiet, .sp-btn--outline):hover { color: var(--sp-paper); }
.sp-btn:disabled, .sp-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.sp-btn svg { width: 18px; height: 18px; flex: none; }
.sp-btn--lg { min-height: 56px; padding: 0 26px; }
.sp-btn--block { width: 100%; }
.sp-btn--soft { background: var(--sp-t1); color: var(--sp-action); }
body.sp .sp-btn--soft:hover { background: var(--sp-t2); color: var(--sp-action); }
.sp-btn--quiet { background: var(--sp-surface); color: var(--sp-ink); font-weight: 500; font-size: var(--sp-fs-ui); }
body.sp .sp-btn--quiet:hover { background: var(--sp-t1); color: var(--sp-ink); }
.sp-btn--outline { background: var(--sp-paper); color: var(--sp-ink); box-shadow: inset 0 0 0 1px var(--sp-line-strong); font-weight: 500; font-size: var(--sp-fs-ui); }
body.sp .sp-btn--outline:hover { background: var(--sp-surface); color: var(--sp-ink); }
.sp-btn--sm { min-height: 36px; padding: 0 14px; font-size: var(--sp-fs-ui); border-radius: var(--sp-r-sm); }

/* Text link with an underline that strengthens on hover */
.sp-link {
    color: var(--sp-action); font-weight: 600;
    text-decoration: underline; text-decoration-color: var(--sp-t2);
    text-decoration-thickness: 1.5px; text-underline-offset: 4px;
    transition: text-decoration-color var(--sp-fast);
    background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit;
}
body.sp .sp-link:hover { color: var(--sp-action); text-decoration-color: currentColor; }

.sp-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--sp-fs-ui); color: var(--sp-ink-soft);
}
.sp-back svg { width: 16px; height: 16px; }
body.sp .sp-back:hover { color: var(--sp-ink); }

/* --- Breadcrumbs --------------------------------------------------------- */
.sp-crumbs { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding-top: 20px; font-size: var(--sp-fs-sm); line-height: 1.35; color: var(--sp-ink-soft); }
.sp-crumbs a:hover { color: var(--sp-ink); text-decoration: underline; text-underline-offset: 3px; }
.sp-crumbs span[aria-hidden] { color: var(--sp-ink-faint); }

/* --- Flash messages ------------------------------------------------------ */
.sp-flash { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--sp-r-sm); font-size: var(--sp-fs-ui); }
.sp-flash--ok { background: var(--sp-ok-bg); color: var(--sp-ok); }
.sp-flash--bad { background: var(--sp-bad-bg); color: var(--sp-bad); }

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