/**
 * ECS default storefront design system.
 * Templates can override CSS variables via inline style on body/shell.
 * Keep class names (`sf-*`) stable so premium templates can reuse or restyle.
 */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap");

:root {
  --sf-bg: #f6f1ea;
  --sf-fg: #1c1917;
  --sf-primary: #0f4c3a;
  --sf-primary-fg: #f8faf8;
  --sf-accent: #c45c26;
  --sf-muted: #ebe4d8;
  --sf-surface: #fffcf7;
  --sf-border: color-mix(in srgb, var(--sf-fg) 10%, transparent);
  --sf-shadow: 0 1px 2px color-mix(in srgb, var(--sf-fg) 6%, transparent),
    0 12px 32px color-mix(in srgb, var(--sf-fg) 6%, transparent);
  --sf-radius: 14px;
  --sf-max: 1120px;
  --sf-heading-font: "Fraunces", ui-serif, Georgia, serif;
  --sf-body-font: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --sf-header-h: 4.25rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sf-bg);
  color: var(--sf-fg);
  font-family: var(--sf-body-font);
  font-optical-sizing: auto;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

/* —— Shell —— */
.sf-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sf-announcement {
  background: var(--sf-primary);
  color: var(--sf-primary-fg);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.55rem 1rem;
}

.sf-header-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--sf-bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sf-border);
}

.sf-header,
.sf-main,
.sf-footer {
  width: 100%;
  max-width: var(--sf-max);
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 28px);
  padding-right: clamp(16px, 4vw, 28px);
}

.sf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--sf-header-h);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.sf-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--sf-heading-font);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.sf-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: calc(var(--sf-radius) * 0.55);
  object-fit: cover;
  background: var(--sf-muted);
}

.sf-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  align-items: center;
}

.sf-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.925rem;
  opacity: 0.88;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.sf-nav a:hover,
.sf-nav a[aria-current="page"] {
  opacity: 1;
  border-bottom-color: var(--sf-accent);
}

.sf-cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700 !important;
  padding: 0.45rem 0.85rem !important;
  border-radius: 999px;
  background: var(--sf-surface);
  border: 1px solid var(--sf-border) !important;
  border-bottom-width: 1px !important;
}

.sf-cart-link:hover {
  border-color: color-mix(in srgb, var(--sf-primary) 35%, var(--sf-border)) !important;
}

.sf-main {
  flex: 1;
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.sf-footer {
  border-top: 1px solid var(--sf-border);
  padding-top: 1.75rem;
  padding-bottom: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  justify-content: space-between;
  align-items: flex-start;
  color: color-mix(in srgb, var(--sf-fg) 62%, transparent);
  font-size: 0.9rem;
}

.sf-footer strong {
  color: var(--sf-fg);
  font-family: var(--sf-heading-font);
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}

.sf-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.sf-footer-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--sf-fg);
  opacity: 0.75;
}

.sf-footer-nav a:hover {
  opacity: 1;
  color: var(--sf-primary);
}

/* —— Typography —— */
.sf-title {
  margin: 0 0 0.5rem;
  font-family: var(--sf-heading-font);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.sf-lede {
  margin: 0 0 1.5rem;
  color: color-mix(in srgb, var(--sf-fg) 62%, transparent);
  font-size: 1.05rem;
  max-width: 40rem;
}

.sf-eyebrow {
  margin: 0 0 0.5rem;
  color: var(--sf-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* —— Product grid —— */
.sf-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.sf-card {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: var(--sf-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  box-shadow: var(--sf-shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sf-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--sf-primary) 28%, var(--sf-border));
  box-shadow: 0 16px 40px color-mix(in srgb, var(--sf-fg) 10%, transparent);
}

.sf-card-media,
.sf-card-media-placeholder {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--sf-muted) 70%, #fff), var(--sf-muted));
  display: block;
}

.sf-card-body {
  padding: 0.9rem 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sf-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.sf-card-price {
  margin: auto 0 0;
  padding-top: 0.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--sf-primary);
  font-size: 0.95rem;
}

/* —— Controls —— */
.sf-btn {
  appearance: none;
  border: none;
  border-radius: calc(var(--sf-radius) * 0.75);
  background: var(--sf-primary);
  color: var(--sf-primary-fg);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.sf-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.sf-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.sf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sf-btn-secondary {
  background: transparent;
  color: var(--sf-fg);
  border: 1px solid var(--sf-border);
  box-shadow: none;
}

.sf-btn-secondary:hover:not(:disabled) {
  filter: none;
  border-color: color-mix(in srgb, var(--sf-fg) 28%, transparent);
  background: color-mix(in srgb, var(--sf-surface) 80%, var(--sf-muted));
}

.sf-btn-accent {
  background: var(--sf-accent);
  color: #fff;
}

.sf-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.sf-field label {
  font-weight: 600;
  font-size: 0.875rem;
}

.sf-field input,
.sf-field select,
.sf-field textarea {
  min-height: 44px;
  border: 1px solid var(--sf-border);
  border-radius: calc(var(--sf-radius) * 0.65);
  padding: 0.65rem 0.85rem;
  font: inherit;
  background: var(--sf-surface);
  color: var(--sf-fg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sf-field input:focus,
.sf-field select:focus,
.sf-field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--sf-primary) 55%, var(--sf-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sf-primary) 18%, transparent);
}

.sf-field textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.sf-notice {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  padding: 1rem 1.15rem;
  background: var(--sf-surface);
  margin-bottom: 1.15rem;
  box-shadow: var(--sf-shadow);
}

.sf-notice p:first-child {
  margin-top: 0;
}

.sf-notice p:last-child {
  margin-bottom: 0;
}

.sf-notice-error {
  border-color: color-mix(in srgb, #b91c1c 35%, var(--sf-border));
  background: #fef2f2;
  color: #7f1d1d;
}

.sf-notice-ok {
  border-color: color-mix(in srgb, var(--sf-primary) 30%, var(--sf-border));
  background: color-mix(in srgb, var(--sf-primary) 8%, var(--sf-surface));
  color: var(--sf-primary);
}

.sf-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sf-surface);
  border-radius: var(--sf-radius);
  overflow: hidden;
  border: 1px solid var(--sf-border);
  box-shadow: var(--sf-shadow);
}

.sf-table th,
.sf-table td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--sf-border);
  vertical-align: middle;
}

.sf-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--sf-fg) 55%, transparent);
  background: color-mix(in srgb, var(--sf-muted) 55%, var(--sf-surface));
}

.sf-table tr:last-child td {
  border-bottom: none;
}

.sf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.sf-pdp {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 800px) {
  .sf-pdp {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.5rem;
    align-items: start;
  }
}

.sf-pdp-media {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  border-radius: calc(var(--sf-radius) * 1.1);
  background: var(--sf-muted);
  border: 1px solid var(--sf-border);
  box-shadow: var(--sf-shadow);
}

.sf-muted {
  color: color-mix(in srgb, var(--sf-fg) 58%, transparent);
}

.sf-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.sf-badge {
  display: inline-flex;
  min-width: 1.35rem;
  justify-content: center;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--sf-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35rem;
}

.sf-checkout-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .sf-checkout-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    align-items: start;
  }
}

.sf-panel {
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  padding: 1.25rem;
  box-shadow: var(--sf-shadow);
}

.sf-panel h2 {
  margin: 0 0 1rem;
  font-family: var(--sf-heading-font);
  font-size: 1.15rem;
  font-weight: 600;
}

.sf-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 0.95rem;
}

.sf-summary-line.total {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--sf-border);
  font-weight: 700;
  font-size: 1.05rem;
}

@media (max-width: 640px) {
  .sf-table {
    display: block;
    overflow-x: auto;
  }

  .sf-header {
    flex-wrap: wrap;
  }
}
