
/* ══ ICÔNE SACHET — Dessinée comme un vrai sachet africain ════════════════════ */
/* Utilisée via classe ms-sachet-svg inline dans les templates */
.ms-sachet-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
/* ═══════════════════════════════════════════════════════
   MARCHÉ SHOP — PUBLIC CSS v2
   Full-width, sidebar filtres, look application mobile
   ═══════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --ms-primary:    #E87722;
  --ms-primary-d:  #c55f0a;
  --ms-green:      #2D7D46;
  --ms-green-d:    #1a5c30;
  --ms-dark:       #1A1A1A;
  --ms-gray-100:   #F7F6F3;
  --ms-gray-200:   #EDEBE5;
  --ms-border:     #E0DDD5;
  --ms-text:       #2C2C2C;
  --ms-muted:      #777;
  --ms-radius-sm:  6px;
  --ms-radius:     12px;
  --ms-radius-lg:  18px;
  --ms-shadow:     0 2px 10px rgba(0,0,0,0.07);
  --ms-shadow-md:  0 4px 20px rgba(0,0,0,0.11);
  --ms-topbar-h:   56px;
  --ms-bottomnav-h:64px;
  --ms-sidebar-w:  260px;
  --ms-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Reset & base ───────────────────────────────────────── */
.ms-app-wrap *, .ms-app-wrap *::before, .ms-app-wrap *::after { box-sizing: border-box; }
.ms-app-wrap { font-family: var(--ms-font); color: var(--ms-text); background: var(--ms-gray-100); min-height: 100vh; }

/* ── Wrapper pleine largeur ─────────────────────────────── */
/* Neutralise les marges du thème WordPress */
.ms-app-wrap {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  position: relative;
}

/* ══ TOP BAR ═══════════════════════════════════════════════ */
.ms-topbar {
  position: sticky; top: 0; z-index: 200;
  background: var(--ms-dark);
  height: var(--ms-topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.ms-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ms-topbar-title {
  font-weight: 700; font-size: 1.1rem; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ms-filter-toggle {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: white; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; transition: background 0.15s;
}
.ms-filter-toggle:hover { background: rgba(255,255,255,0.2); }
.ms-topbar-sachet {
  position: relative; color: white; display: flex; align-items: center;
  padding: 8px; border-radius: 10px; transition: background 0.15s;
}
.ms-topbar-sachet:hover { background: rgba(255,255,255,0.1); }
/* Style icône sachet SVG */
.ms-sachet-svg { display: block; }
.ms-topbar-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--ms-primary); color: white;
  border-radius: 50%; width: 18px; height: 18px;
  font-size: 0.7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ms-dark);
}

/* ══ LAYOUT ════════════════════════════════════════════════ */
.ms-shop-layout {
  display: flex;
  min-height: calc(100vh - var(--ms-topbar-h));
  position: relative;
}

/* ══ SIDEBAR ═══════════════════════════════════════════════ */
.ms-sidebar {
  width: var(--ms-sidebar-w); flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--ms-border);
  position: sticky; top: var(--ms-topbar-h);
  height: calc(100vh - var(--ms-topbar-h));
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), width 0.3s;
}
.ms-sidebar-scroll {
  height: 100%; overflow-y: auto; padding: 0 0 30px;
  scrollbar-width: thin; scrollbar-color: var(--ms-border) transparent;
}
.ms-sidebar-header {
  display: none; /* masqué sur desktop */
  align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--ms-border);
  font-size: 1rem; font-weight: 700;
}
.ms-sidebar-close {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  color: var(--ms-muted); padding: 4px 8px; border-radius: 6px;
}
.ms-sidebar-close:hover { background: var(--ms-gray-100); }

.ms-filter-section {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--ms-border);
}
.ms-filter-heading {
  display: block; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--ms-muted); margin-bottom: 10px;
}

/* Recherche */
.ms-search-wrap { position: relative; }
.ms-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ms-muted); pointer-events: none; }
.ms-search-input {
  width: 100%; padding: 9px 12px 9px 34px;
  border: 1.5px solid var(--ms-border); border-radius: var(--ms-radius-sm);
  font-size: 0.9rem; outline: none; transition: border-color 0.2s;
  background: var(--ms-gray-100);
}
.ms-search-input:focus { border-color: var(--ms-primary); background: white; }

/* Listes filtre */
.ms-cat-list, .ms-price-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ms-cat-btn, .ms-price-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border: none; background: transparent;
  border-radius: var(--ms-radius-sm); cursor: pointer; text-align: left;
  font-size: 0.88rem; color: var(--ms-text); transition: all 0.15s;
}
.ms-cat-btn:hover, .ms-price-btn:hover { background: var(--ms-gray-100); }
.ms-cat-btn.active, .ms-price-btn.active {
  background: #fff3e0; color: var(--ms-primary); font-weight: 700;
}
.ms-badge {
  background: var(--ms-gray-200); color: var(--ms-muted);
  border-radius: 50px; padding: 2px 7px; font-size: 0.75rem; font-weight: 600;
}
.ms-cat-btn.active .ms-badge { background: var(--ms-primary); color: white; }

/* Tri */
.ms-sort-select {
  width: 100%; padding: 9px 10px; border: 1.5px solid var(--ms-border);
  border-radius: var(--ms-radius-sm); font-size: 0.88rem; outline: none;
  background: var(--ms-gray-100); color: var(--ms-text); cursor: pointer;
}
.ms-sort-select:focus { border-color: var(--ms-primary); }

.ms-reset-all {
  display: block; width: calc(100% - 32px); margin: 16px;
  padding: 9px; border: 1.5px solid var(--ms-border); border-radius: var(--ms-radius-sm);
  background: white; color: var(--ms-muted); font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
}
.ms-reset-all:hover { border-color: var(--ms-primary); color: var(--ms-primary); }

/* Overlay mobile */
.ms-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 190; backdrop-filter: blur(2px);
}
.ms-overlay.show { display: block; }

/* ══ MAIN ══════════════════════════════════════════════════ */
.ms-main { flex: 1; min-width: 0; padding: 16px; }

/* Barre résultats */
.ms-results-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding: 10px 14px;
  background: white; border-radius: var(--ms-radius-sm);
  border: 1px solid var(--ms-border); font-size: 0.88rem; color: var(--ms-muted);
}
.ms-results-right { display: flex; align-items: center; gap: 10px; }
.ms-sort-inline {
  width: auto; padding: 6px 10px; font-size: 0.85rem;
}

/* ══ GRILLE PRODUITS ═══════════════════════════════════════ */
.ms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* ══ CARTE PRODUIT ═════════════════════════════════════════ */
.ms-card {
  background: white; border-radius: var(--ms-radius);
  border: 1px solid var(--ms-border); overflow: hidden;
  box-shadow: var(--ms-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.ms-card:hover { transform: translateY(-3px); box-shadow: var(--ms-shadow-md); }

.ms-card-img {
  position: relative;
  /* Ratio carré parfait sur tous les écrans */
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--ms-gray-100);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.ms-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ms-card-emoji { font-size: 3.5rem; line-height: 1; }
.ms-card-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.6); color: white;
  padding: 3px 9px; border-radius: 50px; font-size: 0.72rem; font-weight: 600;
  backdrop-filter: blur(4px);
}

.ms-card-content { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ms-card-name { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ms-dark); line-height: 1.3; }
.ms-card-desc { margin: 0; font-size: 0.82rem; color: var(--ms-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Chips de tas */
.ms-tas-wrap { margin-top: 2px; }
.ms-tas-intro { font-size: 0.78rem; font-weight: 600; color: var(--ms-muted); margin: 0 0 7px; text-transform: uppercase; letter-spacing: 0.5px; }
.ms-tas-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chip {
  position: relative; display: flex; flex-direction: column;
  padding: 7px 10px; border: 1.5px solid var(--ms-border); border-radius: 8px;
  cursor: pointer; transition: all 0.15s; min-width: 70px; flex: 1;
}
.ms-chip-radio { position: absolute; opacity: 0; width: 0; height: 0; }
.ms-chip:hover { border-color: var(--ms-primary); background: #fff8f3; }
.ms-chip-active { border-color: var(--ms-primary); background: #fff3e0; }
.ms-chip-name  { font-size: 0.82rem; font-weight: 600; color: var(--ms-text); }
.ms-chip-price { font-size: 0.9rem; font-weight: 800; color: var(--ms-primary); }
.ms-chip-sub   { font-size: 0.72rem; color: var(--ms-muted); }

/* Actions bas de carte */
.ms-card-actions { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }

/* Compteur centré sur sa propre ligne */
.ms-qty-row { display: flex; align-items: center; justify-content: center; }
.ms-qty {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ms-gray-100); border-radius: 50px; padding: 3px 4px;
}
.ms-q-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: white; box-shadow: var(--ms-shadow); cursor: pointer;
  font-size: 1rem; font-weight: 700; display: flex; align-items: center;
  justify-content: center; transition: all 0.15s; color: var(--ms-dark); flex-shrink: 0;
}
.ms-q-btn:hover { background: var(--ms-primary); color: white; box-shadow: none; }
.ms-q-input {
  width: 36px; text-align: center; border: none; background: transparent;
  font-size: 0.95rem; font-weight: 700; color: var(--ms-dark); outline: none;
}

/* Total sur sa propre ligne — jamais coupé */
.ms-card-subtotal {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 8px; background: var(--ms-gray-100); border-radius: 8px;
}
.ms-subtotal-label { font-size: 0.78rem; color: var(--ms-muted); font-weight: 500; }
.ms-subtotal-val {
  font-size: 1rem; font-weight: 800; color: var(--ms-green); white-space: nowrap;
}

.ms-add-btn {
  width: 100%; padding: 12px; border: none;
  background: var(--ms-primary); color: white;
  border-radius: var(--ms-radius-sm); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s; letter-spacing: 0.3px;
}
.ms-add-btn:hover  { background: var(--ms-primary-d); }
.ms-add-btn:active { transform: scale(0.98); }
.ms-no-tas { font-size: 0.85rem; color: var(--ms-muted); font-style: italic; text-align: center; padding: 10px 0; }

/* Pas de résultats -->*/
.ms-empty-state, .ms-no-results {
  grid-column: 1/-1; text-align: center; padding: 60px 20px;
  color: var(--ms-muted);
}
.ms-empty-state span, .ms-no-results span { font-size: 3.5rem; display: block; margin-bottom: 12px; }
.ms-no-results button {
  margin-top: 14px; padding: 10px 22px; background: var(--ms-primary); color: white;
  border: none; border-radius: 8px; cursor: pointer; font-weight: 600;
}

/* ══ BOTTOM NAV (mobile only) ══════════════════════════════ */
.ms-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--ms-dark);
  height: var(--ms-bottomnav-h);
  display: flex; align-items: center; justify-content: space-around;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.ms-bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: rgba(255,255,255,0.55); text-decoration: none; font-size: 0.68rem;
  font-weight: 600; padding: 6px 16px; border: none; background: none;
  cursor: pointer; transition: color 0.15s; letter-spacing: 0.3px;
}
.ms-bnav-item:hover, .ms-bnav-active { color: white !important; }
.ms-bnav-sachet-wrap { position: relative; display: inline-flex; }
.ms-bnav-badge {
  position: absolute; top: -4px; right: -8px;
  background: var(--ms-primary); color: white;
  border-radius: 50%; width: 16px; height: 16px;
  font-size: 0.65rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ══ PAGES SACHET / CHECKOUT / CONFIRMATION ════════════════ */
.ms-sachet-wrap, .ms-checkout-wrap, .ms-confirmation-wrap {
  max-width: 900px; margin: 0 auto; padding: 20px 16px 100px;
  font-family: var(--ms-font); color: var(--ms-text);
}
.ms-page-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 22px; color: var(--ms-dark); }

/* Boutons globaux */
.ms-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--ms-radius-sm);
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  text-decoration: none; border: 2px solid transparent; transition: all 0.2s;
  font-family: var(--ms-font);
}
.ms-btn-primary   { background: var(--ms-primary); color: white !important; }
.ms-btn-primary:hover { background: var(--ms-primary-d); color: white !important; }
.ms-btn-secondary { background: white; color: var(--ms-dark) !important; border-color: var(--ms-border); }
.ms-btn-secondary:hover { border-color: var(--ms-primary); color: var(--ms-primary) !important; }
.ms-btn-large { padding: 15px 28px; font-size: 1.05rem; width: 100%; justify-content: center; }

/* Sachet vide */
.ms-sachet-empty { text-align: center; padding: 60px 20px; }
.ms-sachet-empty span { font-size: 4rem; display: block; margin-bottom: 16px; }
.ms-sachet-empty p { font-size: 1.1rem; color: var(--ms-muted); margin-bottom: 20px; }

/* Items sachet */
.ms-sachet-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.ms-sachet-item {
  display: grid; grid-template-columns: 50px 1fr auto auto 32px; gap: 12px;
  align-items: center; padding: 14px 16px;
  background: white; border-radius: var(--ms-radius);
  border: 1px solid var(--ms-border); box-shadow: var(--ms-shadow);
}
.ms-item-image { font-size: 2rem; text-align: center; }
.ms-item-info h4 { margin: 0 0 3px; font-size: 0.95rem; font-weight: 700; }
.ms-item-tas   { display: block; font-size: 0.78rem; color: var(--ms-muted); }
.ms-item-prix  { display: block; font-size: 0.85rem; color: var(--ms-primary); font-weight: 600; margin-top: 2px; }
.ms-item-qty   { display: flex; align-items: center; gap: 6px; }
.ms-qty-btn    { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ms-border); background: white; cursor: pointer; font-weight: 700; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.ms-qty-btn:hover { background: var(--ms-primary); border-color: var(--ms-primary); color: white; }
.ms-qty-val    { font-weight: 800; min-width: 22px; text-align: center; font-size: 0.95rem; }
.ms-item-total { font-weight: 800; font-size: 0.95rem; color: var(--ms-green); text-align: right; white-space: nowrap; }
.ms-item-remove { background: none; border: none; color: #ccc; font-size: 1.1rem; cursor: pointer; padding: 4px; border-radius: 50%; }
.ms-item-remove:hover { color: #e53935; background: #ffebee; }

/* Récap sachet */
.ms-sachet-recap {
  background: white; border-radius: var(--ms-radius); border: 1px solid var(--ms-border);
  padding: 18px; margin-bottom: 18px;
}
.ms-recap-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ms-border); font-size: 0.95rem; }
.ms-recap-row:last-child { border: none; }
.ms-recap-total { font-size: 1.15rem; font-weight: 800; color: var(--ms-dark); }
.ms-sachet-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Checkout */
.ms-checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
@media (max-width: 768px) { .ms-checkout-layout { grid-template-columns: 1fr; } }
.ms-form-section { background: white; border-radius: var(--ms-radius); border: 1px solid var(--ms-border); padding: 18px; margin-bottom: 16px; }
.ms-form-section h3 { margin: 0 0 16px; font-size: 1rem; font-weight: 700; }
.ms-form-group { margin-bottom: 13px; }
.ms-form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 5px; color: #444; }
.ms-form-group input, .ms-form-group textarea, .ms-form-group select {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--ms-border); border-radius: var(--ms-radius-sm);
  font-size: 0.92rem; outline: none; transition: border-color 0.2s; font-family: var(--ms-font); box-sizing: border-box;
}
.ms-form-group input:focus, .ms-form-group textarea:focus, .ms-form-group select:focus { border-color: var(--ms-primary); }
.required { color: var(--ms-primary); }

.ms-payment-methods { display: flex; flex-direction: column; gap: 8px; }
.ms-payment-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--ms-border); border-radius: 10px; cursor: pointer; transition: all 0.15s;
}
.ms-payment-option:has(input:checked) { border-color: var(--ms-primary); background: #fff8f3; }
.ms-pay-icon   { font-size: 1.5rem; }
.ms-pay-label  { font-weight: 600; font-size: 0.9rem; flex: 1; }
.ms-pay-numero { font-size: 0.82rem; color: var(--ms-muted); font-family: monospace; }

.ms-order-recap { background: white; border-radius: var(--ms-radius); border: 1px solid var(--ms-border); padding: 18px; position: sticky; top: 76px; }
.ms-order-recap h3 { margin: 0 0 14px; font-size: 1rem; }
.ms-recap-item { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ms-border); font-size: 0.85rem; }
.ms-recap-item-name { min-width: 0; }
.ms-recap-item-name small { display: block; color: var(--ms-muted); font-size: 0.78rem; }
.ms-recap-item-qty  { color: var(--ms-muted); font-size: 0.82rem; }
.ms-recap-item-price { font-weight: 700; white-space: nowrap; }
.ms-recap-divider { border-top: 2px solid var(--ms-border); margin: 10px 0; }
.ms-recap-total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.9rem; }
.ms-recap-grand-total { font-size: 1.1rem; color: var(--ms-primary); font-weight: 800; border-top: 2px solid var(--ms-border); margin-top: 6px; padding-top: 10px; }
.ms-livraison-row { color: var(--ms-muted); font-size: 0.85rem; }
.ms-error-msg { color: #e53935; padding: 10px 14px; margin-top: 10px; background: #ffebee; border-radius: 8px; font-size: 0.9rem; }

/* Confirmation */
.ms-confirmation-success { text-align: center; padding: 40px 20px; }
.ms-success-icon { font-size: 5rem; display: block; margin-bottom: 14px; }
.ms-confirmation-success h2 { font-size: 1.7rem; color: var(--ms-green); margin: 0 0 10px; }
.ms-confirm-ref { font-size: 1rem; background: var(--ms-gray-100); padding: 10px 20px; border-radius: 8px; display: inline-block; font-weight: 700; }
.ms-confirm-msg { font-size: 0.95rem; color: var(--ms-muted); margin: 14px 0 0; }
.ms-payment-instructions { background: white; border-radius: var(--ms-radius); padding: 18px; margin: 18px 0; border: 1px solid var(--ms-border); }
.ms-payment-instructions h3 { margin: 0 0 10px; }
.ms-order-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--ms-radius); overflow: hidden; box-shadow: var(--ms-shadow); }
.ms-order-table th, .ms-order-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--ms-border); }
.ms-order-table th { background: var(--ms-gray-100); font-weight: 700; font-size: 0.8rem; color: var(--ms-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.ms-order-total-row td { font-weight: 800; background: var(--ms-gray-100); }
.ms-delivery-info { background: white; border-radius: var(--ms-radius); border: 1px solid var(--ms-border); padding: 18px; margin: 18px 0; }
.ms-delivery-info h3 { margin: 0 0 12px; }
.ms-delivery-info p  { margin: 5px 0; font-size: 0.9rem; }
.ms-confirmation-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Toast */
.ms-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ms-dark); color: white;
  padding: 12px 22px; border-radius: 50px; font-weight: 600; font-size: 0.9rem;
  z-index: 9999; transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s;
  opacity: 0; pointer-events: none; white-space: nowrap; box-shadow: var(--ms-shadow-md);
}
.ms-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.ms-toast.success { background: var(--ms-green); }
.ms-toast.error   { background: #e53935; }

/* ══ RESPONSIVE ════════════════════════════════════════════ */

/* Tablette : sidebar réduite */
@media (max-width: 1024px) {
  :root { --ms-sidebar-w: 220px; }
  .ms-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* Mobile : sidebar drawer */
@media (max-width: 768px) {
  .ms-bottom-nav { display: flex; }
  .ms-main { padding: 12px 12px calc(var(--ms-bottomnav-h) + 20px); }

  /* Sidebar devient un drawer depuis la gauche */
  .ms-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 195;
    height: 100vh; width: min(85vw, 300px);
    transform: translateX(-110%);
    border-right: 1px solid var(--ms-border);
    box-shadow: var(--ms-shadow-md);
  }
  .ms-sidebar.open { transform: translateX(0); }
  .ms-sidebar-header { display: flex; }
  .ms-filter-toggle { display: none; } /* remplacé par bottom nav */

  /* Topbar mobile */
  .ms-topbar { padding: 0 12px; }
  .ms-topbar-title { font-size: 1rem; }

  /* Grille 2 colonnes sur mobile */
  .ms-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Carte mobile — image carrée automatique via aspect-ratio */
  .ms-card-content { padding: 10px; gap: 5px; }
  .ms-card-name { font-size: 0.88rem; }
  .ms-card-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.78rem; line-height: 1.4; }
  .ms-chip { padding: 5px 7px; min-width: 0; }
  .ms-chip-name { font-size: 0.75rem; }
  .ms-chip-price { font-size: 0.78rem; }
  .ms-chip-sub { display: none; }
  .ms-add-btn { padding: 9px 6px; font-size: 0.82rem; }
  .ms-tas-intro { display: none; }

  /* Sachet mobile */
  .ms-sachet-item { grid-template-columns: 40px 1fr; grid-template-rows: auto auto; gap: 8px; }
  .ms-item-qty   { grid-column: 2; }
  .ms-item-total { grid-column: 2; }
  .ms-item-remove { grid-row: 1; grid-column: 2; justify-self: end; }
}

/* Très petit (320px) */
@media (max-width: 380px) {
  .ms-grid { grid-template-columns: 1fr; }
}

/* Desktop : masquer le bouton filtre inline */
@media (min-width: 769px) {
  .ms-bottom-nav { display: none; }
  .ms-results-right .ms-sort-inline { display: block; }
}




/* ══ PAGINATION ════════════════════════════════════════════ */
.ms-pagination {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 24px 0 8px; justify-content: center;
}
.ms-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1.5px solid var(--ms-border); background: white;
  color: var(--ms-text); text-decoration: none; font-weight: 600; font-size: 0.88rem;
  transition: all 0.15s;
}
.ms-page-btn:hover { border-color: var(--ms-primary); color: var(--ms-primary); }
.ms-page-active {
  background: var(--ms-primary); border-color: var(--ms-primary);
  color: white !important; pointer-events: none;
}
.ms-page-info {
  font-size: 0.8rem; color: var(--ms-muted); margin-left: 8px;
}



/* ── Topbar page produit ─────────────────────────────────── */
.ms-produit-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--ms-border);
}
.ms-produit-back-btn {
  color: var(--ms-muted); text-decoration: none; font-size: 0.88rem; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 8px; border: 1.5px solid var(--ms-border);
  transition: all .15s; background: white;
}
.ms-produit-back-btn:hover { border-color: var(--ms-primary); color: var(--ms-primary); }

.ms-produit-sachet-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--ms-primary); color: white !important; text-decoration: none;
  padding: 8px 16px; border-radius: 50px; font-weight: 700; font-size: 0.88rem;
  transition: background .15s; position: relative;
}
.ms-produit-sachet-btn:hover { background: var(--ms-primary-d); }
.ms-produit-sachet-count {
  background: white; color: var(--ms-primary); border-radius: 50%;
  width: 20px; height: 20px; font-size: 0.72rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ══ PAGE PRODUIT ══════════════════════════════════════════ */
.ms-produit-page-wrap {
  max-width: 1000px; margin: 0 auto; padding: 20px 16px 80px;
  font-family: var(--ms-font);
}
.ms-breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--ms-muted); margin-bottom: 20px;
}
.ms-breadcrumb a { color: var(--ms-primary); text-decoration: none; }
.ms-breadcrumb a:hover { text-decoration: underline; }
.ms-breadcrumb-current { font-weight: 600; color: var(--ms-dark); }

.ms-produit-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start;
}
@media (max-width: 768px) {
  .ms-produit-layout { grid-template-columns: 1fr; gap: 20px; }
}

/* Galerie */
.ms-gallery-main {
  aspect-ratio: 1/1; border-radius: var(--ms-radius);
  overflow: hidden; background: var(--ms-gray-100);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ms-border);
}
.ms-gallery-main-img { width: 100%; height: 100%; object-fit: cover; }
.ms-gallery-emoji { font-size: 6rem; }
.ms-gallery-thumbs {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.ms-gallery-video { margin-top: 12px; }
.ms-gallery-video iframe, .ms-gallery-video video {
  width: 100%; aspect-ratio: 16/9; border-radius: 10px; border: none;
  display: block;
}
.ms-thumb {
  width: 70px; height: 70px; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--ms-border); cursor: pointer; transition: border-color .15s;
  flex-shrink: 0;
}
.ms-thumb:hover, .ms-thumb-active { border-color: var(--ms-primary); }
.ms-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Détails */
.ms-produit-page-cat {
  display: inline-block; background: var(--ms-gray-200); color: var(--ms-muted);
  padding: 3px 10px; border-radius: 50px; font-size: 0.78rem; font-weight: 600; margin-bottom: 10px;
}
.ms-produit-page-title {
  font-size: 1.7rem; font-weight: 800; color: var(--ms-dark); margin: 0 0 12px; line-height: 1.2;
}
.ms-produit-page-desc {
  font-size: 0.92rem; color: var(--ms-muted); line-height: 1.6; margin: 0 0 18px;
  /* Description complète, aucune limite de lignes */
  display: block; overflow: visible; -webkit-line-clamp: unset;
}
.ms-produit-section-title { font-size: 0.85rem; font-weight: 700; color: var(--ms-dark); margin: 0 0 10px; }
.ms-produit-tas-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ms-produit-chip {
  display: flex; flex-direction: column; padding: 10px 14px;
  border: 1.5px solid var(--ms-border); border-radius: 10px; cursor: pointer;
  transition: all .15s; min-width: 90px; flex: 1;
}
.ms-produit-chip input { display: none; }
.ms-produit-chip:hover { border-color: var(--ms-primary); background: #fff8f3; }
.ms-produit-chip-active { border-color: var(--ms-primary); background: #fff3e0; }
.ms-produit-chip-nom  { font-weight: 700; font-size: 0.9rem; }
.ms-produit-chip-prix { font-weight: 800; font-size: 1rem; color: var(--ms-primary); }
.ms-produit-chip-sub  { font-size: 0.75rem; color: var(--ms-muted); }

.ms-produit-add-section {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.ms-produit-qty { display: flex; align-items: center; gap: 8px; }
.ms-produit-total-wrap { display: flex; align-items: center; gap: 6px; }
.ms-produit-total-label { font-size: 0.85rem; color: var(--ms-muted); }
.ms-produit-total-val { font-size: 1.3rem; font-weight: 800; color: var(--ms-green); }

.ms-produit-add-btn {
  width: 100%; padding: 14px; font-size: 1.05rem; margin-bottom: 16px;
}
.ms-produit-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ms-muted); text-decoration: none; font-size: 0.85rem;
}
.ms-produit-back:hover { color: var(--ms-primary); }

/* Cartes cliquables */
.ms-card-img-link { display: block; text-decoration: none; }
.ms-card-name-link { text-decoration: none; color: inherit; }
.ms-card-name-link:hover .ms-card-name { color: var(--ms-primary); }

/* Print */
@media print {
  .ms-topbar, .ms-sidebar, .ms-bottom-nav, .ms-confirmation-actions { display: none !important; }
  .ms-shop-layout { display: block; }
}

/* Animation ajout sachet */
@keyframes ms-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(0.96); outline: 3px solid var(--ms-primary);} }
.ms-card-added { animation: ms-pulse 0.5s ease; }


/* ══════════════════════════════════════════════════════════
   MARCHÉ SHOP v11 — AJOUTS : galerie zoom, lightbox, marché
   ══════════════════════════════════════════════════════════ */

/* ── Wrapper zoom ── */
.ms-zoom-wrapper {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  cursor: zoom-in;
  display: block;
}
.ms-zoomable {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.12s ease;
  transform-origin: 50% 50%;
  will-change: transform;
}
/* Sur mobile : pas de zoom survol */
@media (hover: none) {
  .ms-zoom-wrapper { cursor: pointer; }
  .ms-zoomable { transform: none !important; transition: none !important; }
}

/* Badge "Zoom" — caché par défaut, visible au survol */
.ms-zoom-hint {
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
  line-height: 1;
}
.ms-gallery-main:hover .ms-zoom-hint { opacity: 1; }

/* Bouton plein écran */
.ms-gallery-fullscreen {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.55);
  border: none; border-radius: 8px;
  color: #fff;
  width: 36px; height: 36px;
  font-size: 1.1rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
  transition: background 0.15s;
  /* Assurer que le caractère unicode est visible quel que soit le thème */
  font-family: Arial, sans-serif;
}
.ms-gallery-fullscreen:hover { background: var(--ms-primary); }

/* Miniatures — amélioration boutons */
.ms-gallery-thumbs .ms-thumb {
  background: none;
  padding: 0;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.ms-gallery-thumbs .ms-thumb:hover { transform: scale(1.05); }

/* ── LIGHTBOX ── */
.ms-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
}
.ms-lightbox[hidden] { display: none; }

.ms-lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.93);
  cursor: pointer;
}
.ms-lightbox-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  max-width: 95vw; max-height: 95vh;
}
.ms-lightbox-img {
  max-width: 90vw; max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  display: block;
  transition: opacity 0.2s;
}
.ms-lightbox-close {
  position: fixed; top: 14px; right: 14px;
  background: rgba(0,0,0,0.75);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%; color: #fff;
  width: 48px; height: 48px;
  font-size: 1.4rem;
  font-weight: bold;
  font-family: Arial, sans-serif;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
  transition: background 0.15s;
}
.ms-lightbox-close:hover { background: var(--ms-primary); }
.ms-lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.6); border: none;
  color: #fff; font-size: 2.8rem; line-height: 1;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
  transition: background 0.15s, transform 0.15s;
}
.ms-lightbox-prev { left: 10px; }
.ms-lightbox-next { right: 10px; }
.ms-lightbox-nav:hover { background: var(--ms-primary); transform: translateY(-50%) scale(1.1); }

@keyframes ms-lightbox-in {
  from { opacity:0; transform:scale(0.92); }
  to   { opacity:1; transform:scale(1); }
}
.ms-lightbox:not([hidden]) .ms-lightbox-content {
  animation: ms-lightbox-in 0.22s ease;
}

@media (max-width: 600px) {
  .ms-lightbox-close { top: 8px; right: 8px; width: 42px; height: 42px; }
  .ms-lightbox-prev  { left: 4px; }
  .ms-lightbox-next  { right: 4px; }
}

/* ══════════════════════════════════════════════════════════
   BANNIÈRE MARCHÉ AFRICAIN
   ══════════════════════════════════════════════════════════ */
.ms-marche-banner {
  position: relative;
  background: linear-gradient(135deg, #8B1A1A 0%, #C0392B 35%, #E87722 65%, #D4AF37 100%);
  overflow: hidden;
  margin-bottom: 0;
  padding: 0;
}
.ms-marche-banner-body {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; gap: 12px; position: relative; z-index: 1;
}
.ms-marche-banner-text {
  display: flex; align-items: center; gap: 12px; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.ms-marche-icon { font-size: 2rem; flex-shrink: 0; }
.ms-marche-banner-title {
  margin: 0 0 2px; font-size: 1.2rem; font-weight: 800; color: #fff;
  letter-spacing: 0.02em;
}
.ms-marche-banner-sub {
  margin: 0; font-size: 0.82rem; color: rgba(255,255,255,0.85);
}

/* Fanions */
.ms-marche-flags {
  display: flex; gap: 4px; align-items: flex-end;
}
.ms-flag {
  width: 22px; height: 32px;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.ms-flag-r { background: #E53935; }
.ms-flag-y { background: #FDD835; }
.ms-flag-g { background: #43A047; }
.ms-flag-b { background: #1E88E5; }

/* Bande kente décorative sous la bannière */
.ms-kente-strip {
  position: absolute; bottom: 0; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(
    90deg,
    #E53935 0px, #E53935 20px,
    #FDD835 20px, #FDD835 40px,
    #43A047 40px, #43A047 60px,
    #1E88E5 60px, #1E88E5 80px
  );
  opacity: 0.7;
}

@media (max-width: 600px) {
  .ms-marche-banner-title { font-size: 1rem; }
  .ms-marche-banner-sub   { display: none; }
  .ms-marche-flags        { display: none; }
}

/* ══════════════════════════════════════════════════════════
   ÉTALS DE MARCHÉ (cards enrichies)
   ══════════════════════════════════════════════════════════ */
.ms-stall {
  position: relative;
  border-top: 5px solid var(--ms-primary) !important;
}
/* Couleurs alternées des auvents */
.ms-grid > article:nth-child(4n+1).ms-stall { border-top-color: #E87722 !important; }
.ms-grid > article:nth-child(4n+2).ms-stall { border-top-color: #D4AF37 !important; }
.ms-grid > article:nth-child(4n+3).ms-stall { border-top-color: #2D7D46 !important; }
.ms-grid > article:nth-child(4n+4).ms-stall { border-top-color: #C0392B !important; }

/* Sachet SVG dans la topbar — légèrement agrandi et redessiné -->
/* Le SVG existant est gardé, on améliore juste les couleurs du sachet */

/* ══ Sachet SVG réaliste (topbar + page produit) ══ */
/* Remplacement du SVG simple par un sachet wax via filter */
.ms-topbar-sachet svg path:first-child,
.ms-produit-sachet-btn svg path:first-child {
  filter: none;
}

/* Style du bouton "Ajouter au sachet" dans les cartes */
.ms-add-btn {
  background: linear-gradient(135deg, var(--ms-primary), #c55f0a) !important;
  box-shadow: 0 3px 10px rgba(232,119,34,0.35) !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
}
.ms-add-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 16px rgba(232,119,34,0.45) !important;
}

/* ── Page confirmation : état en attente de paiement ── */
.ms-confirmation-pending {
  text-align: center;
  background: #FFF8E1;
  border: 2px dashed #FFB300;
  border-radius: var(--ms-radius);
  padding: 28px 20px;
  margin-bottom: 20px;
}
.ms-pending-icon { font-size: 3rem; margin-bottom: 10px; }
.ms-confirmation-pending h2 { color: #E65100; margin: 0 0 8px; font-size: 1.4rem; }
.ms-confirmation-pending .ms-confirm-ref { color: var(--ms-muted); margin: 4px 0; }
.ms-confirmation-pending .ms-confirm-msg { color: var(--ms-text); margin: 8px 0 0; }
