/* ==========================================================================
   epiceries.ca — redesign design system (v1)
   Lightweight consumer front-end. Replaces the Metronic admin bundle on
   ported pages. Minimal & premium: soft neutrals, faint green bias, editorial
   serif for wordmark/hero + system sans for UI.
   ========================================================================== */

/* Web fonts: Fraunces (editorial serif — wordmark/titles) + Inter (UI sans).
   Loaded from the page <head> (preconnect + <link>, see shell_header.php /
   auth_header.php / checklist.php) instead of an @import here: an @import at
   the top of the stylesheet serializes discovery — the fonts CSS can only
   start downloading after this whole file has arrived. */

:root {
  --bg: #f5f7f5;
  --surface: #ffffff;
  --surface-2: #fbfcfb;
  --ink: #13211a;
  --body: #465852;
  --muted: #8a968f;
  --line: #e6ebe7;
  --line-strong: #d5ddd8;
  --accent: #369160;
  --accent-600: #2a7c50;
  --accent-700: #20623f;
  --accent-tint: #eef6f1;
  --accent-tint-2: #d5e7dc;
  --danger: #dc2626;
  --danger-tint: #fef2f2;
  --amber: #b45309;

  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  --fs-h2: clamp(1.4rem, 2.6vw, 1.95rem);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16,32,24,.05), 0 1px 3px rgba(16,32,24,.05);
  --shadow-md: 0 8px 26px -10px rgba(16,32,24,.16);
  --shadow-lg: 0 22px 48px -20px rgba(16,32,24,.24);

  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink); margin: 0; text-wrap: balance; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.epc-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.25rem); }

.epc-eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-600); }
.tnum { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  border: 0; border-radius: var(--pill); background: var(--accent-600); color: #fff; font-weight: 600;
  padding: 11px 22px; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 16px -6px rgba(42,124,80,.42); transition: background .18s, transform .12s; white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--accent-700); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--accent-700); border: 1px solid var(--line-strong); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-tint); border-color: var(--accent-tint-2); color: var(--accent-700); }
.btn-dark { background: var(--ink); box-shadow: none; }
.btn-dark:hover { background: #1d3227; color: #fff; }
.btn-sm { padding: 9px 14px; font-size: .88rem; }

/* ==========================================================================
   Top navigation (shell header)
   ========================================================================== */
.epc-nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.epc-nav-inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.epc-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.epc-brand-mark { display: block; flex-shrink: 0; border-radius: 7px; }
/* On the dark auth aside, lift the green tile off the green backdrop. */
.epc-auth-brand .epc-brand-mark { box-shadow: 0 6px 18px -8px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.16); }
.epc-brand-name { font-family: var(--serif); font-size: 1.34rem; color: var(--ink); letter-spacing: -.01em; }
.epc-brand-name .tld { color: var(--accent-600); }

.epc-nav-links { display: flex; gap: 2px; margin-left: 6px; }
.epc-nav-links a {
  padding: 8px 13px; border-radius: var(--pill); font-size: .93rem; font-weight: 500; color: var(--body);
  transition: background .18s, color .18s; white-space: nowrap;
}
.epc-nav-links a:hover { background: var(--accent-tint); color: var(--accent-700); }
.epc-nav-links a.active { background: var(--ink); color: #fff; }

.epc-nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.epc-search {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--pill); padding: 8px 14px; width: 210px; transition: border-color .18s, box-shadow .18s, width .2s;
}
.epc-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); width: 240px; }
.epc-search svg { color: var(--muted); flex-shrink: 0; }
.epc-search input { border: 0; background: transparent; outline: none; font-size: .9rem; width: 100%; color: var(--ink); }
.epc-search input::placeholder { color: var(--muted); }

.epc-icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; color: var(--body);
  transition: background .18s, border-color .18s, color .18s; cursor: pointer;
}
.epc-icon-btn:hover { background: var(--accent-tint); border-color: var(--accent-tint-2); color: var(--accent-700); }
.epc-cart-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; background: var(--accent-600);
  color: #fff; border-radius: var(--pill); font-size: .68rem; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--surface); font-variant-numeric: tabular-nums;
}
.epc-hamburger { display: none; }

/* Theme toggle — show the icon of the mode you'd switch TO (moon in light, sun in dark) */
.epc-theme-toggle svg { transition: transform .2s; }
.epc-theme-toggle:hover svg { transform: rotate(12deg); }
.epc-theme-toggle .epc-ico-sun { display: none; }
:root[data-theme="dark"] .epc-theme-toggle .epc-ico-sun { display: block; }
:root[data-theme="dark"] .epc-theme-toggle .epc-ico-moon { display: none; }

/* Dropdown menus (cart preview, account) */
.epc-menu-wrap { position: relative; }
.epc-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 300; width: 340px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s;
}
.epc-menu-wrap.open .epc-menu, .epc-menu-wrap:focus-within .epc-menu { opacity: 1; visibility: visible; transform: none; }
.epc-menu.epc-menu-sm { width: 220px; }
.epc-menu-head { padding: 12px 14px 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.epc-menu-head h4 { font-size: .95rem; font-weight: 600; }
.epc-menu-head span { font-size: .8rem; color: var(--muted); }
.epc-menu-scroll { max-height: 340px; overflow-y: auto; }
.epc-menu-item { display: block; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .92rem; color: var(--body); font-weight: 500; }
.epc-menu-item:hover { background: var(--accent-tint); color: var(--accent-700); }
.epc-menu-foot { padding: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.epc-menu-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: .88rem; }
/* Cart preview (mini-cart): item rows with in-place quantity + remove controls */
.epc-menu-cart { width: 360px; padding: 6px; }
.epc-cartpop-body { max-height: min(52vh, 400px); overflow-y: auto; }
.epc-cartpop-item { padding: 11px 8px; border-bottom: 1px solid var(--line); }
.epc-cartpop-item:last-child { border-bottom: 0; }
.epc-cartpop-row1 { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 9px; }
.epc-cartpop-name { flex: 1; min-width: 0; font-size: .88rem; font-weight: 500; color: var(--ink); line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.epc-cartpop-x { flex-shrink: 0; border: 0; background: transparent; color: var(--muted); width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; transition: background .16s, color .16s; }
.epc-cartpop-x:hover { background: var(--danger-tint); color: var(--danger); }
.epc-cartpop-row2 { display: flex; align-items: center; gap: 10px; }
.epc-cartpop-store { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.epc-cartpop-price { flex-shrink: 0; margin-left: auto; font-weight: 700; font-size: .9rem; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.epc-counter-sm { flex-shrink: 0; }
.epc-counter-sm .epc-counter-btn { width: 26px; height: 28px; font-size: 1rem; }
.epc-counter-sm .epc-counter-input { width: 34px; height: 28px; font-size: .84rem; }
.epc-cartpop-foot { border-top: 1px solid var(--line); margin-top: 2px; padding: 12px 10px 8px; }
.epc-cartpop-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.epc-cartpop-total span { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.epc-cartpop-total b { font-size: 1.2rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.epc-cartpop-actions { display: flex; gap: 8px; }
.epc-cartpop-actions .btn { flex: 1; padding: 9px 12px; }

/* Global search results dropdown */
#globalSearchResults, .epc-search-results {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 300; width: 360px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 420px; overflow-y: auto; padding: 6px;
}
.epc-search-results a, #globalSearchResults a {
  display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--body);
}
.epc-search-results a:hover, #globalSearchResults a:hover { background: var(--accent-tint); }
.epc-sr-name { font-weight: 500; color: var(--ink); font-size: .9rem; }
.epc-sr-meta { font-size: .78rem; color: var(--muted); }
.epc-sr-price { margin-left: auto; font-weight: 700; color: var(--ink); white-space: nowrap; }

/* ==========================================================================
   Page shell: toolbar / title + content
   ========================================================================== */
.epc-main { min-height: 60vh; }
.epc-toolbar { padding-block: clamp(1.6rem, 4vw, 2.6rem) 0; }
.epc-crumb { font-size: .82rem; color: var(--muted); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.epc-crumb a:hover { color: var(--accent-700); }
.epc-crumb .sep { color: var(--line-strong); }
.epc-page-title { font-family: var(--serif); font-weight: 600; font-size: var(--fs-h2); letter-spacing: -.01em; }
.epc-page-sub { color: var(--muted); font-size: .95rem; margin-top: 6px; }
.epc-content { padding-block: clamp(1.4rem, 3vw, 2rem) clamp(2.4rem, 6vw, 4rem); }

/* ---------- Controls (filters, sort, view switch) ---------- */
.epc-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.epc-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.epc-chip {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--body); border-radius: var(--pill);
  padding: 7px 14px; font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; transition: all .16s;
}
.epc-chip:hover { border-color: var(--accent-tint-2); background: var(--accent-tint); }
.epc-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.epc-select {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--pill);
  padding: 8px 14px; font-size: .85rem; font-weight: 500; font-family: inherit;
}
.epc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.epc-dot-superc { border: 1px solid #e6c700; }

.epc-view-switch { margin-left: auto; display: inline-flex; align-items: center; gap: 9px; }
.epc-view-hint { font-size: .84rem; color: var(--muted); font-weight: 500; }
.epc-vt {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 8px 14px; border-radius: var(--pill); font-size: .85rem; font-weight: 600; color: var(--body); transition: all .16s;
}
.epc-vt:hover { border-color: var(--accent-tint-2); background: var(--accent-tint); color: var(--accent-700); }
.epc-vt.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.epc-vt svg { flex-shrink: 0; }

/* ==========================================================================
   Product cards
   ========================================================================== */
.epc-prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.epc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .18s, box-shadow .18s, transform .18s;
}
.epc-card:hover { border-color: var(--accent-tint-2); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.epc-card-media { position: relative; aspect-ratio: 4/3; display: grid; place-items: center; border-bottom: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
.epc-card-media img { width: 100%; height: 100%; object-fit: contain; padding: 7px; mix-blend-mode: multiply; }
.epc-card-media .epc-glyph { opacity: .5; }
.epc-flag {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
  border-radius: var(--pill); font-size: .7rem; font-weight: 700; letter-spacing: .02em; z-index: 2;
}
.epc-flag-floor { background: var(--accent-700); color: #fff; }
.epc-flag-good { background: var(--accent-tint); color: var(--accent-700); border: 1px solid var(--accent-tint-2); }
.epc-flag-ok { background: #eef1ef; color: #5c6b63; }
.epc-flag-fake { background: var(--danger-tint); color: var(--danger); border: 1px solid #f7d4d4; }
.epc-fav {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.9);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); transition: color .18s, border-color .18s; z-index: 2;
}
.epc-fav:hover { color: var(--accent); border-color: var(--accent-tint-2); }
.epc-fav.on { color: var(--accent-600); border-color: var(--accent-tint-2); }
.epc-card-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.epc-card-brand { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.epc-card-name { font-weight: 600; color: var(--ink); font-size: .96rem; line-height: 1.3; }
.epc-card-size { font-size: .82rem; color: var(--muted); }
.epc-store-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--body); font-weight: 500; margin-top: 2px; }
.epc-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.epc-price-now { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.epc-price-was { font-size: .85rem; color: var(--muted); text-decoration: line-through; }
.epc-price-unit { font-size: .78rem; color: var(--muted); margin-top: 1px; }
.epc-save-pill { margin-left: auto; align-self: center; background: var(--accent-tint); color: var(--accent-700); font-weight: 700; font-size: .78rem; padding: 3px 9px; border-radius: var(--pill); }
.epc-card-foot { margin-top: 12px; display: flex; gap: 8px; }
.epc-card-foot .btn { flex: 1; padding: 9px 12px; font-size: .88rem; }

/* ==========================================================================
   Data table (power-user view)
   ========================================================================== */
.epc-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table.epc-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.epc-table thead th {
  background: var(--surface-2); text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.epc-table thead th.r { text-align: right; }
.epc-table tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
.epc-table tbody tr:last-child td { border-bottom: 0; }
.epc-table tbody tr:hover td { background: var(--surface-2); }
.epc-table .r { text-align: right; }
.epc-t-prod { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.epc-t-thumb { width: 44px; height: 44px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.epc-t-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.epc-t-txt { display: flex; flex-direction: column; gap: 1px; }
.epc-t-name { font-weight: 600; color: var(--ink); line-height: 1.25; }
.epc-t-sub { font-size: .78rem; color: var(--muted); }
.epc-t-now { font-weight: 700; color: var(--ink); font-size: 1rem; }
.epc-t-was { font-size: .78rem; color: var(--muted); text-decoration: line-through; margin-left: 7px; }
.epc-t-store { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; color: var(--body); white-space: nowrap; }
.epc-t-act { display: inline-flex; gap: 7px; justify-content: flex-end; }
.epc-t-icon {
  width: 33px; height: 33px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--body); transition: all .16s;
}
.epc-t-icon:hover { background: var(--accent-tint); color: var(--accent-700); border-color: var(--accent-tint-2); }

/* Verdict badge (shared between card flag + table) */
.epc-verdict { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--pill); font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.epc-verdict-3 { background: var(--accent-700); color: #fff; }
.epc-verdict-2 { background: var(--accent-tint); color: var(--accent-700); border: 1px solid var(--accent-tint-2); }
.epc-verdict-1 { background: #eef1ef; color: #5c6b63; }
.epc-verdict-0 { background: var(--danger-tint); color: var(--danger); border: 1px solid #f7d4d4; }

/* DataTables control overrides (search box, length, paging, info) */
.dataTables_wrapper { margin-top: 4px; }
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length { margin-bottom: 14px; }
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label { font-size: .85rem; color: var(--body); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--pill);
  padding: 8px 14px; font-size: .88rem; font-family: inherit; outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.dataTables_wrapper .dataTables_info { color: var(--muted); font-size: .84rem; padding-top: 14px; }
.dataTables_wrapper .dataTables_paginate { padding-top: 12px; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 7px 13px !important; margin: 0 2px; border-radius: var(--radius-sm) !important; border: 1px solid var(--line) !important;
  background: var(--surface) !important; color: var(--body) !important; font-size: .85rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--ink) !important; color: #fff !important; border-color: var(--ink) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--accent-tint) !important; color: var(--accent-700) !important; border-color: var(--accent-tint-2) !important;
}

/* ---------- Product detail (view) ---------- */
.epc-view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.epc-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.epc-stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.epc-stat-tile .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.epc-stat-tile .v { font-size: 1.2rem; font-weight: 700; color: var(--ink); margin-top: 6px; min-height: 1.4em; }
.epc-stat-note { font-size: .82rem; color: var(--body); margin-top: 8px; line-height: 1.5; }
.epc-stat-low { border-left: 3px solid var(--accent-600); }
.epc-stat-high { border-left: 3px solid var(--danger); }
.epc-chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; }
@media (max-width: 720px) { .epc-stat-grid { grid-template-columns: 1fr; } }

/* ---------- Loading / empty states ---------- */
.epc-spinner { display: inline-block; width: 1.15em; height: 1.15em; border: 2px solid var(--accent-tint-2); border-top-color: var(--accent-600); border-radius: 50%; animation: epc-spin .7s linear infinite; vertical-align: -.15em; }
@keyframes epc-spin { to { transform: rotate(360deg); } }
.epc-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.epc-empty svg { color: var(--line-strong); margin-bottom: 14px; }

/* "Not signed in" gate card */
.epc-signin-card { max-width: 460px; margin: clamp(30px, 8vw, 70px) auto; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: clamp(28px, 5vw, 44px); }
.epc-signin-ico { width: 60px; height: 60px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-700); display: grid; place-items: center; margin: 0 auto 18px; }
.epc-signin-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ==========================================================================
   Category grid
   ========================================================================== */
.epc-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.epc-cat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; transition: border-color .18s, box-shadow .18s, transform .18s; }
.epc-cat-card:hover { border-color: var(--accent-tint-2); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.epc-cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.epc-cat-head h3 { font-size: 1.05rem; font-weight: 600; }
.epc-cat-sub { font-size: .82rem; color: var(--muted); }
.epc-cat-item { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-top: 1px solid var(--line); }
.epc-cat-item:first-of-type { border-top: 0; }
.epc-cat-ico { width: 54px; height: 54px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.epc-cat-ico img { width: 36px; height: auto; }
.epc-cat-name { font-weight: 600; color: var(--ink); font-size: .95rem; flex: 1; }
.epc-cat-count { text-align: right; }
.epc-cat-count .n { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.epc-cat-count .l { font-size: .72rem; color: var(--muted); display: block; }

/* ==========================================================================
   Footer
   ========================================================================== */
.epc-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.epc-foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; padding-block: 46px; }
.epc-foot-about { color: var(--muted); font-size: .9rem; max-width: 30ch; margin-top: 14px; }
.epc-foot h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.epc-foot ul { display: flex; flex-direction: column; gap: 9px; }
.epc-foot a { font-size: .92rem; color: var(--body); }
.epc-foot a:hover { color: var(--accent-700); }
.epc-foot-bottom { border-top: 1px solid var(--line); padding-block: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.epc-foot-legal { padding-bottom: 24px; font-size: .74rem; line-height: 1.6; color: var(--muted); }
.epc-foot-legal p { max-width: 80ch; }
.epc-foot-legal a { color: var(--body); text-decoration: underline; }
.epc-foot-legal a:hover { color: var(--accent-700); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .epc-prod-grid { grid-template-columns: repeat(3, 1fr); }
  .epc-cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .epc-nav-links { display: none; }
  .epc-hamburger { display: grid; }
}
@media (max-width: 720px) {
  .epc-prod-grid { grid-template-columns: repeat(2, 1fr); }
  .epc-search { display: none; }
  .epc-foot-grid { grid-template-columns: 1fr 1fr; }
  .epc-cat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .epc-prod-grid { grid-template-columns: 1fr; }
  .epc-foot-grid { grid-template-columns: 1fr; }
}

/* Mobile nav drawer */
.epc-mobile-menu { display: none; }
.epc-mobile-menu.open { display: block; position: fixed; inset: 68px 0 0; z-index: 190; background: rgba(19,33,26,.4); }
.epc-mobile-panel { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px clamp(1.1rem,4vw,2.25rem) 20px; box-shadow: var(--shadow-md); }
.epc-mobile-panel a { display: block; padding: 12px 6px; font-size: 1rem; font-weight: 500; color: var(--body); border-bottom: 1px solid var(--line); }
.epc-mobile-panel a:last-child { border-bottom: 0; }
.epc-mobile-panel a.active { color: var(--accent-700); }

/* Drawer search — the header search pill is display:none under 720px, so the
   drawer carries its own instance of the same autocomplete. */
.epc-drawer-search { position: relative; padding: 2px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.epc-mobile-panel .epc-search { display: flex; width: 100%; }
.epc-mobile-panel .epc-search:focus-within { width: 100%; }
.epc-drawer-search .epc-search-results { left: 0; right: 0; width: auto; top: calc(100% - 8px); }
/* Undo the drawer's nav-link styling on result rows (it wins on order). */
.epc-drawer-search .epc-search-results a { display: flex; padding: 9px 11px; font-weight: 400; border-bottom: 0; }

/* ---------- DataTables sort indicators (no DataTables CSS loaded) ---------- */
.epc-table thead th.sorting,
.epc-table thead th.sorting_asc,
.epc-table thead th.sorting_desc { cursor: pointer; }
.epc-table thead th.sorting::after { content: " ↕"; color: var(--line-strong); }
.epc-table thead th.sorting_asc::after { content: " ↑"; color: var(--accent-600); }
.epc-table thead th.sorting_desc::after { content: " ↓"; color: var(--accent-600); }

/* ---------- Global search result rows ---------- */
.epc-sr-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.epc-sr-txt .epc-sr-name, .epc-sr-txt .epc-sr-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Toasts ---------- */
#epcToasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.epc-toast {
  pointer-events: auto; background: var(--ink); color: #fff; font-size: .9rem; font-weight: 500; padding: 11px 18px;
  border-radius: var(--pill); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px);
  transition: opacity .22s, transform .22s; max-width: 90vw;
}
.epc-toast.show { opacity: 1; transform: none; }
.epc-toast-success { background: var(--accent-700); }
.epc-toast-error { background: var(--danger); }
.epc-toast-warning { background: var(--amber); }

/* ==========================================================================
   Cart (Panier) — quantity stepper, totals, share, actions
   ========================================================================== */
.epc-t-icon-danger { color: var(--muted); }
.epc-t-icon-danger:hover { background: var(--danger-tint); color: var(--danger); border-color: #f7d4d4; }

.epc-counter { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--pill); background: var(--surface); overflow: hidden; }
.epc-counter-btn { border: 0; background: transparent; width: 30px; height: 32px; font-size: 1.05rem; line-height: 1; color: var(--body); display: grid; place-items: center; transition: background .16s, color .16s; }
.epc-counter-btn:hover { background: var(--accent-tint); color: var(--accent-700); }
.epc-counter-input { border: 0; border-inline: 1px solid var(--line); background: transparent; width: 44px; height: 32px; text-align: center; font-size: .9rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; }
.epc-counter-input::-webkit-outer-spin-button, .epc-counter-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.epc-cart-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; margin-top: 18px; padding-top: 4px; }
.epc-cart-total-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.epc-cart-total-val { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

.epc-cart-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.epc-cart-actions #shareArea { display: inline-flex; align-items: center; }

.epc-share-row { display: inline-flex; align-items: center; gap: 8px; }
.epc-share-input { border: 1px solid var(--line-strong); border-radius: var(--pill); padding: 8px 14px; font-size: .86rem; width: 260px; max-width: 60vw; color: var(--ink); background: var(--surface-2); outline: none; }
.epc-share-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }

/* ==========================================================================
   Compare (Comparer) — toggle, cheapest star, optimal plan panels
   ========================================================================== */
.epc-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 500; color: var(--body); cursor: pointer; }
.epc-toggle-input { width: 16px; height: 16px; accent-color: var(--accent-600); cursor: pointer; }

.epc-cheapest { color: var(--accent-600); font-size: .95em; }

.epc-compare-panel { margin-top: 20px; font-size: .95rem; color: var(--body); }
.epc-compare-panel:empty { margin-top: 0; }
.epc-compare-heading { font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; }
.epc-compare-store { margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.epc-compare-store-head { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.epc-compare-total { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-top: 14px; }
.epc-compare-note { margin-top: 8px; line-height: 1.55; }

/* ==========================================================================
   Form fields (password / settings) — no generic input style existed before
   ========================================================================== */
.epc-card-pad { padding: clamp(1.3rem, 3vw, 2rem); }
.epc-section-head { margin-bottom: 6px; }
.epc-section-title { font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.epc-section-sub { font-size: .9rem; color: var(--muted); margin-top: 4px; }
.epc-section + .epc-section { margin-top: 20px; }

.epc-static-field { margin-bottom: 4px; }
.epc-static-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.epc-static-val { font-size: 1rem; color: var(--ink); font-weight: 500; margin-top: 3px; }

.epc-divider { height: 1px; background: var(--line); border: 0; margin: 22px 0; }

.epc-field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .epc-field-grid { grid-template-columns: 1fr; } }

.epc-field { display: flex; flex-direction: column; gap: 7px; }
.epc-label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.epc-input {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: .92rem; font-family: inherit; outline: none; width: 100%;
  transition: border-color .16s, box-shadow .16s;
}
.epc-input::placeholder { color: var(--muted); }
.epc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.epc-field-hint { font-size: .82rem; color: var(--muted); margin-top: 12px; }

.epc-form-foot { display: flex; justify-content: flex-end; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Notice callout ---------- */
.epc-notice {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px dashed var(--accent-tint-2);
  background: var(--accent-tint); border-radius: var(--radius); color: var(--accent-700); font-size: .9rem; margin-bottom: 22px;
}
.epc-notice svg { flex-shrink: 0; margin-top: 1px; color: var(--accent-600); }

/* ---------- Switch toggle (settings store preferences + follow notify) ---------- */
.epc-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.epc-switch-row:first-child { border-top: 0; }
.epc-switch-label { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; color: var(--ink); font-size: .95rem; }

.epc-switch { position: relative; display: inline-flex; flex-shrink: 0; width: 44px; height: 26px; cursor: pointer; }
.epc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.epc-switch-track {
  position: absolute; inset: 0; border-radius: var(--pill); background: var(--line-strong);
  transition: background .18s; pointer-events: none;
}
.epc-switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s;
}
.epc-switch input:checked + .epc-switch-track { background: var(--accent-600); }
.epc-switch input:checked + .epc-switch-track::after { transform: translateX(18px); }
.epc-switch input:focus-visible + .epc-switch-track { box-shadow: 0 0 0 4px var(--accent-tint); }

.epc-switch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 30px; }
@media (max-width: 600px) { .epc-switch-grid { grid-template-columns: 1fr; } }
/* On the two-column grid, the top row of the second column has no top border sibling. */
.epc-switch-grid .epc-switch-row:nth-child(2) { border-top: 0; }
@media (max-width: 600px) { .epc-switch-grid .epc-switch-row:nth-child(2) { border-top: 1px solid var(--line); } }

/* Compact switch inside the followed-products table cell */
.epc-switch-sm { width: 40px; height: 23px; }
.epc-switch-sm .epc-switch-track::after { width: 17px; height: 17px; }
.epc-switch-sm input:checked + .epc-switch-track::after { transform: translateX(17px); }

/* Inline price-target editor (followed-products table) */
.epc-target-edit { display: inline-flex; align-items: center; gap: 6px; }
.epc-target-input { width: 88px; padding: 7px 10px; font-size: .88rem; }
/* Hide the number spinners so the cell stays compact */
.epc-target-input::-webkit-outer-spin-button,
.epc-target-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.epc-target-input { -moz-appearance: textfield; appearance: textfield; }

/* ==========================================================================
   Scan (barcode scanner) page
   ========================================================================== */
.epc-scan-card { padding: clamp(1.4rem, 3vw, 2.2rem); text-align: center; max-width: 760px; margin-inline: auto; }
.epc-scan-lead { color: var(--body); font-size: 1rem; margin-bottom: 18px; }
.epc-scan-actions { margin-bottom: 20px; }
.epc-scan-actions .btn { min-width: 160px; }
.epc-scan-stage { display: flex; justify-content: center; }
#scanner-container { width: 100%; max-width: 650px; border-radius: var(--radius); overflow: hidden; }
#scanner-container:empty { display: none; }
#scanner-container video, #scanner-container canvas { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
/* Quagga overlays the video with an absolutely-positioned canvas; keep them stacked. */
#scanner-container { position: relative; }
#scanner-container canvas.drawingBuffer { position: absolute; top: 0; left: 0; }

/* ==========================================================================
   FAQ — accordion (native <details>/<summary>)
   ========================================================================== */
.epc-faq-intro { color: var(--body); font-size: 1rem; margin-bottom: 26px; max-width: 70ch; }
.epc-faq-intro a { color: var(--accent-700); font-weight: 600; }
.epc-faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 30px; align-items: start; }
@media (max-width: 820px) { .epc-faq-grid { grid-template-columns: 1fr; } }

.epc-faq {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color .18s, box-shadow .18s;
}
.epc-faq[open] { border-color: var(--accent-tint-2); box-shadow: var(--shadow-md); }
.epc-faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  font-weight: 600; color: var(--ink); font-size: 1rem;
}
.epc-faq summary::-webkit-details-marker { display: none; }
.epc-faq-icon {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent-700); transition: transform .2s;
}
.epc-faq[open] .epc-faq-icon { transform: rotate(45deg); }
.epc-faq-body { padding: 0 18px 18px 52px; color: var(--body); font-size: .95rem; line-height: 1.6; }
.epc-faq-body a { color: var(--accent-700); font-weight: 600; }

.epc-social { display: flex; justify-content: center; gap: 22px; margin-top: 30px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.epc-social a { color: var(--muted); transition: color .18s, transform .18s; }
.epc-social a:hover { color: var(--accent-700); transform: translateY(-2px); }

/* ==========================================================================
   Auth pages (login / register / lostpass / updatepass) — centered card
   ========================================================================== */
.epc-auth { min-height: 100vh; }
.epc-auth-split { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }

/* Left brand panel */
.epc-auth-aside {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(155deg, var(--accent-700) 0%, #163524 52%, #101f16 100%);
  padding: clamp(2rem, 4vw, 3.5rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 34px;
}
.epc-auth-aside::after {
  content: ""; position: absolute; inset: -28% -22% auto auto; width: 460px; height: 460px;
  background: radial-gradient(circle at 60% 40%, rgba(255,255,255,.10), rgba(255,255,255,0) 70%); pointer-events: none;
}
.epc-auth-aside > * { position: relative; z-index: 1; }
.epc-auth-brand .epc-brand-name { font-size: 1.4rem; }
.epc-auth-aside .epc-brand-name, .epc-auth-aside .epc-brand-name .tld { color: #fff; }
.epc-auth-pitch { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 2.5vw, 2.3rem); line-height: 1.14; letter-spacing: -.01em; color: #fff; text-wrap: balance; }
.epc-auth-pitch em { font-style: italic; color: #bfe9cf; }
.epc-auth-pitch-sub { margin-top: 14px; color: rgba(255,255,255,.82); font-size: 1.02rem; max-width: 36ch; line-height: 1.55; }
.epc-auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.epc-auth-points li { display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.92); font-size: .96rem; }
.epc-auth-check-ico { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.15); display: grid; place-items: center; color: #bfe9cf; }
.epc-auth-aside-foot { color: rgba(255,255,255,.55); font-size: .82rem; }

/* Right form panel */
.epc-auth-main {
  display: flex; align-items: center; justify-content: center; padding: clamp(1.5rem, 5vw, 3.5rem);
  background: radial-gradient(65% 50% at 50% 0%, var(--accent-tint) 0%, rgba(238,246,241,0) 70%), var(--bg);
}

@media (max-width: 860px) {
  .epc-auth-split { grid-template-columns: 1fr; }
  .epc-auth-aside { flex-direction: row; align-items: center; gap: 14px; padding: 16px clamp(1.1rem, 5vw, 2rem); }
  .epc-auth-aside-body, .epc-auth-aside-foot { display: none; }
}

.epc-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.6rem, 4vw, 2.4rem);
}

.epc-auth-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -.01em;
  text-align: center;
}
.epc-auth-sub {
  color: var(--muted);
  font-size: .92rem;
  text-align: center;
  margin-top: 6px;
  margin-bottom: 24px;
}

.epc-auth-link { color: var(--accent-700); font-weight: 600; }
.epc-auth-link:hover { color: var(--accent-600); text-decoration: underline; }

.epc-auth-links { display: flex; justify-content: flex-end; font-size: .88rem; }

.epc-auth-check {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 18px;
  font-size: .9rem; color: var(--body); cursor: pointer;
}
.epc-auth-check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent-600); flex-shrink: 0; cursor: pointer; }

.epc-auth-captcha { display: flex; justify-content: center; margin-top: 22px; }

.epc-auth-submit { width: 100%; margin-top: 22px; padding: 13px 22px; font-size: 1rem; }

.epc-auth-foot {
  text-align: center; color: var(--muted); font-size: .9rem;
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
}

/* reCAPTCHA is a fixed 304px-wide iframe; keep the card from overflowing on
   the narrowest phones by scaling the widget down from its top-left origin. */
@media (max-width: 400px) {
  .epc-auth-captcha { overflow: hidden; }
  .epc-auth-captcha .g-recaptcha { transform: scale(.86); transform-origin: 0 0; height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Checklist (Exporter en liste) — standalone printable / mobile grocery list
   ========================================================================== */
.epc-check-page { padding: clamp(1.1rem, 4vw, 2rem) clamp(1.1rem, 4vw, 2.25rem) 4rem; max-width: 820px; margin-inline: auto; }
.epc-check-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.epc-check-back {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--body); border-radius: var(--pill); padding: 8px 15px; font-size: .9rem; font-weight: 600; transition: all .16s;
}
.epc-check-back:hover { background: var(--accent-tint); border-color: var(--accent-tint-2); color: var(--accent-700); }
.epc-check-back svg { flex-shrink: 0; }

.epc-check-title { font-family: var(--serif); font-weight: 600; font-size: var(--fs-h2); letter-spacing: -.01em; }
.epc-check-sub { color: var(--muted); font-size: .95rem; margin-top: 6px; }

.epc-check-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); margin-bottom: 26px;
}
.epc-check-field { display: inline-flex; align-items: center; gap: 10px; font-size: .92rem; font-weight: 600; color: var(--ink); }
.epc-check-select {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--pill);
  padding: 8px 14px; font-size: .9rem; font-weight: 600; font-family: inherit; outline: none;
}
.epc-check-select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.epc-check-grandtotal { display: inline-flex; align-items: baseline; gap: 9px; }
.epc-check-grandtotal .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.epc-check-grandtotal .v { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* A store section = editorial heading + a card of checkable rows */
.epc-check-store { margin-bottom: 26px; }
.epc-check-store-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; padding-inline: 2px; }
.epc-check-store-name { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; }
.epc-check-store-total { font-size: .95rem; font-weight: 600; color: var(--accent-700); font-variant-numeric: tabular-nums; }
.epc-check-store-total .k { color: var(--muted); font-weight: 500; }

.epc-check-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.epc-check-row {
  display: flex; align-items: flex-start; gap: 14px; padding: 15px 18px; border-top: 1px solid var(--line);
  transition: background .14s;
}
.epc-check-row:first-child { border-top: 0; }
.epc-check-row:hover { background: var(--surface-2); }
.epc-check-cb {
  flex-shrink: 0; width: 26px; height: 26px; margin: 2px 0 0; accent-color: var(--accent-600); cursor: pointer;
}
.epc-check-body { flex: 1; min-width: 0; cursor: pointer; user-select: none; }
.epc-check-name { font-weight: 600; color: var(--ink); font-size: 1.02rem; line-height: 1.35; }
.epc-check-meta { font-size: .9rem; color: var(--muted); margin-top: 3px; }
.epc-check-price { font-weight: 700; color: var(--ink); }
.epc-check-brand { color: var(--muted); }
/* Struck-through when checked off (JS toggles this class on the row) */
.epc-check-row.is-done { opacity: .55; }
.epc-check-row.is-done .epc-check-name,
.epc-check-row.is-done .epc-check-meta { text-decoration: line-through; }

.epc-check-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.epc-check-unavail .epc-check-store-name { color: var(--muted); }

/* ---------- Print ---------- */
@media print {
  :root { --shadow-sm: none; --shadow-md: none; --shadow-lg: none; }
  .epc-check-back, .epc-check-controls .epc-check-field { display: none !important; }
  .epc-check-page { padding: 0; max-width: none; }
  .epc-check-controls { border: 0; box-shadow: none; padding: 0 0 12px; justify-content: flex-end; }
  .epc-check-list { box-shadow: none; break-inside: auto; }
  .epc-check-store { break-inside: avoid; }
  .epc-check-row { break-inside: avoid; }
  body { background: #fff; }
}

/* ==========================================================================
   Dark theme
   Activated by data-theme="dark" on <html> (set before paint by
   inc/theme_head.php from the saved choice or the OS preference).
   Scoped to @media screen so print always falls back to the light palette
   above — dark ink on white paper stays legible.
   ========================================================================== */
@media screen {
  :root[data-theme="dark"] {
    --bg: #0f1512;
    --surface: #161e19;
    --surface-2: #1c2621;
    --ink: #eaf0ec;
    --body: #b0bdb5;
    --muted: #7c8b83;
    --line: #26302a;
    --line-strong: #33403a;

    --accent: #45a877;        /* vivid — dots, focus rings, spinner, switches */
    --accent-600: #2f8f5f;    /* primary button fill (keeps white text legible) */
    --accent-700: #8ad2ac;    /* accent TEXT on dark surfaces / tints (inverted lightness) */
    --accent-tint: #17271e;   /* dark green tint background */
    --accent-tint-2: #2a4d38; /* tint border / hover fill */

    --danger: #f2777f;
    --danger-tint: #2b1618;
    --amber: #d69a54;

    /* On a dark canvas, big soft light-shadows read as glow — deepen instead. */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 10px 28px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 50px -22px rgba(0,0,0,.7);

    /* Inverted "selected / dark pill" surface — a light chip that pops on dark. */
    --invert-surface: #e9efeb;
    --on-invert: #12201a;
  }

  /* Translucent sticky header over the dark canvas */
  :root[data-theme="dark"] .epc-nav { background: rgba(18,26,22,.82); }

  /* Components that used --ink as a *background* (its light-mode double-duty):
     repaint them with the inverted-surface token so selected states stay visible. */
  :root[data-theme="dark"] .epc-nav-links a.active,
  :root[data-theme="dark"] .epc-chip.on,
  :root[data-theme="dark"] .epc-vt.on {
    background: var(--invert-surface); color: var(--on-invert); border-color: var(--invert-surface);
  }
  :root[data-theme="dark"] .btn-dark { background: var(--invert-surface); color: var(--on-invert); }
  :root[data-theme="dark"] .btn-dark:hover { background: #ffffff; color: var(--on-invert); }
  :root[data-theme="dark"] .epc-toast { background: var(--invert-surface); color: var(--on-invert); }
  :root[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
  :root[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--invert-surface) !important; color: var(--on-invert) !important; border-color: var(--invert-surface) !important;
  }

  /* --accent-700 flips light in dark mode, so the few spots that used it as a
     *fill* behind white text need a mid-green fill instead. */
  :root[data-theme="dark"] .btn:hover { background: #34996a; }
  :root[data-theme="dark"] .epc-flag-floor,
  :root[data-theme="dark"] .epc-verdict-3 { background: var(--accent-600); color: #fff; }

  /* Neutral "ordinary / fake deal" badges carried literal light values */
  :root[data-theme="dark"] .epc-flag-ok,
  :root[data-theme="dark"] .epc-verdict-1 { background: #232d27; color: #9aa89f; }
  :root[data-theme="dark"] .epc-flag-fake,
  :root[data-theme="dark"] .epc-verdict-0 { border-color: #4a2327; }

  /* Product photos are shot on white — keep their tiles light so they read on
     dark cards (the multiply blend still drops the white box cleanly). */
  :root[data-theme="dark"] .epc-card-media,
  :root[data-theme="dark"] .epc-t-thumb,
  :root[data-theme="dark"] .epc-cat-ico { background: #eef1ee; }

  /* Favourite bubble floats over the (light) media tile */
  :root[data-theme="dark"] .epc-fav { background: rgba(20,28,24,.72); border-color: rgba(255,255,255,.14); }

  /* Auth brand panel keeps a fixed dark-green gradient (its start used --accent-700) */
  :root[data-theme="dark"] .epc-auth-aside { background: linear-gradient(155deg, #1c5f3d 0%, #133a24 52%, #0d1f14 100%); }

  /* Landing page (index.php) — same dual-use-token fixes: --accent-700 as a fill
     behind white/on-white text, and the CTA gradient's light-green start. */
  :root[data-theme="dark"] .epc-hv-save { background: var(--accent-600); }
  :root[data-theme="dark"] .epc-lp-cta { background: linear-gradient(155deg, #1c5f3d 0%, #133a24 54%, #0b1810 100%); }
  :root[data-theme="dark"] .epc-lp-cta .btn-light { color: #1c5f3d; }
  :root[data-theme="dark"] .epc-lp-cta .btn-light:hover { background: #dfeee6; color: #1c5f3d; }
  :root[data-theme="dark"] .epc-hero::before {
    background:
      radial-gradient(56% 60% at 74% 6%, var(--accent-tint) 0%, rgba(15,21,18,0) 62%),
      radial-gradient(44% 46% at 10% 0%, #14231b 0%, rgba(20,35,27,0) 64%);
  }
}

/* ==========================================================================
   Landing page (accueil) — index.php
   Marketing home: hero + live comparison visual, store strip, stats, feature
   grid, "comment ça marche", deal-verdict spotlight, closing CTA band.
   Reuses the shared tokens, buttons and .epc-verdict badges.
   ========================================================================== */

/* ---------- Generic section scaffolding ---------- */
.epc-lp-section { padding-block: clamp(2.6rem, 6vw, 5rem); }
.epc-lp-head { max-width: 62ch; }
.epc-lp-head.is-center { margin-inline: auto; text-align: center; }
.epc-lp-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.55rem, 3.2vw, 2.15rem); letter-spacing: -.01em; }
.epc-lp-sub { color: var(--body); font-size: 1.02rem; margin-top: 11px; line-height: 1.6; }

/* ---------- Hero ---------- */
.epc-hero { position: relative; overflow: hidden; }
.epc-hero::before {
  content: ""; position: absolute; inset: -45% -12% auto; height: 720px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(56% 60% at 74% 6%, var(--accent-tint) 0%, rgba(238,246,241,0) 62%),
    radial-gradient(44% 46% at 10% 0%, #e9f3ee 0%, rgba(233,243,238,0) 64%);
}
.epc-hero-inner {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center; padding-block: clamp(2.4rem, 6vw, 4.6rem) clamp(2.2rem, 5vw, 4rem);
}
.epc-hero-copy { max-width: 35rem; }
.epc-hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--pill); padding: 6px 14px 6px 8px; font-size: .82rem; font-weight: 600; color: var(--body); box-shadow: var(--shadow-sm);
}
.epc-hero-badge .epc-hero-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-600); box-shadow: 0 0 0 4px var(--accent-tint); }
.epc-hero-title {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; line-height: 1.05;
  font-size: clamp(2.15rem, 5.2vw, 3.5rem); margin-top: 18px; color: var(--ink);
}
.epc-hero-title em { font-style: italic; color: var(--accent-600); }
.epc-hero-lead { margin-top: 18px; font-size: clamp(1.02rem, 1.4vw, 1.16rem); color: var(--body); line-height: 1.6; max-width: 42ch; }
.epc-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.epc-hero-cta .btn { padding: 13px 24px; font-size: 1rem; }
.epc-hero-trust { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: .88rem; color: var(--muted); font-weight: 500; }
.epc-hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.epc-hero-trust svg { color: var(--accent-600); flex-shrink: 0; }

/* Hero live-comparison card */
.epc-hero-visual { position: relative; }
.epc-hv-card {
  position: relative; z-index: 2; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 20px; max-width: 420px; margin-inline: auto;
}
.epc-hv-head { display: flex; align-items: center; gap: 13px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.epc-hv-thumb { width: 54px; height: 54px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.epc-hv-thumb img { width: 38px; height: auto; mix-blend-mode: multiply; }
.epc-hv-name { font-weight: 700; color: var(--ink); font-size: 1.04rem; line-height: 1.25; }
.epc-hv-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.epc-hv-rows { display: flex; flex-direction: column; gap: 6px; padding: 13px 0 4px; }
.epc-hv-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.epc-hv-row.is-best { background: var(--accent-tint); border-color: var(--accent-tint-2); }
.epc-hv-store { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); font-size: .92rem; }
.epc-hv-price { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.epc-hv-verdict { font-size: .66rem; padding: 3px 8px; }
.epc-hv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.epc-hv-save { background: var(--accent-700); color: #fff; font-weight: 700; font-size: .82rem; padding: 6px 12px; border-radius: var(--pill); }
.epc-hv-foot-note { font-size: .78rem; color: var(--muted); }

.epc-hv-float {
  position: absolute; z-index: 3; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md);
  border-radius: var(--pill); padding: 8px 13px; font-size: .8rem; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.epc-hv-float svg { color: var(--accent-600); flex-shrink: 0; }
.epc-hv-float-1 { top: -16px; right: -6px; animation: epc-float 5.5s ease-in-out infinite; }
.epc-hv-float-2 { bottom: -18px; left: -4px; animation: epc-float 5.5s ease-in-out infinite .9s; }
@keyframes epc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (max-width: 940px) {
  .epc-hero-inner { grid-template-columns: 1fr; gap: clamp(2.4rem, 7vw, 3.4rem); text-align: center; }
  .epc-hero-copy { max-width: 42rem; margin-inline: auto; }
  .epc-hero-lead { margin-inline: auto; }
  .epc-hero-cta, .epc-hero-trust { justify-content: center; }
}
@media (max-width: 480px) {
  .epc-hv-float { display: none; }
}

/* ---------- Store strip ---------- */
.epc-lp-stores { border-block: 1px solid var(--line); background: var(--surface); }
.epc-lp-stores-inner { display: flex; align-items: center; justify-content: center; gap: 14px 30px; flex-wrap: wrap; padding-block: 22px; }
.epc-lp-stores-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.epc-lp-store { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); font-size: 1rem; }
.epc-lp-store .epc-dot { width: 11px; height: 11px; }

/* ---------- Stats band ---------- */
.epc-lp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.epc-lp-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.epc-lp-stat .v { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 600; color: var(--ink); line-height: 1; letter-spacing: -.01em; }
.epc-lp-stat .k { margin-top: 9px; font-size: .9rem; color: var(--body); line-height: 1.4; }
@media (max-width: 820px) { .epc-lp-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Feature grid ---------- */
.epc-lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 940px) { .epc-lp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .epc-lp-grid { grid-template-columns: 1fr; } }
.epc-lp-feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: border-color .18s, box-shadow .18s, transform .18s; }
.epc-lp-feature:hover { border-color: var(--accent-tint-2); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.epc-lp-feature-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-tint); color: var(--accent-700); display: grid; place-items: center; margin-bottom: 16px; }
.epc-lp-feature h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 7px; color: var(--ink); }
.epc-lp-feature p { color: var(--body); font-size: .94rem; line-height: 1.55; }

/* ---------- Comment ça marche (3 steps) ---------- */
.epc-lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 760px) { .epc-lp-steps { grid-template-columns: 1fr; } }
.epc-lp-step { position: relative; padding: 26px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.epc-lp-step-n { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-600); color: #fff; font-weight: 700; display: grid; place-items: center; font-family: var(--serif); font-size: 1.1rem; margin-bottom: 15px; }
.epc-lp-step h3 { font-size: 1.06rem; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.epc-lp-step p { color: var(--body); font-size: .94rem; line-height: 1.55; }

/* ---------- Deal-verdict spotlight ---------- */
.epc-lp-verdict-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(1.6rem, 4vw, 2.6rem); }
.epc-lp-verdict-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 24px; }
@media (max-width: 720px) { .epc-lp-verdict-list { grid-template-columns: 1fr; } }
.epc-lp-verdict-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.epc-lp-verdict-item .epc-verdict { flex-shrink: 0; white-space: nowrap; }
.epc-lp-verdict-item p { font-size: .92rem; color: var(--body); line-height: 1.5; }

/* ---------- Closing CTA band ---------- */
.epc-lp-cta { position: relative; overflow: hidden; color: #fff; background: linear-gradient(155deg, var(--accent-700) 0%, #163524 54%, #101f16 100%); margin-top: clamp(1rem, 3vw, 2rem); }
.epc-lp-cta::after { content: ""; position: absolute; inset: -30% -12% auto auto; width: 520px; height: 520px; background: radial-gradient(circle at 60% 40%, rgba(255,255,255,.10), rgba(255,255,255,0) 70%); pointer-events: none; }
.epc-lp-cta-inner { position: relative; z-index: 1; text-align: center; padding-block: clamp(2.8rem, 7vw, 5rem); max-width: 42rem; margin-inline: auto; }
.epc-lp-cta-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.1; letter-spacing: -.01em; color: #fff; }
.epc-lp-cta-title em { font-style: italic; color: #bfe9cf; }
.epc-lp-cta-sub { margin-top: 14px; color: rgba(255,255,255,.82); font-size: 1.05rem; line-height: 1.6; }
.epc-lp-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.epc-lp-cta .btn-light { background: #fff; color: var(--accent-700); box-shadow: 0 8px 20px -8px rgba(0,0,0,.35); }
.epc-lp-cta .btn-light:hover { background: #eef6f1; color: var(--accent-700); }
.epc-lp-cta .btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.42); box-shadow: none; }
.epc-lp-cta .btn-outline:hover { background: rgba(255,255,255,.12); color: #fff; }
