/* ===== Design tokens ===== */
:root {
  --radius: 0.875rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);

  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;

  --background: oklch(0.995 0.003 150);
  --foreground: oklch(0.22 0.02 155);
  --surface: oklch(0.975 0.008 155);

  --card: oklch(1 0 0);
  --card-foreground: oklch(0.22 0.02 155);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.22 0.02 155);

  --primary: oklch(0.52 0.13 155);
  --primary-foreground: oklch(0.99 0.005 150);
  --primary-glow: oklch(0.72 0.14 155);

  --secondary: oklch(0.96 0.015 155);
  --secondary-foreground: oklch(0.28 0.04 155);

  --muted: oklch(0.965 0.008 155);
  --muted-foreground: oklch(0.5 0.02 155);

  --accent: oklch(0.78 0.15 65);
  --accent-foreground: oklch(0.22 0.03 60);

  --destructive: oklch(0.6 0.22 27);
  --destructive-foreground: oklch(0.99 0.005 150);

  --success: oklch(0.62 0.16 155);
  --success-foreground: oklch(0.99 0.005 150);

  --warning: oklch(0.78 0.15 65);
  --warning-foreground: oklch(0.22 0.03 60);

  --info: oklch(0.62 0.11 230);
  --info-foreground: oklch(0.99 0.005 150);

  --border: oklch(0.92 0.01 155);
  --input: oklch(0.92 0.01 155);
  --ring: oklch(0.52 0.13 155);

  --sidebar: oklch(0.22 0.03 155);
  --sidebar-foreground: oklch(0.95 0.01 155);
  --sidebar-primary: oklch(0.72 0.14 155);
  --sidebar-primary-foreground: oklch(0.15 0.02 155);
  --sidebar-accent: oklch(0.28 0.03 155);
  --sidebar-accent-foreground: oklch(0.95 0.01 155);
  --sidebar-border: oklch(0.3 0.02 155);

  --gradient-hero: linear-gradient(135deg, oklch(0.96 0.04 155) 0%, oklch(0.98 0.02 90) 100%);
  --gradient-primary: linear-gradient(135deg, oklch(0.52 0.13 155) 0%, oklch(0.62 0.14 165) 100%);
  --gradient-accent: linear-gradient(135deg, oklch(0.78 0.15 65) 0%, oklch(0.72 0.16 45) 100%);

  --shadow-soft: 0 1px 2px oklch(0.22 0.02 155 / 0.04), 0 2px 8px oklch(0.22 0.02 155 / 0.04);
  --shadow-card: 0 2px 4px oklch(0.22 0.02 155 / 0.03), 0 8px 24px oklch(0.22 0.02 155 / 0.06);
  --shadow-elevated: 0 12px 32px oklch(0.22 0.02 155 / 0.12);
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
* { border-color: var(--border); }
html { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
img, svg { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; flex-shrink: 0; }
[hidden] { display: none !important; }
input, textarea, select, button { font: inherit; color: inherit; }

.container { max-width: 80rem; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; }
.grow { flex: 1 1 auto; }
.text-center { text-align: center; }
.text-muted { color: var(--muted-foreground); }
.font-display { font-family: var(--font-display); }
.hidden { display: none !important; }
.min-h-screen { min-height: 100vh; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.bg-gradient-hero { background-image: var(--gradient-hero); }
.bg-gradient-primary { background-image: var(--gradient-primary); }
.bg-gradient-accent { background-image: var(--gradient-accent); }
.shadow-soft { box-shadow: var(--shadow-soft); }
.shadow-card { box-shadow: var(--shadow-card); }
.shadow-elevated { box-shadow: var(--shadow-elevated); }

/* ===== Layout shell ===== */
.page-shell { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 1 auto; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: 4rem;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border);
  background-color: color-mix(in oklch, var(--background) 85%, transparent);
  backdrop-filter: blur(8px);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.125rem; font-family: var(--font-display); }
.brand-mark {
  width: 2.25rem; height: 2.25rem; border-radius: var(--radius-xl);
  background-image: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.nav-desktop { display: none; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.5rem 0.75rem; border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 500;
  color: color-mix(in oklch, var(--foreground) 70%, transparent);
  transition: background-color .15s, color .15s;
  white-space: nowrap;
}
.nav-link:hover { background-color: var(--secondary); }
.nav-link.active { background-color: color-mix(in oklch, var(--primary) 10%, transparent); color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.lang-switcher { position: relative; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 0.4rem);
  background: var(--popover); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated); padding: 0.35rem; min-width: 10rem; z-index: 50;
}
.lang-menu[hidden] { display: none; }
.lang-option {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.6rem;
  border-radius: var(--radius-md); font-size: 0.875rem; text-align: left; background: none; border: none; cursor: pointer;
}
.lang-option:hover { background-color: var(--secondary); }
.lang-option.active { background-color: color-mix(in oklch, var(--primary) 10%, transparent); color: var(--primary); }
.menu-toggle { display: inline-flex; }
.mobile-menu { display: none; border-top: 1px solid var(--border); background-color: var(--card); padding: 0.75rem 1.25rem 1rem; }
.mobile-menu.open { display: block; }
.mobile-menu .nav-link { display: block; }
.mobile-register {
  display: block; margin-top: 0.75rem; text-align: center; border-radius: var(--radius-md);
  background-color: var(--accent); color: var(--accent-foreground); font-weight: 600; padding: 0.65rem;
}

@media (min-width: 1024px) {
  .nav-desktop { display: flex; }
  .menu-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; transition: background-color .15s, box-shadow .15s, filter .15s, transform .15s;
  height: 2.5rem; padding: 0 1rem; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.btn-default { background-color: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-soft); }
.btn-default:hover:not(:disabled) { background-color: color-mix(in oklch, var(--primary) 90%, transparent); }
.btn-outline { background-color: var(--background); border-color: var(--input); box-shadow: var(--shadow-soft); }
.btn-outline:hover:not(:disabled) { background-color: var(--secondary); }
.btn-outline-soft { background-color: color-mix(in oklch, var(--primary) 5%, transparent); border-color: color-mix(in oklch, var(--primary) 25%, transparent); color: var(--primary); }
.btn-outline-soft:hover:not(:disabled) { background-color: color-mix(in oklch, var(--primary) 10%, transparent); }
.btn-secondary { background-color: var(--secondary); color: var(--secondary-foreground); }
.btn-ghost { background-color: transparent; }
.btn-ghost:hover:not(:disabled) { background-color: var(--secondary); }
.btn-hero { background-image: var(--gradient-primary); color: var(--primary-foreground); box-shadow: var(--shadow-card); }
.btn-hero:hover:not(:disabled) { box-shadow: var(--shadow-elevated); filter: brightness(1.05); }
.btn-cta { background-color: var(--accent); color: var(--accent-foreground); box-shadow: var(--shadow-card); font-weight: 600; }
.btn-cta:hover:not(:disabled) { filter: brightness(1.05); }
.btn-destructive { background-color: var(--destructive); color: var(--destructive-foreground); }
.btn-sm { height: 2rem; padding: 0 0.75rem; font-size: 0.8rem; }
.btn-lg { height: 2.75rem; border-radius: var(--radius-lg); padding: 0 1.5rem; }
.btn-xl { height: 3.5rem; border-radius: var(--radius-xl); padding: 0 2rem; font-size: 1rem; }
.btn-icon { height: 2.5rem; width: 2.5rem; padding: 0; }
.btn-icon.btn-sm { height: 2rem; width: 2rem; }
.btn-full { width: 100%; }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.85rem; font-weight: 500; }
.input, .select, .textarea {
  height: 2.5rem; width: 100%; border-radius: var(--radius-md); border: 1px solid var(--input);
  background-color: var(--background); padding: 0 0.75rem; font-size: 0.9rem; box-shadow: var(--shadow-soft);
}
.textarea { height: auto; padding: 0.6rem 0.75rem; resize: vertical; min-height: 5rem; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--ring); outline-offset: 1px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23516b5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; padding-right: 2rem; }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.85rem; }
.checkbox-row input { margin-top: 0.2rem; }
.search-input-wrap { position: relative; flex: 1 1 auto; }
.search-input-wrap svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--muted-foreground); }
.search-input-wrap .input { padding-left: 2.25rem; }

/* ===== Card ===== */
.card { border-radius: var(--radius-xl); border: 1px solid var(--border); background-color: var(--card); box-shadow: var(--shadow-soft); }
.card-pad { padding: 1.5rem; }
.card-title { font-weight: 600; font-size: 1.05rem; }
.card-desc { font-size: 0.875rem; color: var(--muted-foreground); }

/* ===== Badges / pills ===== */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; border-radius: 999px; border: 1px solid transparent;
  padding: 0.15rem 0.65rem; font-size: 0.75rem; font-weight: 500; white-space: nowrap;
}
.badge svg { width: 0.8rem; height: 0.8rem; }
.badge-plain { background-color: var(--surface); color: color-mix(in oklch, var(--foreground) 80%, transparent); border-color: var(--border); }
.badge-secondary { background-color: var(--secondary); color: var(--secondary-foreground); }
.badge-product-medicine { background-color: color-mix(in oklch, var(--primary) 10%, transparent); color: var(--primary); border-color: color-mix(in oklch, var(--primary) 20%, transparent); }
.badge-product-equipment { background-color: color-mix(in oklch, var(--info) 10%, transparent); color: var(--info); border-color: color-mix(in oklch, var(--info) 25%, transparent); }
.badge-verified, .badge-open { background-color: color-mix(in oklch, var(--success) 12%, transparent); color: var(--success); border-color: color-mix(in oklch, var(--success) 25%, transparent); }
.badge-pending { background-color: color-mix(in oklch, var(--warning) 15%, transparent); color: color-mix(in oklch, var(--warning-foreground) 100%, transparent); border-color: color-mix(in oklch, var(--warning) 30%, transparent); }
.badge-closed, .badge-inactive { background-color: var(--muted); color: var(--muted-foreground); border-color: var(--border); }

/* ===== Empty state ===== */
.empty-state {
  text-align: center; padding: 3rem 1.5rem; border-radius: var(--radius-2xl);
  border: 1px dashed var(--border); background-color: color-mix(in oklch, var(--surface) 60%, transparent);
}
.empty-state-icon {
  width: 3.5rem; height: 3.5rem; border-radius: var(--radius-2xl); margin: 0 auto 1rem;
  background-color: color-mix(in oklch, var(--primary) 10%, transparent); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.empty-state-icon svg { width: 1.75rem; height: 1.75rem; }
.empty-state h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.empty-state p { color: var(--muted-foreground); font-size: 0.9rem; margin-bottom: 1.25rem; }

/* ===== Grids ===== */
.grid-cards { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid-cards.grid-cards-4 { grid-template-columns: repeat(4, 1fr); } }

/* ===== Product card ===== */
.product-card {
  display: block; border-radius: var(--radius-2xl); border: 1px solid var(--border); background-color: var(--card);
  padding: 1rem; box-shadow: var(--shadow-soft); transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.product-card-media {
  width: 4.5rem; height: 4.5rem; border-radius: var(--radius-xl); background-image: var(--gradient-hero);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 0.75rem; overflow: hidden;
}
.product-card-media img { width: 100%; height: 100%; object-fit: cover; }
.product-card h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.product-card:hover h3 { color: var(--primary); }
.product-card .dosage { font-size: 0.8rem; color: var(--muted-foreground); margin-bottom: 0.6rem; }
.product-price-label { font-size: 0.65rem; text-transform: uppercase; color: var(--muted-foreground); letter-spacing: 0.03em; }
.product-price { font-weight: 700; font-family: var(--font-display); font-size: 1.1rem; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; margin: 0.75rem 0; }
.pill-count { display: inline-flex; align-items: center; gap: 0.3rem; background-color: var(--secondary); border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.75rem; }
.pill-count svg { width: 0.85rem; height: 0.85rem; }

/* ===== Pharmacy card ===== */
.pharmacy-card { border-radius: var(--radius-2xl); border: 1px solid var(--border); background-color: var(--card); padding: 1.25rem; box-shadow: var(--shadow-soft); transition: box-shadow .15s; }
.pharmacy-card:hover { box-shadow: var(--shadow-card); }
.pharmacy-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.pharmacy-card h3 { font-size: 1.05rem; }
.pharmacy-avatar {
  width: 3rem; height: 3rem; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: #fff;
  background-image: var(--gradient-primary);
}
.pharmacy-avatar.cat-veterinaire { background-image: none; background-color: var(--info); }
.pharmacy-avatar.cat-gros { background-image: var(--gradient-accent); }
.pharmacy-avatar.lg { width: 4rem; height: 4rem; font-size: 1.2rem; }
.pharmacy-card .address { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted-foreground); margin: 0.5rem 0 0.75rem; }
.pharmacy-card .address svg { width: 0.9rem; height: 0.9rem; flex-shrink: 0; }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.pharmacy-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 0.85rem; }
.tel-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.tel-link svg { width: 0.9rem; height: 0.9rem; }

/* ===== Filter bar ===== */
.filter-bar { position: sticky; top: 4rem; z-index: 20; background-color: color-mix(in oklch, var(--background) 92%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1rem; margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.filter-bar > * { min-width: 0; }
.filter-bar .search-input-wrap { flex: 1 1 14rem; }
.filter-bar .select { width: auto; min-width: 9rem; }

/* ===== Catalog with sidebar filters ===== */
.catalog-layout { display: grid; grid-template-columns: 1fr; gap: 1.75rem; }
@media (min-width: 1024px) { .catalog-layout { grid-template-columns: 1fr 17rem; align-items: start; } }
.catalog-sidebar { order: 2; }
@media (min-width: 1024px) { .catalog-sidebar { position: sticky; top: 5.5rem; } }
.filters-card { border-radius: var(--radius-xl); border: 1px solid var(--border); background-color: var(--card); padding: 1.25rem; }
.filters-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.filters-card-head h3 { font-size: 0.95rem; }
.filter-group { padding: 0.9rem 0; }
.filter-group + .filter-group { border-top: 1px solid var(--border); }
.filter-group h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); margin-bottom: 0.6rem; }
.filter-check-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; padding: 0.3rem 0; cursor: pointer; }
.filter-check-row input { flex-shrink: 0; }
.filter-check-row span.label { flex: 1 1 auto; }
.filter-check-row span.count { color: var(--muted-foreground); font-size: 0.75rem; }

/* ===== Hero ===== */
.hero { padding: 3rem 0 4rem; background-image: var(--gradient-hero); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; } }
.hero-badge { display: inline-flex; align-items: center; gap: 0.4rem; background-color: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.8rem; font-weight: 500; margin-bottom: 1.25rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.05rem; color: var(--muted-foreground); max-width: 34rem; margin-bottom: 1.75rem; }
.hero-search { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.hero-search .search-input-wrap { flex: 1 1 auto; }
.hero-search .input { height: 3rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.25rem; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; max-width: 32rem; }
.hero-stat { background-color: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.9rem 0.6rem; text-align: center; }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--primary); }
.hero-stat span { font-size: 0.72rem; color: var(--muted-foreground); }
.hero-panel { position: relative; border-radius: var(--radius-3xl); background-color: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-elevated); padding: 1.5rem; }
.hero-panel-title { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; margin-bottom: 1rem; }
.hero-sample-row { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.hero-sample-row:last-of-type { border-bottom: none; }
.hero-panel-delivery { margin-top: 1rem; border-radius: var(--radius-lg); background-image: var(--gradient-primary); color: #fff; padding: 0.9rem 1rem; display: flex; align-items: center; gap: 0.75rem; }

/* ===== Sections ===== */
.section { padding: 3.5rem 0; }
.section-head { text-align: center; max-width: 36rem; margin: 0 auto 2.25rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.6rem; }
.section-head p { color: var(--muted-foreground); }

.steps-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 768px) { .steps-grid { grid-template-columns: repeat(4, 1fr); } }
.step-card { text-align: center; padding: 1.5rem 1.25rem; border-radius: var(--radius-2xl); border: 1px solid var(--border); background-color: var(--card); }
.step-icon { width: 3rem; height: 3rem; margin: 0 auto 1rem; border-radius: var(--radius-xl); background-image: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.step-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); margin-bottom: 0.35rem; }
.step-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.step-card p { font-size: 0.85rem; color: var(--muted-foreground); }

.cta-banner { border-radius: var(--radius-3xl); background-image: var(--gradient-primary); color: #fff; padding: 2.5rem; text-align: center; }
.cta-banner h2 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.cta-banner p { max-width: 34rem; margin: 0 auto 1.5rem; opacity: 0.9; }

/* ===== Footer ===== */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--border); background-color: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; padding: 3rem 0 2rem; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-grid h4 { font-size: 0.85rem; margin-bottom: 0.9rem; }
.footer-grid ul li { margin-bottom: 0.6rem; }
.footer-grid a:hover { color: var(--primary); }
.footer-desc { color: var(--muted-foreground); font-size: 0.85rem; max-width: 18rem; margin-top: 0.75rem; }
.footer-contact-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 0.6rem; }
.footer-contact-item svg { width: 0.9rem; height: 0.9rem; color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1rem 0; display: flex; flex-direction: column; gap: 0.4rem; align-items: center; font-size: 0.75rem; color: var(--muted-foreground); }
@media (min-width: 640px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }

/* ===== Chat widget ===== */
.chat-toggle {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50;
  border-radius: 999px; background-image: var(--gradient-primary); color: #fff; border: none;
  padding: 0.85rem 1.25rem; display: flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-elevated); transition: transform .15s;
}
.chat-toggle:hover { transform: scale(1.05); }
.chat-toggle span:not([data-icon]) { display: none; }
@media (min-width: 640px) { .chat-toggle span:not([data-icon]) { display: inline; } }
.chat-panel {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50; width: min(24rem, calc(100vw - 2.5rem)); height: 520px;
  border-radius: var(--radius-2xl); border: 1px solid var(--border); background-color: var(--card); box-shadow: var(--shadow-elevated);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-header { background-image: var(--gradient-primary); color: #fff; padding: 0.9rem 1rem; display: flex; align-items: center; gap: 0.7rem; }
.chat-avatar { width: 2.25rem; height: 2.25rem; border-radius: 999px; background-color: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-header-text { flex: 1 1 auto; }
.chat-header-text strong { display: block; font-size: 0.9rem; }
.chat-header-text span { font-size: 0.75rem; opacity: 0.85; }
.chat-close { background: none; border: none; color: #fff; cursor: pointer; padding: 0.25rem; }
.chat-messages { flex: 1 1 auto; overflow-y: auto; padding: 1rem; background-color: color-mix(in oklch, var(--surface) 60%, transparent); display: flex; flex-direction: column; gap: 0.6rem; }
.chat-bubble { max-width: 90%; padding: 0.55rem 0.85rem; border-radius: var(--radius-xl); font-size: 0.85rem; }
.chat-bubble.bot { align-self: flex-start; background-color: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 0.3rem; }
.chat-bubble.user { align-self: flex-end; background-color: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 0.3rem; }
.chat-links, .chat-options { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chat-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border); }
.chat-form input { flex: 1 1 auto; border-radius: 999px; }
.chat-form button { border-radius: 999px; flex-shrink: 0; }

/* ===== Pharmacy map ===== */
.map-wrap { position: relative; border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--border); background-color: var(--surface); height: 420px; z-index: 0; }
.map-wrap .leaflet-map-inner { position: absolute; inset: 0; z-index: 0; font-family: var(--font-sans); }
.map-wrap.interactive .leaflet-container { cursor: crosshair; }
.map-legend { position: absolute; left: 0.75rem; bottom: 0.75rem; z-index: 500; background-color: color-mix(in oklch, var(--card) 92%, transparent); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.5rem 0.7rem; font-size: 0.7rem; display: flex; flex-direction: column; gap: 0.3rem; }
.map-legend-item { display: flex; align-items: center; gap: 0.4rem; }
.map-legend-dot { width: 0.55rem; height: 0.55rem; border-radius: 999px; flex-shrink: 0; }
.map-pin-icon { background: none; border: none; }
.leaflet-tooltip { font-size: 0.75rem; font-family: var(--font-sans); }
.gps-marker-tooltip { background-color: var(--info); color: #fff; border: none; font-weight: 600; padding: 0.25rem 0.6rem; }
.gps-marker-tooltip::before { border-top-color: var(--info); }

/* ===== Tabs ===== */
.tabs-nav { display: flex; gap: 0.4rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tab-btn { background: none; border: none; cursor: pointer; padding: 0.7rem 1rem; font-size: 0.9rem; font-weight: 500; color: var(--muted-foreground); border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 0.4rem; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel[hidden] { display: none; }

/* ===== Two column layouts ===== */
.two-col { display: grid; grid-template-columns: 1fr; gap: 1.75rem; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1.4fr 1fr; } }
.two-col.reverse-order { grid-template-columns: 1fr; }
@media (min-width: 1024px) { .two-col.reverse-order { grid-template-columns: 1fr 1.4fr; } }

/* ===== Cart / order page ===== */
.cart-panel { position: sticky; top: 5.5rem; }
.cart-line { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.cart-line-icon { width: 2.25rem; height: 2.25rem; border-radius: var(--radius-md); background-image: var(--gradient-hero); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.cart-line-info { flex: 1 1 auto; min-width: 0; }
.cart-line-info strong { display: block; font-size: 0.85rem; }
.cart-line-info span { font-size: 0.75rem; color: var(--muted-foreground); }
.cart-line-total { font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.cart-remove { background: none; border: none; cursor: pointer; color: var(--muted-foreground); padding: 0.25rem; }
.cart-remove:hover { color: var(--destructive); }
.cart-totals { border-top: 1px solid var(--border); margin-top: 0.75rem; padding-top: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; }
.cart-totals .row { display: flex; justify-content: space-between; }
.cart-totals .grand { font-size: 1.2rem; font-weight: 700; color: var(--primary); font-family: var(--font-display); }
.qty-stepper { display: flex; align-items: center; gap: 0.5rem; }
.qty-stepper button { width: 1.8rem; height: 1.8rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.stock-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.stock-row:last-child { border-bottom: none; }
.stock-row-icon { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-md); background-image: var(--gradient-hero); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stock-row-info { flex: 1 1 auto; min-width: 0; }
.stock-row-info strong { font-size: 0.9rem; }
.stock-row-info .dosage { font-size: 0.78rem; color: var(--muted-foreground); }
.stock-row-price { font-weight: 700; color: var(--primary); white-space: nowrap; }

.offers-card { padding: 0.25rem 1.25rem; max-height: 28rem; overflow-y: auto; }
.offer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.offer-row:last-child { border-bottom: none; }
.offer-row-main { min-width: 0; flex: 1 1 12rem; }
.offer-row-main strong { font-size: 0.85rem; }
.offer-row-address { display: flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; color: var(--muted-foreground); margin-top: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22rem; }
.offer-row-address svg { width: 0.75rem; height: 0.75rem; flex-shrink: 0; }
.offer-row-side { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.offer-row-price { font-weight: 700; font-size: 0.82rem; color: var(--primary); white-space: nowrap; }

.active-pharmacy-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.6rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background-color: var(--surface); font-size: 0.82rem; margin-bottom: 1rem; }
.active-pharmacy-bar svg { width: 1rem; height: 1rem; color: var(--primary); flex-shrink: 0; }
.active-pharmacy-bar strong { font-size: 0.85rem; }
.active-pharmacy-bar .muted { color: var(--muted-foreground); }
.pharmacy-compact-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; font-size: 0.78rem; }
.pharmacy-compact-meta .muted { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted-foreground); }
.pharmacy-compact-meta .muted svg { width: 0.8rem; height: 0.8rem; }

#medicineResultsCard { padding: 0.25rem 1.25rem; }
.med-item { border-bottom: 1px solid var(--border); }
.med-item:last-child { border-bottom: none; }
.med-search-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; }
.med-offers-panel { padding: 0 0 0.75rem; }
.med-offers-panel[hidden] { display: none; }
.qty-stepper-sm { transform: scale(0.9); }

.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.pay-method { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; background: var(--card); cursor: pointer; text-align: left; }
.pay-method strong { font-size: 0.85rem; }
.pay-method span { font-size: 0.72rem; color: var(--muted-foreground); }
.pay-method.selected { border-color: var(--primary); background-color: color-mix(in oklch, var(--primary) 6%, transparent); }

/* ===== Details/summary ===== */
details.delivery-details { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.85rem 1rem; margin-top: 1rem; }
details.delivery-details summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
details.delivery-details .field { margin-top: 0.85rem; }

/* ===== Dropzone (ordonnance) ===== */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius-2xl); padding: 2.5rem 1.5rem; text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.dropzone:hover { border-color: var(--primary); background-color: color-mix(in oklch, var(--primary) 4%, transparent); }
.dropzone svg { width: 2.5rem; height: 2.5rem; margin: 0 auto 0.75rem; color: var(--primary); }
.dropzone strong { display: block; margin-bottom: 0.3rem; }
.dropzone small { color: var(--muted-foreground); }
.preview-wrap { position: relative; border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--border); }
.preview-wrap img { width: 100%; max-height: 18rem; object-fit: cover; }
.preview-remove { position: absolute; top: 0.6rem; right: 0.6rem; background-color: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 999px; width: 2rem; height: 2rem; cursor: pointer; }
.skeleton-bar { height: 0.9rem; border-radius: 999px; background-color: var(--muted); margin-bottom: 0.6rem; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { display: flex; gap: 0.7rem; align-items: flex-start; border-radius: var(--radius-lg); padding: 0.85rem 1rem; font-size: 0.85rem; }
.banner svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
.banner.success { background-color: color-mix(in oklch, var(--success) 10%, transparent); color: var(--success); }
.banner.warning { background-color: color-mix(in oklch, var(--warning) 15%, transparent); color: color-mix(in oklch, var(--warning-foreground) 100%, transparent); }
.banner.info { background-color: color-mix(in oklch, var(--info) 10%, transparent); color: var(--info); }
.banner.destructive { background-color: color-mix(in oklch, var(--destructive) 10%, transparent); color: var(--destructive); }
.match-tile { display: block; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.6rem 0.75rem; font-size: 0.8rem; }
.match-tile:hover { border-color: var(--primary); }

/* ===== Wizard (inscription) ===== */
.wizard-progress { position: sticky; top: 4rem; z-index: 10; background-color: var(--background); padding: 1.25rem 0; }
.wizard-steps { display: flex; align-items: flex-start; justify-content: space-between; max-width: 42rem; margin: 0 auto; position: relative; }
.wizard-steps::before { content: ""; position: absolute; top: 1.1rem; left: 10%; right: 10%; height: 2px; background-color: var(--border); z-index: 0; }
.wizard-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; flex: 1 1 0; }
.wizard-step-circle { width: 2.25rem; height: 2.25rem; border-radius: 999px; background-color: var(--card); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); }
.wizard-step.done .wizard-step-circle { background-image: var(--gradient-primary); border-color: transparent; color: #fff; }
.wizard-step.active .wizard-step-circle { border-color: var(--primary); color: var(--primary); }
.wizard-step span { font-size: 0.7rem; color: var(--muted-foreground); text-align: center; }
.wizard-step.active span, .wizard-step.done span { color: var(--foreground); font-weight: 600; }

.inscription-layout { display: grid; grid-template-columns: 1fr; gap: 1.75rem; max-width: 76rem; margin: 0 auto; }
@media (min-width: 1024px) { .inscription-layout { grid-template-columns: 1fr 1.1fr; align-items: start; } }
.inscription-map-col { min-width: 0; }
@media (min-width: 1024px) { .inscription-map-col { position: sticky; top: 5.5rem; } }
.inscription-wizard-col { min-width: 0; max-width: 40rem; }

.wizard-panel h2 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.wizard-panel > p { color: var(--muted-foreground); font-size: 0.9rem; margin-bottom: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 2rem; }
.doc-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; margin-bottom: 0.85rem; }
.doc-item-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; }
.tag-required { font-size: 0.68rem; background-color: var(--muted); color: var(--muted-foreground); border-radius: 999px; padding: 0.1rem 0.5rem; font-weight: 500; }

/* ===== Auth / portal ===== */
.auth-wrap { display: flex; justify-content: center; padding: 1.5rem 0 2.5rem; }
.auth-card { width: 100%; max-width: 26rem; border: 1px solid var(--border); border-radius: var(--radius-2xl); background-color: var(--card); padding: 2rem; box-shadow: var(--shadow-card); }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-icon { width: 3rem; height: 3rem; border-radius: 999px; background-image: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.auth-head h1 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.auth-head p { font-size: 0.85rem; }
.auth-tabs { justify-content: center; margin-bottom: 1.5rem; }

.portal-banner { border-radius: var(--radius-2xl); background-image: var(--gradient-primary); color: #fff; padding: 1.5rem 1.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.order-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; margin-bottom: 0.85rem; }
.order-row .ref { font-weight: 700; font-family: var(--font-display); }
.order-row .meta { font-size: 0.8rem; color: var(--muted-foreground); }
.messaging-grid { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
@media (min-width: 768px) { .messaging-grid { grid-template-columns: 16rem 1fr; } }
.convo-list { border-bottom: 1px solid var(--border); max-height: 26rem; overflow-y: auto; }
@media (min-width: 768px) { .convo-list { border-bottom: none; border-right: 1px solid var(--border); } }
.convo-item { width: 100%; text-align: left; padding: 0.9rem 1rem; border: none; background: none; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.convo-item.active { background-color: var(--secondary); }
.convo-item strong { font-size: 0.88rem; display: block; }
.convo-item p { font-size: 0.78rem; color: var(--muted-foreground); margin-top: 0.2rem; }
.unread-dot { background-color: var(--primary); color: #fff; border-radius: 999px; font-size: 0.68rem; padding: 0.1rem 0.4rem; flex-shrink: 0; }
.chat-thread { display: flex; flex-direction: column; height: 26rem; }
.chat-thread-messages { flex: 1 1 auto; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; background-color: color-mix(in oklch, var(--surface) 50%, transparent); }
.chat-thread-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border); }
.chat-thread-form input { flex: 1 1 auto; }

/* ===== 404 / error / status ===== */
.status-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 1.25rem; }
.status-page .code { font-family: var(--font-display); font-size: 5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.status-page h1 { font-size: 1.4rem; margin: 1rem 0 0.5rem; }
.status-page p { color: var(--muted-foreground); margin-bottom: 1.75rem; }

.view-toggle-btn.active { background-color: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* ===== Misc content helpers ===== */
.fo-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.75rem; }
@media (min-width: 768px) { .fo-stat-grid { grid-template-columns: repeat(4, 1fr); } }
.fo-stat-grid .kpi-card { text-align: center; }
.fo-chat-me { align-self: flex-end; background-color: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 0.3rem; }
.fo-chat-them { align-self: flex-start; background-color: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 0.3rem; }

@media (min-width: 768px) {
  .md-flex { display: flex; }
  .md-hidden { display: none; }
}
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

/* ===== Print (Facture) ===== */
@media print {
  .site-header, .site-footer, .chat-toggle, .chat-panel, .fo-actions { display: none !important; }
}
