/* Reactive Shop design system (from the Google Stitch design, reactive_shop/DESIGN.md).
   Emerald is the "operational signal": primary actions, prices, in-stock states — never
   large background areas. Slate carries text and structure; hairline borders + soft
   shadows give depth. Shared by the storefront pages and (via admin.css) the admin. */

:root {
  --primary: #00aa77;
  --primary-hover: #009668;
  --primary-active: #00825a;
  --primary-tint: #e6f7f2;
  --primary-ink: #00825a;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --surface: #ffffff;
  --canvas: #f8f9ff;
  --blue: #3b82f6;
  --blue-tint: #eff4ff;
  --danger: #dc2626;
  --danger-tint: #fef2f2;
  --warn: #b45309;
  --warn-tint: #fffbeb;

  --radius-sm: .375rem;
  --radius: .5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --shadow-1: 0 1px .1875rem 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
  --shadow-2: 0 .5rem 1.5rem -.25rem rgba(15, 23, 42, 0.08), 0 .25rem .5rem -2px rgba(15, 23, 42, 0.03);
  --shadow-3: 0 1.25rem 2rem -.5rem rgba(15, 23, 42, 0.10), 0 .5rem 1rem -.25rem rgba(15, 23, 42, 0.05);
  --shadow-4: 0 1.5rem 3rem -.75rem rgba(15, 23, 42, 0.22);

  --font-display: 'Hanken Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --container: 80rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
.hidden, [hidden] { display: none !important; }

/* App shell: the browser page never scrolls. Header (and the phone tab bar) stay put and
   only .app-scroll — the content between them — scrolls, without chaining into the page. */
html:has(body.app-shell) { height: 100%; overflow: hidden; }
/* Same, for browsers without :has() (the scripts add the class); kept as its own rule so they don't drop it. */
html.app-shell-root { height: 100%; overflow: hidden; }
body.app-shell { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; overscroll-behavior: none; }
body.app-shell > .site-header { position: relative; flex: none; }
.app-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
/* Everything is sized in rem, and the root size is fluid: ~14px on a small phone, 16px from
   about 1024px wide. The whole UI scales with the screen, and with browser zoom and the
   user's text-size setting (the clamp is in rem, so it follows their base size too). */
html { -webkit-text-size-adjust: 100%; font-size: clamp(0.875rem, 0.8rem + 0.35vw, 1rem); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: .875rem;
  line-height: 1.375rem;
  color: var(--slate-700);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--slate-900); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--slate-900); margin: 0; letter-spacing: -0.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--slate-500); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Material Symbols (loaded from Google Fonts) */
.icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal; font-style: normal; font-size: 1.25rem; line-height: 1;
  display: inline-block; letter-spacing: normal; text-transform: none; white-space: nowrap;
  direction: ltr; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle; flex-shrink: 0;
}
.icon.sm { font-size: 1.125rem; }
.icon.xs { font-size: 1rem; }
.icon.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
/* Large screens use more of the width instead of leaving wide empty margins. */
@media (min-width: 1600px) { :root { --container: 100rem; } .container { padding: 0 2rem; } }
@media (min-width: 2200px) { :root { --container: 120rem; } }
@media (max-width: 640px) { .container { padding: 0 1rem; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.75rem; padding: 0 1.125rem; border-radius: var(--radius);
  border: 1px solid transparent; font-weight: 600; font-size: .875rem; cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease), box-shadow 150ms var(--ease);
  white-space: nowrap; text-decoration: none;
}
.btn:disabled { cursor: not-allowed; opacity: 0.55; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); color: #fff; box-shadow: 0 .375rem .875rem -.375rem rgba(0, 170, 119, 0.55); }
.btn-primary:active:not(:disabled) { background: var(--primary-active); transform: translateY(1px); }
.btn-secondary { background: var(--surface); border-color: var(--slate-200); color: var(--slate-900); }
.btn-secondary:hover:not(:disabled) { border-color: var(--slate-300); background: var(--slate-50); }
.btn-ghost { background: transparent; color: var(--slate-500); }
.btn-ghost:hover:not(:disabled) { color: var(--slate-900); background: var(--slate-100); }
.btn-danger-outline { background: var(--surface); border-color: #fecaca; color: var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-tint); border-color: #fca5a5; }
.btn-sm { height: 2.125rem; padding: 0 .75rem; font-size: .8125rem; border-radius: var(--radius-sm); }
.btn-lg { height: 3.25rem; font-size: 1rem; }
.btn-block { width: 100%; }
.link { color: var(--primary-ink); font-weight: 500; background: none; border: none; padding: 0; cursor: pointer; }
.link:hover { color: var(--primary-active); text-decoration: underline; }

/* ---------- inputs ---------- */
.input, .select {
  height: 2.75rem; width: 100%; padding: 0 .75rem;
  background: var(--surface); border: 1px solid var(--slate-200); border-radius: var(--radius);
  color: var(--slate-900); transition: border-color 150ms, box-shadow 150ms;
}
.input::placeholder { color: var(--slate-400); }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 .1875rem rgba(0, 170, 119, 0.15); }
.select { appearance: none; padding-right: 2.125rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center; }
.field { display: flex; flex-direction: column; gap: .375rem; }
.field > span, .field-label { font-size: .8125rem; font-weight: 500; color: var(--slate-700); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--slate-400); pointer-events: none; }
.input-icon .input { padding-left: 2.5rem; }
.check { display: flex; align-items: center; gap: .625rem; cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; accent-color: var(--primary); cursor: pointer; margin: 0; }

/* toggle switch built on a checkbox */
.switch { position: relative; width: 2.5rem; height: 1.375rem; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--slate-300); border-radius: 62.4375rem; transition: background 150ms; }
.switch span::after { content: ''; position: absolute; top: .1875rem; left: .1875rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform 150ms var(--ease); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(1.125rem); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- chips, badges, pills ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .375rem; height: 1.875rem; padding: 0 .75rem;
  border-radius: 62.4375rem; border: 1px solid var(--slate-200); background: var(--surface);
  color: var(--slate-700); font-size: .8125rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.chip:hover { border-color: var(--slate-300); color: var(--slate-900); }
.chip.on, .chip[aria-pressed="true"] { background: var(--slate-900); border-color: var(--slate-900); color: #fff; }
.chip.green.on { background: var(--primary); border-color: var(--primary); }
.chip .count { color: inherit; opacity: 0.6; font-weight: 500; }
.tag {
  display: inline-flex; align-items: center; height: 1.375rem; padding: 0 .5rem; border-radius: .375rem;
  background: var(--slate-100); color: var(--slate-500); font-size: .75rem; font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  border: none; cursor: pointer; transition: background 150ms, color 150ms;
}
.tag:hover { background: var(--primary-tint); color: var(--primary-ink); }
.badge {
  display: inline-flex; align-items: center; gap: .25rem; height: 1.5rem; padding: 0 .625rem; border-radius: 62.4375rem;
  font-size: .75rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
.badge.green { background: var(--primary-tint); color: var(--primary-ink); box-shadow: inset 0 0 0 1px rgba(0, 170, 119, 0.2); }
.badge.amber { background: var(--warn-tint); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.18); }
.badge.red { background: var(--danger-tint); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.18); }
.badge.grey { background: var(--slate-100); color: var(--slate-500); box-shadow: inset 0 0 0 1px var(--slate-200); }
.badge.blue { background: var(--blue-tint); color: #1d4ed8; }
.badge.dark { background: var(--slate-900); color: #fff; }
.count-pill { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-width: 1.375rem; height: 1.375rem; padding: 0 .4375rem; border-radius: 62.4375rem; background: var(--blue-tint); color: var(--slate-500); font-size: .75rem; font-weight: 600; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--slate-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: 1.5rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--slate-200); }
.card-head h2 { font-size: 1.25rem; line-height: 1.75rem; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate-500); }

/* ---------- site header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(.75rem); -webkit-backdrop-filter: blur(.75rem); border-bottom: 1px solid var(--slate-200); }
.site-header .bar { display: flex; align-items: center; gap: 1rem; height: 4.25rem; }
.logo { display: inline-flex; align-items: center; gap: .625rem; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--slate-900); flex-shrink: 0; }
.logo:hover { color: var(--slate-900); }
.logo-mark { width: 2rem; height: 2rem; border-radius: .5625rem; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 .25rem .625rem -.25rem rgba(0, 170, 119, 0.6); }
.logo-mark .icon { font-size: 1.25rem; font-variation-settings: 'FILL' 1; }
.logo b { color: var(--primary); font-weight: 700; }
.header-search { flex: 1; max-width: 32.5rem; }
.header-search .input { height: 2.625rem; background: var(--slate-50); border-color: transparent; border-radius: .625rem; }
.header-search .input:focus { background: var(--surface); }
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
/* compact currency & language buttons: the native <select> sits invisibly on top */
.currency-picker, .lang-picker { position: relative; display: inline-flex; align-items: center; gap: .25rem; height: 2.5rem; padding: 0 .5rem 0 .625rem; border-radius: .625rem; border: 1px solid var(--slate-200); background: var(--surface); color: var(--slate-900); font-weight: 600; font-size: .8125rem; cursor: pointer; transition: border-color 150ms, background 150ms; }
.currency-picker:hover, .lang-picker:hover { border-color: var(--slate-300); background: var(--slate-50); }
.currency-picker:focus-within, .lang-picker:focus-within { border-color: var(--primary); box-shadow: 0 0 0 .1875rem rgba(0, 170, 119, 0.15); }
.currency-picker > .icon, .lang-picker > .icon { color: var(--primary-ink); }
.currency-picker .caret, .lang-picker .caret { color: var(--slate-400); }
.currency-picker select, .lang-picker select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: none; font-size: 1rem; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .625rem; border: 1px solid transparent; background: transparent; color: var(--slate-700); cursor: pointer; transition: background 150ms; }
.icon-btn:hover { background: var(--slate-100); color: var(--slate-900); }
.cart-btn { display: inline-flex; align-items: center; gap: .5rem; height: 2.5rem; padding: 0 .75rem 0 .625rem; border-radius: .625rem; background: var(--blue-tint); color: var(--slate-900); font-weight: 600; font-size: .8125rem; }
.cart-btn:hover { background: #e5eeff; }
.cart-btn .n { min-width: 1.375rem; height: 1.375rem; border-radius: 62.4375rem; background: var(--primary); color: #fff; font-size: .75rem; display: inline-grid; place-items: center; padding: 0 .375rem; }
.cart-btn .n.bump { animation: bump 350ms var(--ease); }
@keyframes bump { 50% { transform: scale(1.3); } }
.nav-link { font-weight: 500; color: var(--slate-700); padding: .5rem .625rem; border-radius: var(--radius); }
.nav-link:hover, .nav-link.active { color: var(--slate-900); background: var(--slate-100); }
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: .625rem; height: 2.75rem; padding: 0 .5rem 0 .25rem; border-radius: .75rem; border: none; background: transparent; cursor: pointer; }
.user-btn:hover { background: var(--slate-100); }
.avatar { width: 2.125rem; height: 2.125rem; border-radius: 50%; background: linear-gradient(135deg, #0f172a, #334155); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .875rem; }
.user-btn .who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.user-btn .who b { font-size: .8125rem; color: var(--slate-900); font-weight: 600; }
.user-btn .who small { font-size: .6875rem; color: var(--primary-ink); font-weight: 500; }
.menu { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 12.5rem; background: var(--surface); border: 1px solid var(--slate-200); border-radius: .75rem; box-shadow: var(--shadow-3); padding: .375rem; z-index: 60; }
.menu[hidden] { display: none; }
.menu a, .menu button { display: flex; align-items: center; gap: .625rem; width: 100%; padding: .5625rem .625rem; border-radius: .5rem; border: none; background: none; cursor: pointer; font-size: .875rem; color: var(--slate-700); text-align: left; }
.menu a:hover, .menu button:hover { background: var(--slate-100); color: var(--slate-900); }
.menu hr { border: none; border-top: 1px solid var(--slate-200); margin: .375rem 0; }
@media (max-width: 1024px) {
  .user-btn .who, .nav-link.hide-md { display: none; }
}
/* The header stays on one row and never squeezes or wraps its parts: when they don't fit,
   storefront.js hides the least important ones in turn (fit-1, fit-2...): the account name,
   "My Orders", the cart total, the Deals and Shop links, the guides button, then the shop
   name beside the logo mark. */
.nav-link, .cart-btn, .user-btn .who b, .user-btn .who small { white-space: nowrap; }
.header-actions > * { flex-shrink: 0; }
.header-search { min-width: 15rem; } /* room for "Search products…" */
.site-header.fit-1 .user-btn .who,
.site-header.fit-2 .nav-link.hide-md,
.site-header.fit-3 #cartTotalLabel,
.site-header.fit-4 .nav-link,
.site-header.fit-5 .guides-btn,
.site-header.fit-6 .logo .wordmark { display: none; }

/* ---------- account drawer (opened from the phone bottom bar) ---------- */
.menu-btn { display: none; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); animation: fade 150ms var(--ease); }
.drawer { position: fixed; top: 0; bottom: 0; right: 0; z-index: 95; width: min(20rem, 86vw); display: flex; flex-direction: column; gap: .375rem; padding: 1rem;
  background: var(--surface); border-left: 1px solid var(--slate-200); box-shadow: var(--shadow-4);
  transform: translateX(105%); visibility: hidden; transition: transform 220ms var(--ease), visibility 0s linear 220ms; overflow-y: auto; }
.drawer.open { transform: none; visibility: visible; transition: transform 220ms var(--ease); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: .5rem; }
.drawer-user { display: flex; align-items: center; gap: .75rem; padding: .75rem; border-radius: .875rem; background: #eff4ff; margin-bottom: .375rem; }
.drawer-user b { display: block; color: var(--slate-900); }
.drawer-user small { color: var(--primary-ink); font-weight: 500; }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a { display: flex; align-items: center; gap: .875rem; height: 3rem; padding: 0 .75rem; border-radius: .75rem; color: var(--slate-700); font-weight: 500; }
.drawer-nav a:hover { background: var(--slate-100); color: var(--slate-900); }
.drawer-nav a.active { background: var(--primary-tint); color: var(--primary-ink); font-weight: 600; }
.drawer-nav a .n { margin-left: auto; min-width: 1.375rem; height: 1.375rem; padding: 0 .4375rem; border-radius: 62.4375rem; background: var(--primary); color: #fff; font-size: .75rem; display: inline-grid; place-items: center; }
.drawer-nav a .n:empty { display: none; }
.drawer-nav hr { border: none; border-top: 1px solid var(--slate-200); margin: .5rem .25rem; }
.drawer-section { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .875rem .75rem; border-top: 1px solid var(--slate-200); margin-top: .5rem; }
.drawer-foot { margin-top: auto; display: grid; gap: .5rem; padding-top: .75rem; }
body.no-scroll { overflow: hidden; }

/* ---------- bottom tab bar (phones), Material 3 style ---------- */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    height: calc(4.25rem + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(.75rem); -webkit-backdrop-filter: blur(.75rem);
    border-top: 1px solid var(--slate-200); box-shadow: 0 -.375rem 1.25rem -.75rem rgba(15, 23, 42, 0.18); }
  .bottom-nav .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-width: 0;
    border: none; background: none; color: var(--slate-500); font-size: .75rem; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; padding: 0; height: auto; }
  .bottom-nav .tab .pill { position: relative; width: 3.75rem; height: 2rem; border-radius: 1rem; display: grid; place-items: center; transition: background 200ms var(--ease); }
  .bottom-nav .tab:active .pill { background: var(--slate-100); }
  .bottom-nav .tab.active { color: var(--slate-900); font-weight: 600; }
  .bottom-nav .tab.active .pill { background: var(--primary-tint); color: var(--primary-ink); }
  .bottom-nav .tab.active .icon { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
  .bottom-nav .tab-badge { position: absolute; top: -2px; right: .625rem; min-width: 1.125rem; height: 1.125rem; padding: 0 .3125rem; border-radius: 62.4375rem; background: var(--danger); color: #fff; font-size: .6875rem; font-weight: 700; line-height: 1.125rem; box-shadow: 0 0 0 2px #fff; }
  body:has(.bottom-nav):not(.app-shell) { padding-bottom: calc(4.75rem + env(safe-area-inset-bottom)); }
  body.app-shell > .bottom-nav { position: relative; flex: none; }
  body:has(.bottom-nav) .toast { bottom: calc(5.25rem + env(safe-area-inset-bottom)); }
  body.has-bottom-nav .toast { bottom: calc(5.25rem + env(safe-area-inset-bottom)); }

  /* header: logo + bell on one row, search underneath */
  .site-header .bar { flex-wrap: wrap; height: auto; padding-top: .625rem; padding-bottom: .625rem; gap: .625rem .75rem; }
  .header-search { order: 5; flex-basis: 100%; max-width: none; }
  .cart-btn { display: none; }
  .logo-mark { width: 1.875rem; height: 1.875rem; }
  .logo { font-size: 1.125rem; }
}
/* ---------- page scaffolding ---------- */
.page { padding: 1.75rem 0 3.5rem; }
.crumbs { display: flex; align-items: center; gap: .375rem; font-size: .8125rem; color: var(--slate-500); margin-bottom: .875rem; }
.crumbs a:hover { color: var(--slate-900); }
.crumbs .icon { font-size: 1rem; }
.page-title { font-size: 2.125rem; line-height: 2.5rem; font-weight: 700; letter-spacing: -0.025em; }
.page-sub { color: var(--slate-500); margin: .375rem 0 0; max-width: 38.75rem; }
@media (max-width: 640px) {
  .page { padding: 1.125rem 0 2rem; }
  .page-title { font-size: 1.625rem; line-height: 2rem; }
  .page-sub { font-size: .8125rem; }
}

/* ---------- footer ---------- */
.site-footer { background: #eff4ff; border-top: 1px solid var(--slate-200); margin-top: 1.5rem; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-top: 2.5rem; padding-bottom: 1.75rem; }
.site-footer h4 { font-size: .9375rem; margin-bottom: .75rem; }
.site-footer p { color: var(--slate-500); margin: .75rem 0 0; max-width: 21.25rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; color: var(--slate-500); }
.site-footer ul a:hover { color: var(--slate-900); }
.site-footer .legal { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; border-top: 1px solid var(--slate-200); padding-top: 1rem; padding-bottom: 1.5rem; font-size: .75rem; color: var(--slate-500); }
@media (max-width: 640px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .site-footer .cols > :first-child { grid-column: 1 / -1; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 200; display: flex; align-items: center; gap: .625rem;
  background: var(--slate-900); color: #fff; padding: .75rem 1rem; border-radius: .75rem; box-shadow: var(--shadow-3); font-size: .875rem;
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease), transform 200ms var(--ease); max-width: calc(100vw - 2rem); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .icon { color: #58dda6; }
.toast.error { background: #7f1d1d; }
.toast.error .icon { color: #fecaca; }
.toast a { color: #58dda6; font-weight: 600; margin-left: .25rem; }
.toast a:hover { color: #77fac1; }

/* ---------- Google sign-in card (signed-out visitors, shop page) ---------- */
.signin-card { position: fixed; top: 5rem; right: 1.5rem; z-index: 60; width: 23rem; max-width: calc(100vw - 2rem);
  display: grid; gap: .875rem; padding: 1.125rem 1.125rem 1rem; background: var(--surface); border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-4);
  opacity: 0; transform: translateY(-.5rem); pointer-events: none; transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.signin-card.show { opacity: 1; transform: none; pointer-events: auto; }
.signin-card-head { display: flex; align-items: flex-start; gap: .75rem; }
.signin-card-head > div { flex: 1; min-width: 0; }
.signin-card-head b { display: block; font-family: var(--font-display); font-size: 1.0625rem; color: var(--slate-900); }
.signin-card-head small { display: block; margin-top: .125rem; color: var(--slate-500); font-size: .8125rem; line-height: 1.25rem; }
.signin-card-head .icon-btn { width: 2rem; height: 2rem; margin: -.25rem -.375rem 0 0; flex: none; }
.signin-card-mark { width: 2.5rem; height: 2.5rem; flex: none; border-radius: .75rem; background: var(--primary-tint); color: var(--primary-ink); display: grid; place-items: center; }
.signin-card-button { min-height: 2.75rem; display: flex; justify-content: center; }
.signin-card-more { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; font-size: .8125rem; font-weight: 500; color: var(--slate-500); }
.signin-card-more:hover { color: var(--primary-ink); }
/* phones: sits just above the bottom tab bar */
@media (max-width: 760px) {
  .signin-card { top: auto; left: .75rem; right: .75rem; width: auto; max-width: none; bottom: calc(5.25rem + env(safe-area-inset-bottom)); transform: translateY(.5rem); }
}

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(.25rem); -webkit-backdrop-filter: blur(.25rem); }
.modal-backdrop.open { display: flex; animation: fade 150ms var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal { width: 30rem; max-width: 100%; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--slate-200); border-radius: var(--radius-xl); box-shadow: var(--shadow-4);
  animation: rise 200ms var(--ease); }
.modal::before { content: ''; display: block; height: .25rem; background: linear-gradient(90deg, var(--primary), var(--blue)); flex-shrink: 0; }
@keyframes rise { from { transform: translateY(.75rem); opacity: 0; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: 1.25rem 1.5rem .5rem; }
/* A payment step is running (see payment-lock.js): closing and switching method look disabled. */
.payment-busy .icon-btn[aria-label="Close"], .payment-busy #modalBackBtn,
.payment-busy .pay-method, .payment-busy .pay-tab-btn { opacity: .45; cursor: not-allowed; }
.payment-confirming { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .625rem;
  padding: 1.5rem 1rem; border-radius: .75rem; background: var(--slate-50); border: 1px solid var(--slate-200);
  text-align: center; font-size: .875rem; color: var(--slate-700); }
.payment-confirming b { font-family: var(--font-display); font-size: 1rem; color: var(--slate-900); }
.modal-head h2 { font-size: 1.5rem; line-height: 1.875rem; }
.modal-body { padding: .75rem 1.5rem 1rem; overflow-y: auto; }
.modal-foot { padding: 1rem 1.5rem 1.375rem; border-top: 1px solid var(--slate-200); }
/* phones: dialogs become bottom sheets */
@media (max-width: 560px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 1.375rem 1.375rem 0 0; border-bottom: none; animation: sheet 220ms var(--ease); }
  .modal-head { padding: 1rem 1.125rem .375rem; }
  .modal-head h2 { font-size: 1.25rem; line-height: 1.625rem; }
  .modal-body { padding: .625rem 1.125rem .875rem; }
  .modal-foot { padding: .875rem 1.125rem calc(1.125rem + env(safe-area-inset-bottom)); }
}
@keyframes sheet { from { transform: translateY(2.5rem); opacity: 0.6; } }

/* ---------- skeletons ---------- */
.skeleton { background: linear-gradient(100deg, #eef2f7 30%, #f7f9fc 50%, #eef2f7 70%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: .375rem; display: block; }
@keyframes shimmer { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.skeleton-line { height: .75rem; margin: .375rem 0; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 3.5rem 1.5rem; }
.empty .glyph { width: 4rem; height: 4rem; margin: 0 auto 1rem; border-radius: 1.125rem; background: var(--blue-tint); color: var(--slate-500); display: grid; place-items: center; }
.empty .glyph .icon { font-size: 1.875rem; }
.empty h3 { font-size: 1.25rem; margin-bottom: .375rem; }
.empty p { color: var(--slate-500); margin: 0 0 1.25rem; }

/* ---------- notification bell (notifications.js) ---------- */
.notif { position: relative; display: inline-block; }
.notif-badge { position: absolute; top: .25rem; right: .25rem; background: var(--danger); color: #fff; border-radius: 62.4375rem; font-size: .625rem; font-weight: 700; line-height: 1rem; min-width: 1rem; padding: 0 .25rem; text-align: center; box-shadow: 0 0 0 2px #fff; }
.notif-badge[hidden] { display: none; }
/* Dropdown of alert cards: each notification gets a tone (success/info) that colours its
   icon badge, and unread ones an accent bar on the left plus a dot. */
.notif-panel { position: absolute; right: 0; top: calc(100% + .625rem); width: 24rem; max-width: calc(100vw - 2rem); display: flex; flex-direction: column; max-height: min(32rem, calc(100dvh - 6rem));
  background: var(--surface); border: 1px solid var(--slate-200); border-radius: 1rem; box-shadow: var(--shadow-4); z-index: 300; text-align: left; overflow: hidden;
  transform-origin: top right; animation: notif-in 160ms var(--ease); }
.notif-panel[hidden] { display: none; }
@keyframes notif-in { from { opacity: 0; transform: translateY(-.25rem) scale(.98); } }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .875rem 1rem; border-bottom: 1px solid var(--slate-200); background: var(--slate-50); }
.notif-title { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--slate-900); }
.notif-title > .icon { color: var(--primary-ink); }
.notif-count { height: 1.25rem; padding: 0 .5rem; border-radius: 999px; background: var(--danger); color: #fff; font-family: var(--font-body); font-size: .6875rem; font-weight: 700; display: inline-grid; place-items: center; }
.notif-count[hidden], .notif-head button[hidden] { display: none; }
.notif-head button { display: inline-flex; align-items: center; gap: .25rem; background: none; border: none; border-radius: .5rem; color: var(--primary-ink); cursor: pointer; font: inherit; font-size: .8125rem; font-weight: 600; padding: .25rem .5rem; margin-right: -.5rem; }
.notif-head button:hover { background: var(--primary-tint); }
.notif-list { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: .5rem; display: grid; gap: .375rem; }
.notif-item { --tone: var(--blue); --tone-tint: var(--blue-tint); position: relative; display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .875rem .75rem .75rem;
  border: 1px solid var(--slate-200); border-left: .25rem solid var(--slate-200); border-radius: .75rem; background: var(--surface); cursor: pointer; font-size: .8125rem; transition: background 150ms, border-color 150ms; }
.notif-item.success { --tone: var(--primary); --tone-tint: var(--primary-tint); }
.notif-item:hover { background: var(--slate-50); }
.notif-item.unread { border-left-color: var(--tone); background: var(--tone-tint); background: color-mix(in srgb, var(--tone-tint) 55%, var(--surface)); }
.notif-icon { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; background: var(--tone-tint); color: var(--tone); }
.notif-icon .icon { font-size: 1.25rem; }
.notif-body { flex: 1; min-width: 0; }
.notif-meta { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .125rem; }
.notif-meta .kind { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tone); }
.notif-item:not(.success) .notif-meta .kind { color: #1d4ed8; }
.notif-meta time { flex: none; color: var(--slate-400); font-size: .75rem; }
.notif-item .t { font-weight: 600; color: var(--slate-900); font-size: .875rem; line-height: 1.25rem; }
.notif-item.unread .t { font-weight: 700; }
.notif-item .m { color: var(--slate-500); line-height: 1.125rem; margin-top: .125rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.notif-link { display: inline-flex; align-items: center; gap: .125rem; margin-top: .5rem; color: var(--primary-ink); font-weight: 600; font-size: .75rem; text-decoration: none; }
.notif-link:hover { text-decoration: underline; }
.notif-dot { position: absolute; top: .875rem; right: .75rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 .1875rem var(--surface); }
.notif-item.unread .notif-meta { padding-right: 1rem; }
.notif-empty { display: grid; justify-items: center; gap: .25rem; padding: 2rem 1rem; color: var(--slate-500); font-size: .8125rem; text-align: center; }
.notif-empty > .icon { font-size: 2rem; color: var(--slate-300); margin-bottom: .25rem; }
.notif-empty b { color: var(--slate-900); font-size: .875rem; }

/* ---------- loading animations & overlays ---------- */
.spinner-sm {
  width: 1.125rem;
  height: 1.125rem;
  border: 2.2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.spinner-sm.dark {
  border-color: var(--slate-300);
  border-top-color: var(--primary);
}
.loader-circle {
  width: 3.25rem;
  height: 3.25rem;
  border: 3.5px solid var(--slate-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pd-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1.5rem;
  width: 100%;
  animation: fadeIn 200ms ease;
}
.loading-progress-bar {
  width: 12rem;
  height: 4px;
  background: var(--slate-200);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
}
.loading-progress-val {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  border-radius: 999px;
  animation: indetProgress 1.4s ease-in-out infinite;
}
@keyframes indetProgress {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- overflow guards ----------
   Every page and dialog loads this file (admin.css imports it), so these keep content inside
   the screen everywhere instead of fixing pages one by one: long words wrap, media shrinks,
   dialogs fit the screen and scroll inside, rows of buttons wrap, and on narrow screens a
   table that isn't already in a scroll box scrolls sideways itself rather than being cut off. */
body { overflow-wrap: break-word; }
img, video, iframe, canvas { max-width: 100%; }
.modal { max-width: calc(100vw - 2rem); max-height: calc(100dvh - 2rem); }
.modal-body { min-width: 0; }
.modal-head > *, .modal-body > * { min-width: 0; }
.modal-foot, .modal .modal-actions { flex-wrap: wrap; }
.modal :is(input, select, textarea) { max-width: 100%; }
@media (max-width: 760px) {
  .modal { max-width: 100%; max-height: 92dvh; }
  .modal-foot .btn, .modal .modal-actions .btn { flex: 1 1 auto; }
  table:not(.table-scroll table) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
}
