:root {
  color-scheme: light;
  --bg: #ffffff;
  --card: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d2d2d7;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --brand: #0071e3;
  --brandHover: #0077ed;
  --focus: rgba(0,113,227,.35);
}

/* Inter (self-hosted, variable font). Files in /assets/fonts/Inter/ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src:
    local("Inter"),
    url("/assets/fonts/Inter/Inter-VariableFont_opsz,wght.woff2") format("woff2"),
    url("/assets/fonts/Inter/Inter-VariableFont_opsz,wght.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src:
    local("Inter Italic"),
    url("/assets/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.woff2") format("woff2"),
    url("/assets/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttf") format("truetype");
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a.card:hover { text-decoration: none; }
.card a:hover { text-decoration: none; }

.sf-container { max-width: 1200px; margin: 0 auto; padding: 0 18px; }
.sf-container--full {
  /* Listing pages only: widen main container and sync gutter with grid gap */
  /* Separate horizontal/vertical spacing so we can fit more columns on ~1172px */
  --sf-gutter-x: clamp(10px, 1.6vw, 14px);
  --sf-gutter-y: clamp(14px, 2vw, 22px);
  max-width: none;
  padding: 0 var(--sf-gutter-x);
}
.sf-narrow { max-width: 860px; margin: 0 auto; }

.sf-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(210,210,215,.65);
}

.sf-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 12px;
}

.sf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: .2px;
}

.sf-logo {
  height: 80px;
  width: auto;
  max-width: 100%;
  display: block;
}

.sf-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.sf-nav__link {
  color: #333333;
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
  opacity: .92;
}
.sf-nav__link:hover {
  opacity: 1;
  text-decoration: none;
}
.sf-nav__link[aria-current="page"] {
  text-decoration: none;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.55);
  opacity: 1;
}

.sf-subnav-wrap {
  border-bottom: 1px solid rgba(210,210,215,.65);
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}

.sf-subnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.sf-subnav__link {
  color: #2a7fe8;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
.sf-subnav__link:hover {
  color: #0071e3;
  text-decoration: none;
}
.sf-subnav__link[aria-current="page"] {
  color: #0071e3;
  font-weight: 400;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 rgba(0,113,227,.55);
}

.sf-main { padding: 26px 0 44px; }
.sf-main { flex: 1; }

.card {
  background: var(--card);
  border: 1px solid rgba(210,210,215,.65);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sf-products-grid {
  /* Product listings: CSS Grid for stable columns; last-row centering handled by a tiny JS helper */
  --sf-card-min: 200px;
  --sf-card-max: 355px;
  /* Fixed preview size: images must NOT resize with viewport; only gaps/columns change */
  --sf-preview: 200px;

  justify-content: center;
  display: grid;
  /* Original behavior: column count is based on min width; cards themselves are capped via max-width */
  grid-template-columns: repeat(auto-fit, minmax(var(--sf-card-min), 1fr));
  column-gap: var(--sf-gutter-x, 14px);
  row-gap: calc(var(--sf-gutter-y, 18px) + 14px);
}

/* When there are very few items (1–2), keep them close together and centered,
   but do NOT change the general responsive behavior for normal lists. */
.sf-products-grid[data-items="1"],
.sf-products-grid[data-items="2"] {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.sf-products-grid[data-items="1"] {
  max-width: var(--sf-card-max, 355px);
}
.sf-products-grid[data-items="2"] {
  max-width: calc((var(--sf-card-max, 355px) * 2) + var(--sf-gutter-x, 14px));
}
.muted { color: var(--muted); }

/* Clean product cards (used only in product listing grids on home/category pages) */
.sf-product-card {
  display: block;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  color: inherit;
  text-decoration: none;
  min-width: 0; /* allow grid to shrink items; helps reach 5 columns */
  width: 100%;
  max-width: var(--sf-card-max, 355px);
  justify-self: center;
}
.sf-product-card:hover { text-decoration: none; }

.sf-product-card__media {
  width: var(--sf-preview);
  height: var(--sf-preview);
  margin: 0 auto 16px; /* extra air so title never touches shadow */
  display: flex;
  align-items: center;     /* vertical centering */
  justify-content: center; /* horizontal centering */
}
.sf-product-card__media picture {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.sf-product-card__img {
  display: block;
  /* Image is NOT stretched to the 200x200 box; it keeps its aspect ratio.
     Long side becomes 200px (because the container is 200x200). */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 2px;
  /* Shadow + rounding on the image itself (no container) */
  box-shadow: 0 6px 16px rgba(0,0,0,.10);
}

.sf-product-card__empty {
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
}

.sf-cardimg {
  display: block;
  width: 100%;
  margin: -6px 0 10px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid rgba(210,210,215,.65);
  background: #fff;
  overflow: hidden;
}
.sf-product-card__title {
  font-weight: 400;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere; /* prevent long titles from forcing wider columns */
}
.sf-product-card__price {
  margin-top: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
}
.sf-cardimg__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
  background: #fff;
  display: block;
}
.sf-cardimg--empty {
  height: auto;
  aspect-ratio: 1 / 1;
  background: rgba(0,0,0,.02);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sf-cardimg__empty { font-size: 13px; }

.sf-alert {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(210,210,215,.9);
  background: rgba(0,0,0,.02);
  margin-bottom: 12px;
}
.sf-alert--error { border-color: rgba(215,0,21,.28); background: rgba(215,0,21,.06); }
.sf-alert--warn { border-color: rgba(255,149,0,.32); background: rgba(255,149,0,.10); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  border: 1px solid rgba(0,0,0,.10);
  font-weight: 650;
  cursor: pointer;
}
.btn:hover { background: var(--brandHover); text-decoration: none; }
.btn:focus, .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
button.btn { appearance: none; }

input, textarea, select {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(210,210,215,.95);
  border-radius: 12px;
  padding: 11px 12px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
  border-color: rgba(0,113,227,.55);
}

label { display: block; margin: 10px 0 6px; color: var(--muted); font-weight: 550; }
form .actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid rgba(210,210,215,.65); text-align: left; }
th { color: var(--muted); font-weight: 650; }

.sf-footer { border-top: 1px solid rgba(210,210,215,.65); padding: 22px 0 34px; }
.sf-footer__inner { color: var(--muted); font-size: 14px; }



