/* === Enghien Proxy — feuille de style principale === */

:root {
  --primary: #0f766e;      /* teal 700 */
  --primary-dark: #0b5851;
  --primary-light: #5eead4;
  --accent: #f59e0b;       /* amber 500 */
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --info: #2563eb;

  --text: #1f2937;
  --text-muted: #6b7280;
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);

  --container: 1200px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Empêche un scroll horizontal parasite si un enfant déborde
     (fréquent sur mobile avec les images pleine largeur, les transforms,
     les margin négatives des hero ou les keyframes). */
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
main { flex: 1; padding: 2rem 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }

/* ===== Header ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  /* z-index 130 : doit être > .nav-backdrop (110) car position:sticky crée
     un stacking context — sans ça le backdrop (appendé au <body>) couvre
     le drawer et capte tous les clics. */
  position: sticky; top: 0; z-index: 130;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .75rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--primary); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-size: 1.125rem; }
.header-search {
  flex: 1;
  display: flex;
  max-width: 520px;
}
.header-search input {
  flex: 1;
  padding: .55rem .85rem;
  border: 1px solid var(--border-strong);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: .95rem;
}
.header-search input:focus { outline: 2px solid var(--primary-light); outline-offset: -1px; }
.header-search button {
  padding: 0 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
}
.header-nav { display: flex; align-items: center; gap: 1rem; }
.header-nav a { color: var(--text); font-size: .95rem; }
.cart-link { font-weight: 600; }

.user-menu { position: relative; }
.user-menu-toggle {
  background: transparent; border: none; cursor: pointer;
  padding: .4rem .6rem; border-radius: var(--radius);
  font-size: .95rem; color: var(--text);
}
.user-menu-toggle:hover { background: var(--bg); }
.user-menu-dropdown {
  display: none;
  position: absolute; right: 0; top: 100%;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  z-index: 50;
}
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-dropdown a, .user-menu-dropdown .link-btn {
  display: block; width: 100%;
  padding: .55rem .75rem;
  color: var(--text);
  border-radius: var(--radius);
  background: transparent; border: none; text-align: left; cursor: pointer;
  font: inherit;
}
.user-menu-dropdown a:hover, .user-menu-dropdown .link-btn:hover {
  background: var(--bg); text-decoration: none;
}
.user-menu-dropdown hr { border: 0; border-top: 1px solid var(--border); margin: .4rem 0; }
.logout-form { margin: 0; }

/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .55rem 1.1rem;
  font-size: .95rem; font-weight: 600;
  border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: .35rem .75rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }

/* ===== Formulaires ===== */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .925rem; }
.form-control, input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="url"],
select, textarea {
  width: 100%;
  padding: .55rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.15);
}
textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.form-error { font-size: .85rem; color: var(--danger); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input { width: auto; }
.required { color: var(--danger); }

/* ===== Alerts ===== */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error, .alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert ul { margin: .5rem 0 0; padding-left: 1.25rem; }

.cart-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
}
.cart-steps span {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .65rem .75rem;
    text-align: center;
    color: var(--text-muted);
    font-weight: 650;
}
.cart-steps span.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===== EnghienProxy Status ===== */
.status-page {
  display: grid;
  gap: 1.5rem;
}
.status-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.76)),
    radial-gradient(circle at top right, rgba(20,184,166,.2), transparent 36%),
    #fff;
  box-shadow: var(--shadow);
}
.status-hero-issue {
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.82)),
    radial-gradient(circle at top right, rgba(245,158,11,.24), transparent 36%),
    #fff;
}
.status-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: var(--success);
  font-size: 2rem;
}
.status-hero-issue .status-mark { background: var(--accent); }
.status-eyebrow {
  margin: 0 0 .2rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: .78rem;
}
.status-hero h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1.12;
}
.status-hero p:last-child {
  margin: .45rem 0 0;
  color: var(--text-muted);
}
.status-ring {
  --value: calc(var(--status-percent) * 1%);
  width: 116px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--success) var(--value), #e5e7eb 0);
  position: relative;
}
.status-hero-issue .status-ring {
  background: conic-gradient(var(--accent) var(--value), #e5e7eb 0);
}
.status-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
}
.status-ring strong {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
}
.status-system-card,
.status-impact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.status-system-card {
  padding: 1.25rem;
}
.status-card-head,
.status-impact-top,
.status-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.status-card-head h2,
.status-impact h2 {
  margin: 0;
}
.status-card-head p {
  margin: .2rem 0 0;
  color: var(--text-muted);
}
.status-service-list {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}
.status-service {
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfdff;
}
.status-service strong,
.status-service span {
  display: block;
}
.status-service span {
  color: var(--text-muted);
  font-size: .9rem;
}
.status-service b {
  min-width: 3.5rem;
  text-align: right;
}
.status-meter {
  flex: 1;
  min-width: 160px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.status-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.status-meter-operational { background: var(--success); }
.status-meter-degraded { background: var(--accent); }
.status-meter-outage { background: var(--danger); }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-weight: 750;
  font-size: .82rem;
  white-space: nowrap;
}
.status-pill-operational { color: #065f46; background: #dcfce7; }
.status-pill-degraded { color: #92400e; background: #fef3c7; }
.status-pill-outage { color: #991b1b; background: #fee2e2; }
.status-impact {
  display: grid;
  gap: 1rem;
}
.status-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.status-impact-card {
  padding: 1rem;
}
.status-incident-message,
.status-causes {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.status-incident-message span,
.status-causes span {
  display: block;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 750;
  text-transform: uppercase;
}
.status-incident-message p {
  margin: .35rem 0 0;
}
.status-causes ul {
  margin: .5rem 0 0;
  padding-left: 1.1rem;
}
.status-admin-form,
.status-admin-item {
  display: grid;
  gap: 1rem;
}
.status-admin-list {
  display: grid;
  gap: 1rem;
}
.status-admin-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfdff;
}
.status-admin-item-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.status-admin-item-head span {
  color: var(--text-muted);
}
.status-admin-check {
  align-self: end;
  margin-bottom: .35rem;
}
.status-reason-builder {
  display: grid;
  gap: .55rem;
}
.status-reason-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  margin-bottom: .5rem;
}
.status-admin-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .status-hero {
    grid-template-columns: 1fr;
  }
  .status-ring {
    width: 96px;
  }
  .status-card-head,
  .status-service {
    align-items: flex-start;
    flex-direction: column;
  }
  .status-meter {
    width: 100%;
  }
  .status-service b {
    text-align: left;
  }
}
.delivery-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .75rem;
}
.delivery-choice-card {
    display: grid;
    gap: .25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem;
    cursor: pointer;
}
.delivery-choice-card input { width: auto; }
.delivery-choice-card span,
.delivery-choice-card small {
    color: var(--text-muted);
}
.delivery-choice-card.disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ===== Cartes ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 1rem; }
.card-title { margin: 0 0 1rem; font-size: 1.25rem; }

/* ===== Grilles ===== */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .grid-4, .grid-3 { grid-template-columns: 1fr; } }

/* ===== Produit ===== */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
  position: relative;
  color: inherit;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.product-card-sponsored {
  border-color: var(--accent);
}
.product-card-sponsor-badge {
  position: absolute;
  top: .6rem;
  right: .6rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .65rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: #1f2937;
  font-size: .78rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
}
.product-card-img {
  aspect-ratio: 4/3;
  background: var(--bg);
  overflow: hidden;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card-img-placeholder { font-size: 3rem; opacity: .3; }
.product-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.product-card-title { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0; }
.product-card-company { font-size: .85rem; color: var(--text-muted); margin: 0; }
.product-card-promo-name {
  font-size: .78rem;
  color: var(--danger);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: .25rem;
}
.product-card-price { margin: 0; margin-top: auto; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.product-card-price-current { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.product-card-deposit { color: var(--text-muted); font-size: .85rem; margin-top: -.2rem; }
.product-card-price-sale { color: var(--danger); }
.product-card-price-old {
  font-size: .9rem;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.product-card-badge {
  position: absolute;
  top: .6rem;
  left: .6rem;
  z-index: 2;
  padding: .3rem .65rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.product-card-badge-promo {
  background: var(--danger);
  color: white;
}

/* ===== Catégories (carte icône/image) ===== */
.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
    border-color: var(--primary-light);
}
.category-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0fdfa, #ecfeff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: .25rem;
}
.category-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.category-card-emoji { font-size: 2rem; line-height: 1; }
.category-card-name { font-size: .95rem; color: var(--text); }
.category-card-count { font-size: .78rem; color: var(--text-muted); }

/* ===== Carrousel publicités (home hero) ===== */
.ad-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.ad-carousel-track {
  display: flex;
  transition: transform .5s ease;
  will-change: transform;
}
.ad-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  aspect-ratio: 21/9;
  position: relative;
  display: block;
  color: inherit;
  overflow: hidden;
  background: linear-gradient(135deg, #0f766e 0%, #0b5851 100%);
}
.ad-carousel-slide:hover { text-decoration: none; }
.ad-carousel-slide img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.ad-carousel-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 60%);
  color: white;
}
.ad-carousel-overlay-content { max-width: 640px; }
.ad-carousel-badge {
  display: inline-block;
  padding: .2rem .6rem;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
}
.ad-carousel-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 .35rem; color: white; }
.ad-carousel-desc { margin: 0; opacity: .9; font-size: 1rem; }
.ad-carousel-dots {
  position: absolute;
  bottom: 1rem; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: .4rem;
  z-index: 3;
}
.ad-carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  border: none; padding: 0; cursor: pointer;
  transition: background .2s, transform .2s;
}
.ad-carousel-dot:hover { background: rgba(255,255,255,.8); }
.ad-carousel-dot.active { background: white; transform: scale(1.3); }
.ad-carousel-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.4);
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 3;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.ad-carousel-arrow:hover { background: rgba(0,0,0,.7); }
.ad-carousel-arrow-prev { left: .75rem; }
.ad-carousel-arrow-next { right: .75rem; }
@media (max-width: 640px) {
  .ad-carousel-slide { aspect-ratio: 16/10; }
  .ad-carousel-title { font-size: 1.25rem; }
  .ad-carousel-overlay { padding: 1rem; }
}

/* ===== Panier - ligne produit avec promo ===== */
.cart-line-promo {
  display: block;
  font-size: .78rem;
  color: var(--danger);
  font-weight: 600;
  margin-top: .2rem;
}
.cart-summary-discount { color: var(--danger); }
.cart-summary-total-old { text-decoration: line-through; color: var(--text-muted); font-weight: 500; font-size: .9rem; }

/* ===== Badges ===== */
.badge {
  display: inline-block; padding: .2rem .55rem;
  border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--bg); color: var(--text);
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #dcfce7; color: #14532d; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-promo { background: var(--accent); color: white; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 0;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
}
.hero h1 { font-size: 2.5rem; margin: 0 0 1rem; }
.hero p { font-size: 1.15rem; opacity: .95; margin-bottom: 1.5rem; max-width: 640px; }
.hero .btn-primary { background: white; color: var(--primary); }
.hero .btn-primary:hover { background: var(--primary-light); color: var(--primary-dark); }

/* ===== Sections ===== */
.section { margin-bottom: 2.5rem; }
.section-title { font-size: 1.5rem; margin: 0 0 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.section-title a { font-size: .9rem; font-weight: 500; }

/* ===== Table ===== */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg); font-weight: 600; font-size: .9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.table tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #fafafa; }

/* ===== Footer ===== */
.site-footer { background: #111827; color: #9ca3af; padding: 3rem 0 1rem; margin-top: 3rem; }
.site-footer h3, .site-footer h4 { color: white; margin: 0 0 .75rem; font-size: 1.05rem; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; font-size: .9rem; }
.site-footer a { color: #d1d5db; }
.site-footer a:hover { color: white; }
.footer-bottom { border-top: 1px solid #1f2937; margin-top: 2rem; padding: 1rem 0; font-size: .85rem; text-align: center; }

/* ===== Auth (login/register) ===== */
.auth-wrap { max-width: 440px; margin: 2rem auto; }
.auth-wrap .card { padding: 2rem; }
.auth-wrap h1 { margin: 0 0 1.25rem; font-size: 1.5rem; }
.auth-links { margin-top: 1.25rem; text-align: center; font-size: .9rem; }

/* ===== Divers ===== */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }

.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; font: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ===== Admin / Dashboard sidebar ===== */
.layout-sidebar { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; }
@media (max-width: 960px) { .layout-sidebar { grid-template-columns: 1fr; } }
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  align-self: start;
  position: sticky; top: 80px;
}
.sidebar-title { font-size: .85rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; padding: .5rem .75rem; letter-spacing: .05em; }
.sidebar a { display: block; padding: .55rem .75rem; color: var(--text); border-radius: var(--radius); font-size: .95rem; }
.sidebar a:hover { background: var(--bg); text-decoration: none; }
.sidebar a.active { background: var(--primary); color: white; }

/* ===== Stats ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-label { font-size: .85rem; color: var(--text-muted); margin-bottom: .25rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); }

/* ===== Étoiles d'avis ===== */
.rating { display: inline-flex; align-items: center; gap: .1rem; color: var(--accent); font-size: 1.05rem; }
.rating-empty { color: #d1d5db; }
.rating-star { display: inline-block; line-height: 1; }

/* ===== Burger mobile (hidden par défaut desktop) ===== */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Recherche mobile (dans le drawer, hidden desktop) */
.header-search-mobile { display: none; }

/* Backdrop du drawer — invisible, sert uniquement à capter les clics pour fermer */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 110;
}
.nav-backdrop.open { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Responsive : breakpoint navbar → drawer à 1060px =====
   Inclut désormais toutes les tablettes en landscape (iPad Air, iPad Pro 11"
   et iPad Pro 12.9" portrait). Évite la zone où la navbar horizontale était
   trop dense et coupait le user-menu-toggle à droite. */
@media (max-width: 1060px) {
  .header-search { display: none; }
  .nav-toggle { display: flex; }

  .header-inner { gap: .75rem; }
  .brand-name { font-size: 1rem; }

  /* Drawer navigation — compact, dvh pour mobile, safe-area iOS */
  .header-nav {
    display: none;
    position: fixed;
    top: 0; right: 0;
    width: min(300px, 86vw);
    height: 100vh;        /* fallback */
    height: 100dvh;       /* mobile : exclut les barres dynamiques */
    max-height: 100vh;
    max-height: 100dvh;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: .75rem .75rem max(1rem, env(safe-area-inset-bottom)) .75rem;
    gap: 0;
    box-shadow: -8px 0 32px rgba(0,0,0,.15);
    z-index: 120;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .header-nav.open { display: flex; }
  .header-nav > a, .header-nav > .btn {
    padding: .6rem .75rem;
    border-radius: var(--radius);
    font-size: .95rem;
    text-align: left;
    width: 100%;
    justify-content: flex-start;
    display: flex;
    align-items: center;
    gap: .5rem;
  }
  .header-nav > a:hover { background: var(--bg); }
  .header-nav > .btn { margin-top: .25rem; }
  .header-nav .cart-link { font-weight: 600; }

  .user-menu {
    width: 100%;
    /* Remonte la section compte (wallet → profil → commandes…) juste
       sous le bandeau identité. Le solde portefeuille apparaît ainsi
       en première position sous le nom utilisateur. */
    order: -1;
    border-top: none;
    border-bottom: 1px solid var(--border);
    margin-top: 0; padding-top: 0;
    margin-bottom: .5rem; padding-bottom: .35rem;
    /* Override base rule (position:relative) pour que le toggle absolute
       se positionne relativement au drawer (.header-nav, position: fixed)
       et non relativement au wrapper .user-menu situé en bas du drawer. */
    position: static;
  }
  .user-menu-toggle { width: 100%; text-align: left; padding: .6rem .75rem; font-size: .95rem; }
  .user-menu-dropdown {
    position: static !important;
    box-shadow: none;
    border: none;
    padding: 0;
    background: transparent;
    display: block !important;
  }
  .user-menu-dropdown a, .user-menu-dropdown .link-btn { padding: .55rem .75rem; font-size: .9rem; }
  .user-menu-dropdown hr { margin: .3rem 0; }

  /* Recherche mobile affichée dans le header */
  .header-search-mobile {
    display: flex;
    padding: .6rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
  }
  .header-search-mobile input {
    flex: 1;
    padding: .55rem .85rem;
    border: 1px solid var(--border-strong);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: .95rem;
  }
  .header-search-mobile button {
    padding: 0 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
  }

  body.nav-open { overflow: hidden; }

  /* Sidebar layouts : devenir barre horizontale */
  .layout-sidebar { grid-template-columns: 1fr; gap: 1rem; }
  .sidebar {
    position: relative;
    top: auto;
    padding: .4rem .5rem;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
  }
  .sidebar-title { display: none; }
  .sidebar a {
    padding: .4rem .75rem;
    font-size: .85rem;
    border: 1px solid var(--border);
  }
  .sidebar a.active { border-color: var(--primary); }

  /* Touch targets */
  .btn, button, input, select, textarea { min-height: 44px; }
  .btn-sm { min-height: 36px; }

  /* Panier / Checkout empilés */
  .cart-grid, .checkout-grid { grid-template-columns: 1fr !important; gap: 1.25rem !important; }
  .cart-grid aside .card, .checkout-grid aside .card { position: static !important; }
}

@media (max-width: 640px) {
  .brand-name { display: none; }
  .hero { padding: 2.5rem 0; border-radius: 0; margin-left: -1rem; margin-right: -1rem; padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  main { padding: 1.25rem 0; }
  .container { padding: 0 1rem; }
  .card { padding: 1rem; border-radius: var(--radius); }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .section { margin-bottom: 1.75rem; }
  .section-title { font-size: 1.2rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.4rem; }
  .grid-3, .grid-4 { gap: .75rem; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

/* ===== Tables responsive : wrap scrollable + mode empilé ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
.table-wrap .table { border: none; border-radius: 0; }

/* Tables non stackées : scroll horizontal via .table-wrap (recommandé) */
.table { width: 100%; border-collapse: collapse; }

@media (max-width: 760px) {
  /* Mode carte empilée pour les tables avec .table-stacked (data-label) */
  .table-stacked { border: none; background: transparent; }
  .table-stacked thead { display: none; }
  .table-stacked tbody, .table-stacked tr { display: block; width: 100%; }
  .table-stacked tr {
    margin-bottom: .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .5rem .75rem;
    background: var(--surface);
  }
  .table-stacked td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem .25rem;
    border: none;
    border-bottom: 1px dashed var(--border);
    text-align: right;
  }
  .table-stacked td:last-child { border-bottom: none; }
  .table-stacked td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: .85rem;
    margin-right: 1rem;
    text-align: left;
  }
  /* Tables non stackées hors .table-wrap : scroll horizontal forcé */
  .card > .table:not(.table-stacked) { display: block; overflow-x: auto; }
}

/* ===== Fiche entreprise : header responsive ===== */
.company-header-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}
.company-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 1rem;
  align-items: stretch;
}
.company-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}
.company-section-head .card-title,
.company-hours-card .card-title {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.company-section-head p {
  margin: .2rem 0 0;
}
.company-map,
.company-map-placeholder {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f8fafc;
}
.company-map {
  display: block;
}
.company-map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--text-muted);
  font-weight: 700;
}
.company-map-placeholder .lni {
  font-size: 1.5rem;
}
.company-opening-hours {
  display: grid;
  gap: .2rem;
}
.company-hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .62rem .7rem;
  border-radius: 8px;
}
.company-hours-row:nth-child(odd) {
  background: #f8fafc;
}
.company-hours-row.is-today {
  background: rgba(15,118,110,.09);
  color: var(--primary-dark);
}
.company-hours-row span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 650;
}
.company-hours-row small {
  padding: .12rem .38rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .72rem;
}
.company-hours-row strong {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.company-hours-row strong.is-closed {
  color: var(--text-muted);
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  vertical-align: middle;
  margin-left: .35rem;
  padding: .18rem .48rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  font-size: .78rem;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}
.verified-badge .lni { font-size: 1rem; line-height: 1; }
.verified-badge--compact {
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
.product-card-company .verified-badge {
  margin-left: .25rem;
}
@media (max-width: 640px) {
  .company-header-card { grid-template-columns: 1fr; text-align: center; }
  .company-header-card img { margin: 0 auto; }
  .company-info-grid { grid-template-columns: 1fr; }
  .company-section-head { flex-direction: column; }
  .company-map,
  .company-map-placeholder { min-height: 240px; }
  .company-hours-row { align-items: flex-start; flex-direction: column; gap: .25rem; }
}

/* ===== Breadcrumbs ===== */
.breadcrumbs { font-size: .9rem; color: var(--text-muted); margin-bottom: .75rem; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }

/* ===== Produits personnalisables / formules ===== */
.product-customization-block {
  margin: 0 0 1rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .5rem;
}
.product-option-chip {
  min-height: 42px;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.product-option-chip small {
  display: block;
  color: var(--primary);
  font-weight: 700;
}
.package-choice-group {
  margin: .8rem 0 0;
  padding: 0;
  border: 0;
}
.package-choice-group legend {
  margin-bottom: .45rem;
  font-weight: 700;
}
.cart-customization {
  margin: .35rem 0 0;
  padding-left: 1rem;
  color: var(--text-muted);
  font-size: .86rem;
  line-height: 1.45;
}
.favorite-company-list {
  display: grid;
  gap: .65rem;
}
.favorite-company-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: .75rem;
  align-items: center;
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.favorite-company-item img,
.favorite-company-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.favorite-company-item small {
  display: block;
  color: var(--text-muted);
}
.opening-hours-row {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) 1fr;
  gap: .75rem;
  align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.opening-hours-row:last-child { border-bottom: 0; }
.opening-hours-day { margin: 0; }
.opening-hours-times {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.opening-hours-times input { max-width: 140px; }

.courier-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
  gap: 1rem;
  align-items: start;
}
.courier-shipment-list {
  display: grid;
  gap: .65rem;
}
.courier-shipment {
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.courier-shipment.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}
.courier-shipment span,
.courier-shipment small {
  display: block;
  margin-top: .2rem;
}
.courier-reference {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--primary);
}
.delivery-tracking-box {
  margin-top: 1rem;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.delivery-tracking-box > strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: .06em;
  color: var(--primary);
}

@media (max-width: 760px) {
  .opening-hours-row,
  .courier-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Calendrier réservations entreprise ===== */
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.reservation-board {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .85fr);
  gap: 1rem;
  align-items: start;
}
.reservation-calendar-card,
.reservation-day-panel {
  padding: 1rem;
}
.reservation-calendar-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.reservation-calendar-header h2,
.reservation-day-panel h2 {
  margin: 0;
  font-size: 1.25rem;
}
.reservation-weekdays,
.reservation-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .45rem;
}
.reservation-weekdays {
  margin-bottom: .45rem;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}
.reservation-day {
  min-height: 92px;
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.reservation-day.is-muted {
  opacity: .45;
}
.reservation-day.is-today {
  border-color: var(--primary);
}
.reservation-day.is-selected {
  box-shadow: 0 0 0 2px var(--primary);
}
.reservation-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  font-weight: 800;
}
.reservation-day-count {
  float: right;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.55rem;
}
.reservation-day-dots {
  display: flex;
  gap: .25rem;
  margin-top: 1.15rem;
  flex-wrap: wrap;
}
.status-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: var(--text-muted);
}
.status-pending { background: #f59e0b; }
.status-confirmed { background: #2563eb; }
.status-ready { background: #16a34a; }
.status-picked_up { background: #64748b; }
.status-cancelled { background: #dc2626; }
.reservation-day-list {
  display: none;
}
.reservation-day-list.is-active {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}
.reservation-card,
.reservation-detail-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.reservation-card {
  padding: .8rem;
}
.reservation-card-top {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  margin-bottom: .55rem;
}
.reservation-status {
  color: #fff;
}
.reservation-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.reservation-detail-list {
  display: grid;
  gap: .75rem;
}
.reservation-detail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem;
}
.reservation-detail-date {
  color: var(--primary);
  font-weight: 800;
  font-size: .9rem;
}
.reservation-detail-item h3 {
  margin: .25rem 0;
  font-size: 1.05rem;
}
.reservation-detail-side {
  min-width: 170px;
  text-align: right;
}
.reservation-note {
  margin-top: .65rem;
  padding: .65rem;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  font-size: .9rem;
}

@media (max-width: 980px) {
  .page-heading,
  .reservation-calendar-header {
    flex-direction: column;
  }
  .reservation-board,
  .reservation-detail-item {
    grid-template-columns: 1fr;
  }
  .reservation-detail-side {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .reservation-weekdays,
  .reservation-calendar-grid {
    gap: .25rem;
  }
  .reservation-day {
    min-height: 70px;
    padding: .35rem;
  }
  .reservation-day-number {
    width: 1.35rem;
    height: 1.35rem;
  }
  .reservation-day-count {
    min-width: 1.35rem;
    height: 1.35rem;
    line-height: 1.35rem;
    font-size: .75rem;
  }
}

/* ===== Loading / transitions globales ===== */
a, .btn, button { transition: background .15s, color .15s, border-color .15s, transform .08s; }

/* ===== Accessibilité ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}
.btn:focus-visible { outline-offset: 3px; }
main:focus { outline: none; }

/* Skip link : visible quand focus au clavier (accessibilité) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--primary);
  color: white;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  z-index: 200;
  text-decoration: none;
  font-weight: 600;
  transition: top .2s;
}
.skip-link:focus {
  top: 1rem;
  text-decoration: none;
}

/* ============ Pages légales (RGPD/CGU/CGV/Cookies) ============ */
.legal {
  max-width: 880px;
  margin: 1.5rem auto;
  line-height: 1.65;
}
.legal h1 {
  font-size: 1.85rem;
  margin-top: 0;
}
.legal h2 {
  margin-top: 2.2rem;
  padding-top: 0.4rem;
  border-top: 1px solid #e5e7eb;
  font-size: 1.25rem;
  color: var(--primary-dark);
  scroll-margin-top: 5rem;
}
.legal ul, .legal ol { padding-left: 1.4rem; }
.legal li { margin: 0.25rem 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 0.75rem 0 1.5rem; font-size: 0.92rem; }
.legal table th, .legal table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
.legal table th { background: var(--bg); font-weight: 700; }
.legal-toc {
  background: var(--bg);
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0 1.5rem;
}
.legal-toc strong { display: block; margin-bottom: 0.4rem; color: var(--primary-dark); }
.legal-toc ol { margin: 0; padding-left: 1.4rem; }
.legal-toc a { text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
.legal code { background: #f3f4f6; padding: 0.05rem 0.3rem; border-radius: 4px; font-size: 0.88em; }

/* ============ Fidélité — carte + tickets ============ */
.loyalty-hero {
  position: relative;
  margin: 1.5rem 0 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 32px -16px rgba(15, 118, 110, 0.45);
}
.loyalty-hero-bg {
  position: relative;
  height: 220px;
}
.loyalty-hero-bg svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.loyalty-hero-meta {
  position: absolute;
  inset: 0;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.loyalty-hero-brand {
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.loyalty-hero-holder {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}
.loyalty-card {
  position: relative;
  margin: -90px auto 0;
  max-width: 480px;
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem 1rem;
  box-shadow: 0 18px 38px -18px rgba(0, 0, 0, 0.35);
  z-index: 2;
}
.loyalty-card-barcode {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  display: flex;
  justify-content: center;
}
.loyalty-card-barcode svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}
.loyalty-card-number {
  margin-top: 0.75rem;
  text-align: center;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  color: #111827;
  font-weight: 700;
}
.loyalty-card-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}
.loyalty-card-actions form {
  margin: 0;
}
.loyalty-lost-link {
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: background 0.15s, color 0.15s;
}
.loyalty-lost-link:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary-dark);
}
.loyalty-lost-link .arrow {
  text-decoration: none;
  font-weight: 700;
}

/* Trois petites cartes (Solde Fidelity / Points / E-Deals) */
.loyalty-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.loyalty-stat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 4px 12px -8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.loyalty-stat-cta:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: 0 10px 22px -16px rgba(15, 118, 110, 0.45);
}
.loyalty-stat-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.loyalty-stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}
.loyalty-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.loyalty-stat-value .unit {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
  margin-left: 0.15rem;
}
.loyalty-stat-hint {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

/* Tickets digitaux */
.loyalty-tickets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.loyalty-ticket {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.loyalty-ticket:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: 0 10px 22px -16px rgba(0, 0, 0, 0.25);
}
.loyalty-ticket-strip {
  width: 6px;
  background: repeating-linear-gradient(180deg, var(--primary) 0 8px, transparent 8px 14px);
}
.loyalty-ticket-body {
  flex: 1;
  padding: 0.75rem 0.9rem;
  min-width: 0;
}
.loyalty-ticket-shop {
  font-weight: 700;
  font-size: 0.98rem;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loyalty-ticket-num {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: var(--primary);
  margin-top: 0.15rem;
}
.loyalty-ticket-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.2rem;
}
.loyalty-ticket-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  font-size: 1.2rem;
  color: var(--primary);
  background: var(--bg);
}

@media (max-width: 600px) {
  .loyalty-hero-bg { height: 180px; }
  .loyalty-card { margin-top: -70px; padding: 1rem; }
  .loyalty-card-number { font-size: 1rem; letter-spacing: 0.12em; }
}

/* Reduce-motion : respecter les préférences système */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Messagerie — UI de conversation (messenger 2 panneaux)
   ============================================================ */
.msg-app {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    height: calc(100vh - 160px);
    min-height: 460px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

/* --- Sidebar liste --- */
.msg-sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--bg); min-width: 0; }
.msg-sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface);
}
.msg-sidebar-head h2 { margin: 0; font-size: 1.15rem; }
.msg-new-btn {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: var(--primary); color: #fff; text-decoration: none; transition: background .15s;
}
.msg-new-btn:hover { background: var(--primary-dark); }
.msg-thread-list { overflow-y: auto; flex: 1; }
.msg-empty-hint { padding: 1.25rem; }
.msg-thread {
    display: flex; align-items: center; gap: .7rem; padding: .75rem 1.1rem;
    text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border);
    position: relative; transition: background .12s;
}
.msg-thread:hover { background: rgba(15,118,110,.06); }
.msg-thread.active { background: rgba(15,118,110,.12); }
.msg-thread-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.msg-thread-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.msg-thread-name { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-thread-time { font-size: .72rem; color: var(--text-muted); flex: 0 0 auto; }
.msg-thread-sub { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-thread.unread .msg-thread-name { font-weight: 700; }
.msg-thread.unread .msg-thread-sub { color: var(--text); }
.msg-unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }

/* --- Avatars --- */
.msg-avatar {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: .95rem;
    background: var(--primary-light); color: var(--primary-dark);
}
.msg-avatar-sm { width: 30px; height: 30px; font-size: .8rem; }
.msg-avatar-lg { width: 46px; height: 46px; font-size: 1.2rem; }

/* --- Panneau conversation --- */
.msg-main { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.msg-conv-head {
    display: flex; align-items: center; gap: .8rem; padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border); background: var(--surface);
}
.msg-conv-head-text { min-width: 0; }
.msg-conv-head-text h1 { margin: 0; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-conv-head-text p { margin: .1rem 0 0; font-size: .82rem; color: var(--text-muted); }

.msg-stream {
    flex: 1; overflow-y: auto; padding: 1.25rem;
    display: flex; flex-direction: column; gap: .5rem;
    background: linear-gradient(180deg, var(--bg), #fff);
}
.msg-day-sep { text-align: center; margin: .5rem 0; }
.msg-day-sep span {
    font-size: .72rem; color: var(--text-muted); background: var(--border);
    padding: .15rem .7rem; border-radius: 999px;
}
.msg-row { display: flex; align-items: flex-end; gap: .5rem; max-width: 78%; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.theirs { align-self: flex-start; }
.msg-bubble {
    display: flex; flex-direction: column; padding: .55rem .8rem;
    border-radius: 14px; box-shadow: var(--shadow-sm); position: relative;
    word-break: break-word; line-height: 1.4;
}
.msg-row.theirs .msg-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-row.mine .msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble-name { font-size: .74rem; font-weight: 700; color: var(--primary-dark); margin-bottom: .15rem; }
.msg-bubble-text { white-space: pre-wrap; }
.msg-bubble-time { font-size: .66rem; opacity: .7; margin-top: .25rem; align-self: flex-end; }
.msg-row.mine .msg-bubble-time { color: rgba(255,255,255,.85); }

/* --- Composer --- */
.msg-composer {
    display: flex; align-items: flex-end; gap: .6rem; padding: .8rem 1rem;
    border-top: 1px solid var(--border); background: var(--surface);
}
.msg-composer textarea {
    flex: 1; resize: none; max-height: 160px; padding: .6rem .8rem;
    border: 1px solid var(--border-strong); border-radius: 20px; font: inherit; line-height: 1.4;
}
.msg-composer textarea:focus { outline: none; border-color: var(--primary); }
.msg-send { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; padding: 0; display: grid; place-items: center; font-size: 1.1rem; }

/* --- Panneau nouveau message --- */
.msg-compose-pane { display: block; }
.msg-new-form { max-width: 560px; display: flex; flex-direction: column; gap: .35rem; }
.msg-new-form .form-label { margin-top: .6rem; font-weight: 600; }
.msg-new-form select, .msg-new-form input, .msg-new-form textarea {
    padding: .55rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--radius); font: inherit; width: 100%;
}
.msg-new-form button { margin-top: 1rem; align-self: flex-start; }

@media (max-width: 760px) {
    .msg-app { grid-template-columns: 1fr; height: calc(100vh - 120px); }
    /* Sur mobile : afficher la liste OU la conversation selon la page */
    .msg-app:has(.msg-stream) .msg-sidebar { display: none; }
    .msg-row { max-width: 90%; }
}

/* Bannière mode test (admin) */
.testmode-banner {
    background: repeating-linear-gradient(45deg, #d97706, #d97706 12px, #b45309 12px, #b45309 24px);
    color: #fff; text-align: center; padding: .55rem 1rem; font-size: .9rem;
    display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap;
}
.testmode-banner a { color: #fff; text-decoration: underline; font-weight: 700; }

/* ============================================================
   Plans / abonnements — cartes de pricing comparatives
   ============================================================ */
.plans-wrap { margin-top: 1.5rem; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; align-items: stretch; }
.plan-card {
    position: relative; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.6rem 1.4rem; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card.featured { border: 2px solid var(--primary); box-shadow: var(--shadow-lg); }
.plan-card.current { border-color: var(--success); }
.plan-ribbon {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase; padding: .28rem .85rem; border-radius: 999px;
    box-shadow: var(--shadow-sm); white-space: nowrap;
}
.plan-current-tag {
    position: absolute; top: -13px; right: 16px; background: var(--success); color: #fff;
    font-size: .68rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px;
}
.plan-name { font-size: 1.15rem; font-weight: 700; margin: 0; }
.plan-desc { color: var(--text-muted); font-size: .86rem; margin: .35rem 0 1.1rem; min-height: 2.4em; }
.plan-price { display: flex; align-items: baseline; gap: .25rem; margin-bottom: .2rem; }
.plan-price .amount { font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--text); }
.plan-price .amount.free { color: var(--success); }
.plan-price .period { color: var(--text-muted); font-size: .88rem; }
.plan-meta { font-size: .77rem; color: var(--text-muted); margin: .25rem 0 1.1rem;
    display: inline-flex; align-items: center; gap: .35rem; }
.plan-meta .pill { background: var(--primary-light); color: var(--primary-dark);
    padding: .12rem .5rem; border-radius: 999px; font-weight: 600; }
.plan-features { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .55rem; flex: 1; }
.plan-features li { display: flex; gap: .55rem; align-items: flex-start; font-size: .89rem; }
.plan-features li i { margin-top: .12rem; flex: 0 0 auto; }
.plan-features li.yes i { color: var(--success); }
.plan-features li.no { color: var(--text-muted); }
.plan-features li.no i { color: var(--border-strong); }
.plan-cta { margin-top: auto; }
.plan-cta .btn { width: 100%; justify-content: center; }
.plan-cta .btn[disabled] { opacity: .6; cursor: default; }
@media (max-width: 880px) { .plans-grid { grid-template-columns: 1fr; } }

/* Mise en évidence des avantages d'un plan supérieur vs le plan inférieur */
.plan-up-note {
    display: inline-flex; align-items: center; gap: .35rem;
    background: #fff7ed; color: #b45309; border: 1px solid #fed7aa;
    font-size: .76rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px;
    margin-bottom: 1rem;
}
.plan-up-note i { font-size: .85rem; }
.plan-features li.up {
    background: linear-gradient(90deg, rgba(245,158,11,.12), transparent);
    border-radius: 8px; padding: .25rem .4rem; margin: -.1rem -.2rem;
    font-weight: 600;
}
.plan-features li.up i { color: var(--accent); }
.plan-features li.up span:first-of-type { color: var(--text); }
/* Amélioration vs plan précédent : pastille orange "+" (le vert reste pour "présent/nouveau"). */
.plan-features li.better {
    background: linear-gradient(90deg, rgba(245,158,11,.12), transparent);
    border-radius: 8px; padding: .25rem .4rem; margin: -.1rem -.2rem;
    font-weight: 600;
}
.plan-features li.better i { color: #f59e0b; }
.plan-features li.better span:first-of-type { color: var(--text); }
.plan-up-tag {
    margin-left: auto; align-self: center;
    background: #f59e0b; color: #fff; font-weight: 800; font-size: .72rem;
    width: 18px; height: 18px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; flex: 0 0 auto;
}
