:root {
  --brown-950: #1a120c;
  --brown-900: #2c1e14;
  --brown-800: #3d2b1f;
  --brown-700: #5a3f2c;
  --brown-600: #6e4f38;
  --gold-500: #c4a35a;
  --gold-400: #d4b76a;
  --gold-300: #e6d09a;
  --gold-dark: #9a7b3c;
  --cream-50: #fbf8f3;
  --cream-100: #f4efe6;
  --cream-200: #e8dfd0;
  --surface: #fffcf7;
  --ink: #1a1410;
  --ink-soft: #5a524a;
  --ink-faint: #8a8178;
  --border: #e2d8c8;
  --border-strong: #cfc3b0;
  --success: #2f6b3a;
  --danger: #9a021e;
  --danger-dark: #7a0118;
  --shadow-sm: 0 2px 8px rgba(26, 18, 12, 0.06);
  --shadow-md: 0 8px 28px rgba(26, 18, 12, 0.10);
  --shadow-lg: 0 20px 50px rgba(26, 18, 12, 0.14);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --header-h: 4.75rem;
  --max: 86rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* SOK storefront redesign tokens */
  --sok-brown: #572307;
  --sok-brown-dark: #431A06;
  --sok-brown-light: #6B2D0C;
  --sok-beige: #E8C991;
  --sok-text: #4B1F0D;
  --sok-muted: #777777;
  --sok-border: #E7E7E7;
  --sok-light: #FAFAFA;
  --sok-danger: #D92323;
  --sok-white: #FFFFFF;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 163, 90, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(61, 43, 31, 0.05), transparent 50%),
    var(--cream-50);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brown-800); text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: color 0.2s var(--ease); }
a:hover { color: var(--gold-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* FocusOnNavigate focuses #main / headings programmatically — no visible box on titles */
#main:focus,
h1:focus,
h2:focus,
h3:focus,
h4:focus {
  outline: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  color: var(--brown-900);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 10000;
  background: var(--brown-900); color: #fff; padding: 0.75rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.9rem 1.55rem; border: 1px solid transparent; border-radius: 999px;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.03em; cursor: pointer; text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brown-800), var(--brown-950));
  color: #fff; box-shadow: var(--shadow-sm);
}
.btn-primary:hover { color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--brown-950); box-shadow: var(--shadow-sm);
}
.btn-gold:hover { color: var(--brown-950); filter: brightness(1.04); transform: translateY(-1px); }
.btn-secondary { background: var(--brown-900); color: #fff; }
.btn-secondary:hover { background: var(--brown-700); color: #fff; }
.btn-outline {
  background: transparent; border-color: var(--brown-700); color: var(--brown-900);
}
.btn-outline:hover { background: var(--brown-900); color: #fff; border-color: var(--brown-900); }
.btn-ghost { background: transparent; color: var(--brown-900); }
.btn-ghost:hover { background: var(--cream-100); }
.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* Forms */
.field { display: grid; gap: 0.4rem; margin-bottom: 1.05rem; }
.field-hint {
  font-size: 0.8rem;
  color: var(--ink-faint);
  line-height: 1.35;
}
/* Google Places dropdown above sticky store chrome */
.pac-container {
  z-index: 10050 !important;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
}
.field label { font-weight: 600; font-size: 0.9rem; color: var(--brown-900); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.85rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font: inherit; color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.22);
  outline: none;
}

.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.28rem 0.65rem; border-radius: 999px;
  background: var(--brown-900); color: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.badge-gold { background: var(--gold-500); color: var(--brown-950); }
.badge-sale { background: var(--danger); }

.alert {
  padding: 0.95rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-error { background: #fdecee; color: var(--danger-dark); border-color: #f3c5cd; }
.alert-success { background: #eaf6ec; color: var(--success); border-color: #c6e4cb; }
.alert-info { background: var(--cream-100); color: var(--brown-900); border-color: var(--border); }

.section { padding: 4rem 0; }
.section-head { margin-bottom: 2rem; max-width: 40rem; }
.section-eyebrow {
  display: inline-block; margin-bottom: 0.55rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-dark);
}
.section-title { font-size: clamp(1.85rem, 3.2vw, 2.6rem); margin-bottom: 0.4rem; }
.section-lead { color: var(--ink-soft); margin: 0; font-size: 1.05rem; }

.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem;
}
@media (min-width: 720px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
@media (min-width: 1100px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 1.75rem; } }

/* Product card */
.product-card {
  position: relative; display: flex; flex-direction: column;
  height: 100%;
  background: #fff; border: 1px solid var(--sok-border);
  border-radius: 0; overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease);
}
.product-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d9d9d9; color: inherit;
}
.product-card__media {
  position: relative; aspect-ratio: 3 / 4;
  background: var(--cream-100, #f7f1e8);
  overflow: hidden;
  border-bottom: none;
  flex-shrink: 0;
}
.product-card__image-link {
  /* Absolute fill so max-height:% on the img has a definite box */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  box-sizing: border-box;
  text-decoration: none;
}
.product-card__media img {
  width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain; object-position: center;
  padding: 0;
  transition: transform 0.45s var(--ease-out);
}
.product-card:hover .product-card__media img { transform: scale(1.03); }
.product-card__badge { position: absolute; top: 0.85rem; left: 0.85rem; z-index: 2; }
.product-card__body {
  padding: 0.65rem 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  flex: 1 1 auto; min-height: 0;
  text-align: center;
  align-items: center;
}
.product-card__cat {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--sok-muted); font-weight: 600;
  flex-shrink: 0;
}
.product-card__name {
  font-family: var(--font-body); font-size: 0.92rem; margin: 0;
  color: var(--sok-text); font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
  min-height: calc(0.92rem * 1.3 * 2);
  max-height: calc(0.92rem * 1.3 * 2);
  flex-shrink: 0;
  word-break: break-word;
}
.product-card__name a { text-decoration: none; color: inherit; }
.product-card__name a:hover { color: var(--sok-brown); }
.product-card__price-row {
  display: grid; gap: 0.15rem; margin-top: 0.1rem;
  flex-shrink: 0;
  min-height: 2.2rem;
  justify-items: center;
}
.product-card__price { font-weight: 700; color: var(--sok-text); font-size: 1rem; }
.product-card__price s { color: var(--sok-muted); font-weight: 500; margin-right: 0.4rem; font-size: 0.88rem; }
.product-card__meta { font-size: 0.78rem; color: var(--sok-muted); }
.product-card__cart.btn,
.product-card__cart.btn-primary {
  width: auto;
  min-width: 7.5rem;
  min-height: 2.5rem;
  margin-top: auto;
  border-radius: 2px;
  flex-shrink: 0;
  background: var(--sok-light);
  color: var(--sok-text);
  border: 1px solid var(--sok-border);
  box-shadow: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
}
.product-card__cart.btn:hover:not(:disabled),
.product-card__cart.btn-primary:hover:not(:disabled) {
  background: var(--sok-brown);
  color: #fff;
  border-color: var(--sok-brown);
  transform: none;
  filter: none;
  box-shadow: none;
}
.product-card__cart .spinner {
  border-color: rgba(87, 35, 7, 0.22);
  border-top-color: var(--sok-brown);
}

.product-grid > * { min-height: 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 1rem 0.7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle;
}
.table th {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint);
}

.fade-up { animation: fadeUp 0.75s var(--ease-out) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--cream-100) 25%, var(--cream-200) 37%, var(--cream-100) 63%);
  background-size: 400% 100%; animation: shimmer 1.35s ease infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.skeleton-card .sk-img { aspect-ratio: 3 / 4; }
.skeleton-card .sk-line { height: 0.85rem; margin: 0.85rem 1rem; }
.skeleton-card .sk-line.short { width: 40%; }

/* Toast */
.toast-host {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 5000;
  display: grid; gap: 0.6rem; width: min(22rem, calc(100vw - 2rem));
}
.toast {
  background: var(--brown-900); color: #fff; padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  border-left: 4px solid var(--gold-500);
}
.toast--show { opacity: 1; transform: none; }
.toast--success { border-left-color: #5cb86a; }
.toast--error { border-left-color: #e57373; }

.scroll-top {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 4000;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 2px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: var(--sok-danger);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s var(--ease), background 0.2s var(--ease);
}
.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.scroll-top:hover { background: var(--sok-brown); filter: none; }
@media (min-width: 900px) {
  .scroll-top { right: 1.5rem; bottom: 1.75rem; }
}

.spinner {
  width: 1.15rem; height: 1.15rem; border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#blazor-error-ui {
  background: #fde8ec; bottom: 0; box-shadow: 0 -1px 8px rgba(0,0,0,0.12);
  display: none; left: 0; padding: 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 2000; color: var(--danger-dark);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.validation-message { color: var(--danger); font-size: 0.85rem; }
