/* ============================================================
   HARMATTAN BURKINA — Design System Pro v6
   Palette : Bleu royal · Or/Jaune · Vert savane
   Layout : Sidebar fixe + Main scrollable + Top navbar
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Couleurs principales */
  --blue:        #1A56DB;
  --blue-dark:   #1239A0;
  --blue-light:  #3B82F6;
  --blue-pale:   #EFF6FF;
  --blue-mid:    #1E3A6E;

  --gold:        #F5C518;
  --gold-dark:   #D4A017;
  --gold-light:  #FDE68A;
  --gold-pale:   #FFFBEB;

  --green:       #16A34A;
  --green-dark:  #166534;
  --green-light: #4ADE80;
  --green-pale:  #F0FDF4;

  /* Neutres */
  --white:       #FFFFFF;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-300:    #D1D5DB;
  --gray-400:    #9CA3AF;
  --gray-500:    #6B7280;
  --gray-600:    #4B5563;
  --gray-700:    #374151;
  --gray-800:    #1F2937;
  --gray-900:    #111827;

  /* Status */
  --success:     #16A34A;
  --warning:     #D97706;
  --error:       #DC2626;
  --info:        #2563EB;

  /* Ombres */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl:   0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
  --shadow-blue: 0 4px 14px rgba(26,86,219,.25);
  --shadow-gold: 0 4px 14px rgba(245,197,24,.35);

  /* Bordures */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition:  all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-w:   260px;
  --topbar-h:    64px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--blue-light), var(--gold)); border-radius: 3px; }

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.hb-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #f0f2f5;
  border-bottom: 1px solid #d1d5db;
  box-shadow: 0 1px 6px rgba(0,0,0,.10);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  z-index: 1000;
}

.hb-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--blue-dark);
  min-width: var(--sidebar-w);
  padding-left: 4px;
}

.hb-topbar-brand img {
  height: 36px;
  width: auto;
}

.hb-topbar-brand span {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hb-topbar-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.hb-topbar-search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 16px;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-full);
  background: #fff;
  font-size: 0.875rem;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
}
.hb-topbar-search input::placeholder { color: var(--gray-400); }

.hb-topbar-search input:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

.hb-topbar-search-btn {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  background: var(--blue);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  transition: var(--transition);
}

.hb-topbar-search-btn:hover { background: var(--blue-dark); }

.hb-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.hb-topbar-btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.825rem;
  font-weight: 500;
  transition: var(--transition);
}

.hb-topbar-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-pale);
}

.hb-topbar-btn.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.hb-topbar-btn.primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.hb-topbar-btn.gold {
  background: var(--gold);
  color: var(--gray-900);
  border-color: var(--gold);
  font-weight: 600;
}

.hb-topbar-btn.gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

/* Cart icon color on dark header */
.hb-cart-icon { color: rgba(255,255,255,.85); }

/* Cart button */
.hb-cart-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  color: var(--gray-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.hb-cart-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-pale);
}

.hb-cart-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--gray-900);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
}

.hb-cart-badge.hidden { display: none; }

/* Mobile hamburger */
.hb-hamburger {
  display: none;
  width: 38px; height: 38px;
  border: none;
  background: none;
  color: var(--gray-700);
  font-size: 1.2rem;
  align-items: center; justify-content: center;
  border-radius: var(--radius-md);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.hb-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: linear-gradient(180deg, #0F2A50 0%, #0d2137 60%, #0a1a2e 100%);
  border-right: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  transition: var(--transition-slow);
  box-shadow: 4px 0 20px rgba(0,0,0,.25);
}

.hb-sidebar-section {
  padding: 12px 8px 4px;
}

.hb-sidebar-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 0 8px;
  margin-bottom: 4px;
}

.hb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin: 1px 0;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.hb-nav-item:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
}

.hb-nav-item.active {
  background: linear-gradient(135deg, rgba(230,166,40,0.25), rgba(230,166,40,0.15));
  color: #F5C518;
  font-weight: 700;
  border-left: 3px solid #F5C518;
}

.hb-nav-item.active .hb-nav-icon {
  color: #F5C518;
}

.hb-nav-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.hb-nav-badge {
  margin-left: auto;
  background: var(--green);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.hb-nav-badge.gold {
  background: var(--gold);
  color: var(--gray-900);
}

.hb-nav-badge.blue {
  background: var(--blue);
}

/* Sidebar subscription promo */
.hb-sidebar-promo {
  margin: 8px;
  padding: 14px;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, #2563EB 100%);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 0.8rem;
}

.hb-sidebar-promo h4 {
  font-size: 0.875rem;
  margin-bottom: 6px;
}

.hb-sidebar-promo p {
  opacity: 0.85;
  margin-bottom: 10px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.hb-sidebar-promo-btn {
  display: block;
  width: 100%;
  padding: 7px 12px;
  background: var(--gold);
  color: var(--gray-900);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.hb-sidebar-promo-btn:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
}

.hb-sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.hb-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: 24px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hb-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 45%, var(--blue-mid) 70%, var(--green-dark) 100%);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}

.hb-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(245,197,24,.2) 0%, transparent 70%);
  border-radius: 50%;
}

.hb-hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 30%;
  width: 400px; height: 200px;
  background: radial-gradient(ellipse, rgba(22,163,74,.15) 0%, transparent 70%);
}

.hb-hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hb-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gold-light);
}

.hb-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.hb-hero h1 span {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hb-hero p {
  font-size: 1rem;
  opacity: 0.88;
  max-width: 480px;
  margin-bottom: 24px;
  line-height: 1.7;
}

.hb-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hb-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.hb-hero-btn.primary {
  background: var(--gold);
  color: var(--gray-900);
}

.hb-hero-btn.primary:hover {
  background: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.hb-hero-btn.outline {
  background: rgba(255,255,255,.12);
  color: white;
  border: 1.5px solid rgba(255,255,255,.35);
  backdrop-filter: blur(8px);
}

.hb-hero-btn.outline:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.6);
  transform: translateY(-2px);
}

.hb-hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 28px;
}

.hb-hero-stat span {
  display: block;
}

.hb-hero-stat-num {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1;
}

.hb-hero-stat-label {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 2px;
}

.hb-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.hb-hero-card {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-width: 200px;
  text-align: center;
}

.hb-hero-card-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.hb-hero-card-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.hb-hero-card-sub {
  font-size: 0.75rem;
  opacity: 0.75;
  margin-top: 2px;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.hb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.hb-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-800);
}

.hb-section-title-icon {
  width: 34px; height: 34px;
  background: var(--blue-pale);
  color: var(--blue);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}

.hb-section-link {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--blue);
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
}

.hb-section-link:hover { color: var(--blue-dark); }

/* ============================================================
   QUICK STATS (Dashboard Cards)
   ============================================================ */
.hb-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.hb-stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.hb-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hb-stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.hb-stat-icon.blue   { background: var(--blue-pale);  color: var(--blue); }
.hb-stat-icon.gold   { background: var(--gold-pale);  color: var(--gold-dark); }
.hb-stat-icon.green  { background: var(--green-pale); color: var(--green); }
.hb-stat-icon.gray   { background: var(--gray-100);   color: var(--gray-600); }

.hb-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}

.hb-stat-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 3px;
}

/* ============================================================
   BOOK CARDS — Grille principale
   ============================================================ */
.hb-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.hb-book-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.hb-book-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--blue-light);
}

.hb-book-cover {
  position: relative;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  overflow: hidden;
}

.hb-book-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hb-book-card:hover .hb-book-cover img {
  transform: scale(1.05);
}

.hb-book-cover-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.7);
  font-size: 2.5rem;
  gap: 8px;
}

.hb-book-cover-placeholder p {
  font-size: 0.7rem;
  text-align: center;
  padding: 0 10px;
  opacity: 0.7;
  font-size: 0.65rem;
  line-height: 1.3;
}

.hb-book-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--gold);
  color: var(--gray-900);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.hb-book-badge.new { background: var(--green); color: white; }
.hb-book-badge.free { background: var(--blue); color: white; }

.hb-book-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,57,110,.8) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.hb-book-card:hover .hb-book-overlay { opacity: 1; }

.hb-book-overlay-btn {
  width: 100%;
  padding: 8px;
  background: var(--gold);
  color: var(--gray-900);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.hb-book-info {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hb-book-category {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.hb-book-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hb-book-author {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hb-book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
}

.hb-book-pages {
  font-size: 0.7rem;
  color: var(--gray-400);
  display: flex; align-items: center; gap: 3px;
}

.hb-book-read-btn {
  padding: 4px 10px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.hb-book-read-btn:hover { background: var(--blue-dark); }

/* ============================================================
   MODAL LIVRE (Détail + Résumé)
   ============================================================ */
.hb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.hb-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.hb-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(.95) translateY(10px);
  transition: var(--transition);
}

.hb-modal-overlay.open .hb-modal {
  transform: scale(1) translateY(0);
}

.hb-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.hb-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.hb-modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  color: var(--gray-500);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.hb-modal-close:hover { background: var(--gray-200); color: var(--gray-800); }

.hb-modal-body {
  padding: 24px;
}

.hb-book-detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

.hb-book-detail-cover {
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  box-shadow: var(--shadow-md);
}

.hb-book-detail-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.hb-book-detail-meta { display: flex; flex-direction: column; }

.hb-book-detail-category {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.hb-book-detail-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.3;
  margin-bottom: 5px;
}

.hb-book-detail-author {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.hb-book-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.hb-book-detail-tag {
  display: flex; align-items: center; gap: 4px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.hb-book-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hb-btn-read {
  flex: 1;
  padding: 10px 16px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: var(--transition);
}

.hb-btn-read:hover { background: var(--blue-dark); }

.hb-btn-shop {
  padding: 10px 16px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: var(--transition);
}

.hb-btn-shop:hover { background: var(--green-dark); }

.hb-book-summary {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 18px;
  border-left: 4px solid var(--blue);
}

.hb-book-summary h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}

.hb-book-summary p {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.75;
}

/* ============================================================
   FILTRES CATALOGUE
   ============================================================ */
.hb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.hb-filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  transition: var(--transition);
}

.hb-filter-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.hb-filter-chip.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

/* ============================================================
   PLANS D'ABONNEMENT
   ============================================================ */
.hb-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.hb-plan-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  border: 2px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.hb-plan-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-blue);
  transform: translateY(-4px);
}

.hb-plan-card.featured {
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 100%);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-blue);
  transform: translateY(-8px);
}

.hb-plan-badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--gray-900);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hb-plan-name {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  opacity: 0.7;
}

.hb-plan-card.featured .hb-plan-name { opacity: 0.8; }

.hb-plan-price {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--gray-900);
}

.hb-plan-card.featured .hb-plan-price { color: var(--gold-light); }

.hb-plan-price span {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.6;
}

.hb-plan-period {
  font-size: 0.78rem;
  opacity: 0.6;
  margin-bottom: 20px;
}

.hb-plan-features {
  list-style: none;
  margin-bottom: 24px;
  flex: 1;
}

.hb-plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.hb-plan-card.featured .hb-plan-features li {
  border-bottom-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.9);
}

.hb-plan-features li i {
  color: var(--green);
  font-size: 0.75rem;
  width: 16px;
  flex-shrink: 0;
}

.hb-plan-card.featured .hb-plan-features li i { color: var(--gold-light); }

.hb-plan-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.hb-plan-btn.outline {
  background: transparent;
  border: 2px solid var(--blue);
  color: var(--blue);
}

.hb-plan-btn.outline:hover {
  background: var(--blue);
  color: white;
}

.hb-plan-btn.solid {
  background: var(--gold);
  color: var(--gray-900);
}

.hb-plan-btn.solid:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
}

/* ============================================================
   BOUTIQUE — SHOP
   ============================================================ */
.hb-shop-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}

.hb-shop-sidebar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  height: fit-content;
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
}

.hb-shop-sidebar h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 6px;
}

.hb-shop-filter-group {
  margin-bottom: 18px;
}

.hb-shop-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.hb-shop-filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--gray-600);
  transition: var(--transition);
}

.hb-shop-filter-option:hover { background: var(--blue-pale); color: var(--blue); }
.hb-shop-filter-option.active { background: var(--blue-pale); color: var(--blue); font-weight: 600; }

.hb-shop-filter-count {
  background: var(--gray-100);
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  color: var(--gray-500);
}

.hb-shop-main { flex: 1; }

.hb-shop-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hb-shop-sort {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 0.83rem;
  color: var(--gray-700);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.hb-shop-sort:focus { border-color: var(--blue); }

.hb-shop-count {
  font-size: 0.83rem;
  color: var(--gray-500);
  margin-left: auto;
}

/* Grille produits boutique */
.hb-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.hb-product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.hb-product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--green-light);
}

.hb-product-cover {
  position: relative;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  overflow: hidden;
}

.hb-product-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hb-product-card:hover .hb-product-cover img { transform: scale(1.05); }

.hb-product-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: rgba(255,255,255,.8);
  font-size: 2.5rem; gap: 8px;
}

.hb-product-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--error);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.hb-product-badge.artisanat { background: var(--gold); color: var(--gray-900); }
.hb-product-badge.pack { background: var(--green); }

.hb-product-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22,101,52,.85) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.hb-product-card:hover .hb-product-overlay { opacity: 1; }

.hb-product-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hb-product-category {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.hb-product-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hb-product-author {
  font-size: 0.73rem;
  color: var(--gray-400);
  margin-bottom: 10px;
}

.hb-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}

.hb-product-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gray-900);
}

.hb-product-price-currency {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gray-500);
}

.hb-product-stock {
  font-size: 0.7rem;
  color: var(--green);
}

.hb-product-stock.low { color: var(--warning); }

.hb-add-cart-btn {
  padding: 7px 12px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: var(--transition);
}

.hb-add-cart-btn:hover { background: var(--green-dark); }

/* ============================================================
   PANIER (CART)
   ============================================================ */
.hb-cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.hb-cart-items {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.hb-cart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex; align-items: center; gap: 8px;
  color: var(--gray-800);
}

.hb-cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}

.hb-cart-item:hover { background: var(--gray-50); }

.hb-cart-item-img {
  width: 60px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue));
  flex-shrink: 0;
}

.hb-cart-item-info { flex: 1 }

.hb-cart-item-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 2px;
}

.hb-cart-item-author {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.hb-cart-item-controls {
  display: flex; align-items: center; gap: 8px;
}

.hb-qty-btn {
  width: 26px; height: 26px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.hb-qty-btn:hover { border-color: var(--blue); color: var(--blue); }

.hb-qty-val {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-800);
  min-width: 24px;
  text-align: center;
}

.hb-cart-item-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gray-900);
  text-align: right;
}

.hb-cart-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}

.hb-cart-remove:hover { color: var(--error); background: var(--gray-100); }

.hb-cart-summary {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
}

.hb-cart-summary h3 {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 18px;
  color: var(--gray-800);
}

.hb-cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.875rem;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100);
}

.hb-cart-summary-row.total {
  padding-top: 14px;
  border-bottom: none;
  font-weight: 800;
  font-size: 1rem;
  color: var(--gray-900);
}

.hb-delivery-select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  color: var(--gray-700);
  background: white;
  margin-top: 12px;
  outline: none;
}

.hb-delivery-select:focus { border-color: var(--blue); }

.hb-checkout-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
}

.hb-checkout-btn:hover {
  background: linear-gradient(135deg, var(--green-dark), #14532d);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(22,163,74,.3);
}

/* ============================================================
   FORMULAIRE CHECKOUT
   ============================================================ */
.hb-checkout-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.hb-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.hb-form-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}

.hb-form-section:last-child { border-bottom: none; }

.hb-form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.hb-form-section-title i {
  width: 28px; height: 28px;
  background: var(--blue-pale);
  color: var(--blue);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
}

.hb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.hb-form-row.full { grid-template-columns: 1fr; }

.hb-form-group { display: flex; flex-direction: column; gap: 5px; }

.hb-form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
}

.hb-form-group input,
.hb-form-group select,
.hb-form-group textarea {
  padding: 9px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: var(--transition);
}

.hb-form-group input:focus,
.hb-form-group select:focus,
.hb-form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,.08);
}

.hb-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============================================================
   SECTIONS AUTH (Login / Inscription)
   ============================================================ */
.hb-auth-wrapper {
  max-width: 420px;
  margin: 0 auto;
}

.hb-auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  padding: 36px;
}

.hb-auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.hb-auth-logo img { height: 44px; margin: 0 auto 10px; }

.hb-auth-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 4px;
}

.hb-auth-sub {
  font-size: 0.83rem;
  color: var(--gray-500);
  text-align: center;
  margin-bottom: 26px;
}

.hb-auth-divider {
  text-align: center;
  color: var(--gray-400);
  font-size: 0.8rem;
  margin: 16px 0;
  position: relative;
}

.hb-auth-divider::before,
.hb-auth-divider::after {
  content: '';
  position: absolute;
  top: 50%; width: 38%;
  height: 1px;
  background: var(--gray-200);
}

.hb-auth-divider::before { left: 0; }
.hb-auth-divider::after  { right: 0; }

.hb-auth-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.hb-auth-submit:hover {
  background: linear-gradient(135deg, var(--blue-dark), #0d2d8c);
  transform: translateY(-1px);
  box-shadow: var(--shadow-blue);
}

.hb-auth-switch {
  text-align: center;
  font-size: 0.83rem;
  color: var(--gray-500);
  margin-top: 18px;
}

.hb-auth-switch a {
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================
   DASHBOARD UTILISATEUR
   ============================================================ */
.hb-dash-welcome {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, #2563EB 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: white;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.hb-dash-welcome h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.hb-dash-welcome p { opacity: 0.8; font-size: 0.9rem; }

.hb-dash-avatar {
  width: 64px; height: 64px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-full);
  border: 3px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.hb-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.hb-dash-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.hb-dash-card h4 {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}

/* ============================================================
   SUIVI COMMANDE
   ============================================================ */
.hb-order-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 24px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.hb-order-step {
  flex: 1;
  text-align: center;
  position: relative;
  min-width: 100px;
}

.hb-order-step::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.hb-order-step:last-child::before { display: none; }

.hb-order-step.done::before { background: var(--green); }

.hb-step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: white;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  font-size: 0.85rem;
  color: var(--gray-400);
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

.hb-order-step.done .hb-step-circle {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.hb-order-step.current .hb-step-circle {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: 0 0 0 4px rgba(26,86,219,.15);
}

.hb-step-label {
  font-size: 0.72rem;
  color: var(--gray-500);
  font-weight: 500;
}

.hb-order-step.done .hb-step-label { color: var(--green-dark); font-weight: 600; }
.hb-order-step.current .hb-step-label { color: var(--blue); font-weight: 700; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.hb-toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.hb-toast {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid var(--info);
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hb-toast.success { border-left-color: var(--success); }
.hb-toast.warning { border-left-color: var(--warning); }
.hb-toast.error   { border-left-color: var(--error); }

.hb-toast-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: var(--blue-pale);
  color: var(--info);
}

.hb-toast.success .hb-toast-icon { background: var(--green-pale);  color: var(--success); }
.hb-toast.warning .hb-toast-icon { background: #FFFBEB; color: var(--warning); }
.hb-toast.error   .hb-toast-icon { background: #FEF2F2; color: var(--error); }

.hb-toast-title {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.hb-toast-msg {
  font-size: 0.78rem;
  color: var(--gray-500);
  line-height: 1.4;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.hb-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.hb-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  opacity: 0.5;
}

.hb-empty h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.hb-empty p { font-size: 0.875rem; }

/* ============================================================
   BOTTOM NAVIGATION (mobile PWA)
   ============================================================ */
.hb-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  z-index: 1000;
  box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}

.hb-bottom-nav-inner {
  display: flex;
  height: 100%;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.hb-bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 0.62rem;
  font-weight: 500;
  padding: 6px 4px;
  transition: var(--transition);
  position: relative;
}

.hb-bnav-item.active {
  color: var(--blue);
}

.hb-bnav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  border-radius: 0 0 2px 2px;
}

.hb-bnav-icon {
  font-size: 1.1rem;
  position: relative;
}

.hb-bnav-badge {
  position: absolute;
  top: -4px; right: -8px;
  width: 16px; height: 16px;
  background: var(--gold);
  color: var(--gray-900);
  font-size: 0.58rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid white;
}

.hb-bnav-center {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(26,86,219,.3);
  margin-top: -16px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.hb-bnav-center:hover {
  transform: scale(1.05);
}

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.hb-pwa-banner {
  position: fixed;
  bottom: 70px; left: 12px; right: 12px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1500;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hb-pwa-banner.hidden { display: none; }

.hb-pwa-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.hb-pwa-text { flex: 1; }

.hb-pwa-text strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 2px;
}

.hb-pwa-text span {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.hb-pwa-install-btn {
  padding: 8px 16px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.hb-pwa-close {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }
.text-gold  { color: var(--gold-dark); }
.text-blue  { color: var(--blue); }
.text-green { color: var(--green); }
.text-gray  { color: var(--gray-500); }

.hb-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fade in page */
#content > * {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .hb-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hb-plans-grid { grid-template-columns: 1fr; gap: 14px; }
  .hb-plan-card.featured { transform: none; }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 260px;
    --topbar-h: 56px;
  }

  /* Sidebar masquée sur mobile, slide depuis la gauche */
  .hb-sidebar {
    transform: translateX(-100%);
    z-index: 1200;
    box-shadow: none;
  }

  .hb-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  /* Overlay sombre quand sidebar ouverte */
  .hb-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1100;
  }

  .hb-sidebar-overlay.open { display: block; }

  .hb-hamburger { display: flex; }

  .hb-topbar-brand span { display: none; }
  .hb-topbar-search { max-width: none; }

  .hb-main {
    margin-left: 0;
    padding: 16px;
    padding-bottom: 80px;
  }

  .hb-hero {
    padding: 28px 22px;
    border-radius: var(--radius-lg);
  }

  .hb-hero-inner { grid-template-columns: 1fr; }
  .hb-hero h1 { font-size: 1.7rem; }
  .hb-hero-visual { display: none; }
  .hb-hero-stats { gap: 16px; flex-wrap: wrap; }

  .hb-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .hb-books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .hb-shop-layout { grid-template-columns: 1fr; }
  .hb-shop-sidebar { display: none; }

  .hb-cart-layout { grid-template-columns: 1fr; }
  .hb-cart-summary { position: static; }

  .hb-checkout-grid { grid-template-columns: 1fr; }

  .hb-dash-grid { grid-template-columns: 1fr; }

  .hb-bottom-nav { display: block; }

  .hb-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
  }

  .hb-book-detail-grid { grid-template-columns: 100px 1fr; }
}

@media (max-width: 480px) {
  /* Masquer le texte des boutons topbar, garder uniquement les icônes */
  .hb-topbar-btn span { display: none; }
  .hb-topbar-btn { padding: 0 10px; min-width: 36px; justify-content: center; gap: 0; }
  /* Masquer la barre de recherche sur très petits écrans */
  .hb-topbar-search { display: none; }
  .hb-hero h1 { font-size: 1.5rem; }
  .hb-stats-grid { grid-template-columns: 1fr 1fr; }
  .hb-plans-grid { grid-template-columns: 1fr; }

  /* Formulaires auth — éviter le débordement sur mobile */
  .hb-form-row { grid-template-columns: 1fr; }
  .hb-auth-card { padding: 24px 16px; }
  .hb-auth-wrapper { padding: 12px 8px !important; }
}

/* PWA standalone mode */
@media (display-mode: standalone) {
  .hb-topbar { padding-top: env(safe-area-inset-top, 0); height: calc(var(--topbar-h) + env(safe-area-inset-top, 0)); }
  .hb-sidebar { top: calc(var(--topbar-h) + env(safe-area-inset-top, 0)); }
  .hb-main { margin-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0)); }
  .hb-bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0); height: calc(60px + env(safe-area-inset-bottom, 0)); }
}
