
  /* ============================================================
     HEADER PREMIUM — Mshop Gadget
     Variables héritées de la page produit :
     --accent:#eb1a61 | --dark:#111318 | --font:'DM Sans'
  ============================================================ */
  :root {
    --accent:      #eb1a61;
    --accent-soft: rgba(235,26,97,0.08);
    --dark:        #111318;
    --mid:         #555;
    --border:      #e8e8ec;
    --white:       #fff;
    --font:        'DM Sans', sans-serif;
    --font-display:'Playfair Display', serif;
    --header-h:    68px;
    --sheet-w:     420px;
    --radius:      14px;
    --radius-sm:   8px;
    --transition:  all 0.25s cubic-bezier(0.4,0,0.2,1);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  /* ===== TOPBAR ===== */
  .hdr {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(0,0,0,0.06);
    font-family: var(--font);
    transition: box-shadow 0.3s;
  }
  .hdr.scrolled { box-shadow: 0 1px 0 var(--border), 0 8px 32px rgba(0,0,0,0.1); }

  .hdr-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 32px;
  }

  /* ===== LOGO ===== */
  .hdr-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
  }
  .hdr-logo img { width: 36px; height: 36px; object-fit: contain; }
  .hdr-logo-name {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.3px;
  }
  .hdr-logo-name span { color: var(--accent); }

  /* ===== NAV ===== */
  .hdr-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
  }
  .hdr-nav a {
    position: relative;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--mid);
    text-decoration: none;
    border-radius: 50px;
    transition: var(--transition);
  }
  .hdr-nav a:hover { color: var(--dark); background: #f5f5f7; }
  .hdr-nav a.active {
    color: var(--accent);
    background: var(--accent-soft);
  }
  .hdr-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
  }

  /* ===== ACTIONS (icônes droite) ===== */
  .hdr-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .hdr-icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
  }
  .hdr-icon-btn:hover { background: #f5f5f7; }
  .hdr-icon-btn svg { display: block; }

  /* Badge compteur */
  .hdr-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--white);
  }
  .hdr-badge:empty { display: none; }

  /* Divider vertical */
  .hdr-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
  }

  /* ===== HAMBURGER (mobile) ===== */
  .hdr-burger {
    display: none;
  }

  /* ===== OVERLAY commun ===== */
  .sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
  }
  .sheet-overlay.open { opacity: 1; pointer-events: auto; }

  /* ===== SHEET BASE ===== */
  .sheet {
    position: fixed;
    top: 0;
    bottom: 0;
    width: var(--sheet-w);
    max-width: 100vw;
    background: var(--white);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    height: 100vh; /* hauteur totale écran */
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -20px 0 60px rgba(0,0,0,0.12);
  }
  .sheet-right { right: 0; transform: translateX(100%); }
  .sheet-left  { left:  0; transform: translateX(-100%); box-shadow: 20px 0 60px rgba(0,0,0,0.12); }
  .sheet.open  { transform: translateX(0); }

  .sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
    min-height: 64px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0; /* ne rétrécit jamais */
  }
  .sheet-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--dark);
  }
  .sheet-title svg { color: var(--accent); }
  .sheet-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark);
  }
  .sheet-close:hover { background: #f5f5f7; border-color: #ccc; }

  /* ===== MOBILE MENU SHEET ===== */
  .mobile-sheet { width: 300px; }
  .mobile-sheet .sheet-body {
    padding: 16px 0;
    overflow-y: auto;
    flex: 1;
  }
  .mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--mid);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
  }
  .mobile-nav-item:hover { color: var(--dark); background: #f9f9fb; border-left-color: var(--border); }
  .mobile-nav-item.active { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); }
  .mobile-nav-item svg { flex-shrink: 0; opacity: 0.5; }
  .mobile-nav-item.active svg { opacity: 1; color: var(--accent); }
  .mobile-sheet-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mobile-auth-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700;
    cursor: pointer; text-decoration: none;
    transition: var(--transition);
    font-family: var(--font);
  }
  .mobile-auth-btn.login { background: var(--accent); color: #fff; border: none; }
  .mobile-auth-btn.login:hover { background: #c91554; }
  .mobile-auth-btn.logout { background: transparent; color: #e55; border: 1.5px solid #fdd; }
  .mobile-auth-btn.logout:hover { background: #fff5f5; }

  /* ===== CART SHEET ===== */
  .sheet-body.cart-sheet {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: block;
  }

  /* Panier vide */
  .cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 24px;
    text-align: center;
  }
  .cart-empty-icon {
    width: 80px; height: 80px;
    background: #f9f9fb;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #ddd;
  }
  .cart-empty h3 { font-size: 17px; font-weight: 700; color: var(--dark); }
  .cart-empty p  { font-size: 13px; color: #999; line-height: 1.5; }
  .cart-empty-cta {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 24px;
    background: var(--dark); color: #fff;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 700;
    text-decoration: none; transition: var(--transition);
    font-family: var(--font);
    margin-top: 4px;
  }
  .cart-empty-cta:hover { background: var(--accent); }

  /* Items panier */
  .cart-items { padding: 12px 16px; display: block; }
  .cart-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .cart-item:last-child { border-bottom: none; }
  .cart-item-img {
    width: 64px; height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: #f5f5f7;
  }
  .cart-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
  .cart-item-name {
    font-size: 13px; font-weight: 600; color: var(--dark);
    line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .cart-item-price { font-size: 14px; font-weight: 700; color: var(--accent); }
  .cart-item-qty {
    display: inline-flex; align-items: center; gap: 0;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; width: fit-content;
  }
  .cart-item-qty button {
    width: 28px; height: 28px;
    border: none; background: transparent;
    font-size: 15px; font-weight: 700;
    cursor: pointer; color: var(--mid);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
  }
  .cart-item-qty button:hover { background: var(--accent-soft); color: var(--accent); }
  .cart-item-qty span { font-size: 13px; font-weight: 700; padding: 0 10px; color: var(--dark); }
  .cart-item-remove {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none; background: transparent;
    cursor: pointer; color: #ccc;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); flex-shrink: 0; margin-top: 2px;
  }
  .cart-item-remove:hover { color: #e55; background: #fff5f5; }

  /* Résumé panier */
  .cart-summary {
    padding: 20px 20px 24px;
    border-top: 1px solid var(--border);
    background: #fafafa;
  }
  .cart-summary h5 { font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 14px; }
  .cart-summary-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
  .cart-summary-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: var(--mid);
  }
  .cart-summary-row.total { font-size: 16px; font-weight: 800; color: var(--dark); padding-top: 12px; border-top: 1.5px solid var(--border); }
  .cart-summary-row.total span:last-child { color: var(--accent); }

  /* Bouton commander */
  .cart-checkout-btn {
    width: 100%; padding: 14px;
    background: var(--accent); color: #fff;
    border: none; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: var(--transition);
    font-family: var(--font);
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .cart-checkout-btn:hover { background: #c91554; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(235,26,97,0.3); }

  /* Section paiement dans le panier */
  .cart-payment { padding: 20px 20px 40px; display: none; flex-direction: column; gap: 16px; }
  .cart-payment.open { display: flex; }
  .cart-payment h4 { font-size: 15px; font-weight: 700; color: var(--dark); }

  .form-field { display: flex; flex-direction: column; gap: 6px; }
  .form-field label { font-size: 12px; font-weight: 700; color: var(--mid); letter-spacing: 0.3px; }
  .form-field input[type=text] {
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-family: var(--font);
    outline: none; transition: var(--transition);
    background: var(--white);
  }
  .form-field input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

  /* Méthodes de paiement */
  .payment-methods { display: flex; gap: 10px; }
  .payment-method-card {
    flex: 1; cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 10px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: var(--transition); position: relative;
  }
  .payment-method-card input[type=radio] { display: none; }
  .payment-method-card img { width: 40px; height: 28px; object-fit: contain; }
  .payment-method-card span { font-size: 11px; font-weight: 600; color: var(--mid); text-align: center; }
  .payment-method-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
  .payment-method-card:has(input:checked) span { color: var(--accent); }
  .payment-method-card:has(input:checked)::after {
    content: '✓';
    position: absolute; top: 5px; right: 7px;
    font-size: 10px; font-weight: 900; color: var(--accent);
  }

  /* Mvola input */
  .mvola-box {
    background: #fffbf0;
    border: 1.5px solid #f0ad4e;
    border-radius: var(--radius-sm);
    padding: 14px;
    display: none;
    flex-direction: column; gap: 8px;
  }
  .mvola-box.open { display: flex; }
  .mvola-box label { font-size: 12px; font-weight: 700; color: #92600a; }
  .mvola-box input {
    padding: 10px 12px;
    border: 1.5px solid #f0c97a;
    border-radius: var(--radius-sm);
    font-size: 14px; font-family: var(--font);
    outline: none; background: #fff;
    transition: var(--transition);
  }
  .mvola-box input:focus { border-color: #f0ad4e; box-shadow: 0 0 0 3px rgba(240,173,78,0.15); }
  .mvola-box small { font-size: 11px; color: #b45309; line-height: 1.4; }

  /* Livraison info */
  .delivery-info { font-size: 12px; color: var(--accent); font-weight: 600; min-height: 16px; }

  /* Suggestions autocomplete */
  #suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 1300;
    max-height: 200px; overflow-y: auto;
  }
  #suggestions .suggestion-item {
    padding: 10px 14px;
    font-size: 13px; cursor: pointer; border-bottom: 1px solid #f5f5f7;
    transition: var(--transition);
  }
  #suggestions .suggestion-item:hover { background: var(--accent-soft); color: var(--accent); }

  /* Bouton final */
  .cart-final-btn {
    width: 100%; padding: 13px;
    background: var(--dark); color: #fff;
    border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700;
    cursor: pointer; transition: var(--transition);
    font-family: var(--font);
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .cart-final-btn:hover { background: var(--accent); }

  /* ===== DROPDOWN COMPTE ===== */
  .user-dropdown-wrap { position: relative; }
  .user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    z-index: 2000;
    overflow: hidden;
    transform: translateY(-8px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    transform-origin: top right;
  }
  .user-dropdown.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
  .user-dropdown-header {
    padding: 14px 16px;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
  }
  .user-dropdown-header p { font-size: 11px; color: #aaa; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
  .user-dropdown-header strong { font-size: 13px; color: var(--dark); font-weight: 700; display: block; margin-top: 2px; }
  .user-dropdown a, .user-dropdown button {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 11px 16px;
    font-size: 13px; font-weight: 500; color: var(--mid);
    text-decoration: none; background: transparent; border: none;
    cursor: pointer; font-family: var(--font);
    transition: var(--transition);
  }
  .user-dropdown a:hover, .user-dropdown button:hover { background: #f9f9fb; color: var(--dark); }
  .user-dropdown .logout-item { color: #e55; border-top: 1px solid var(--border); }
  .user-dropdown .logout-item:hover { background: #fff5f5; color: #c00; }
  .user-dropdown svg { opacity: 0.5; flex-shrink: 0; }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 900px) {
    .hdr-nav { display: none; }
    .hdr-burger { display: flex; }
    .hdr-logo-name { font-size: 16px; }
  }
  @media (max-width: 480px) {
    .hdr-inner { padding: 0 16px; gap: 8px; }
    .hdr-divider { display: none; }
  }
  .hdr-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
  .hdr-logo img { height: 60px; width: auto; } /* On force une taille plus généreuse */
  .hdr-logo-name { 
    font-size: 2.2rem; 
    font-weight: 800; 
    letter-spacing: -0.5px;
    color: #333;
  }
  .hdr-logo-name span { color: #E8014F; } /* Accentuation sur "Gadget" */

  @media (max-width: 768px) {

    .hdr-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px;
    }

    /* Logo — centré naturellement par flexbox */
    .hdr-logo {
        position: static;       /* ← annule l'absolute */
        transform: none;        /* ← annule le translateX */
        flex: 1;                /* ← prend l'espace disponible */
        display: flex;
        justify-content: center; /* ← centre le texte */
    }

    .hdr-logo img {
        display: none !important;
    }

    .hdr-logo-name {
        font-size: 1.5rem !important;
    }

    .hdr-actions {
        display: flex !important;
        align-items: center;
        gap: 4px;
    }

    .hdr-divider {
        display: none !important;
    }

    .user-dropdown-wrap,
    .hdr-actions > a[href*="login"] {
        display: none !important;
    }

    .hdr-actions > a[href*="favoris"],
    .hdr-actions > #btn-cart {
        display: flex !important;
        width: 38px;
        height: 38px;
        align-items: center;
        justify-content: center;
    }

    .hdr-actions > a[href*="favoris"] svg,
    .hdr-actions > #btn-cart svg {
        width: 18px;
        height: 18px;
    }
}
