/* =========================================================
   KAIZEN STORE — styles (herite des variables de kaizen.css)
   ========================================================= */

.store-hero { padding-bottom: 0.5rem; }

/* Bandeau de confiance Tebex */
.store-trust {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.4);
  color: #aeb6ff;
  font-size: 0.82rem;
  letter-spacing: 0.6px;
}
.trust-badge strong { color: #fff; }
.trust-badge svg { color: #7c86ff; }
.trust-note { color: var(--k-muted); font-size: 0.8rem; max-width: 440px; text-align: center; }

/* ---- Layout : packages + panier ---- */
.store-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}
.store-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.8rem;
  align-items: start;
}

.store-status {
  padding: 2rem;
  text-align: center;
  color: var(--k-muted);
}
.store-status.store-error { color: #ff9d9d; }
.store-status a { color: var(--k-accent); }

.store-cat { margin-bottom: 2.2rem; }
.store-cat-title {
  margin: 0 0 1.1rem 0;
  font-size: 1.35rem;
  color: #fff;
  letter-spacing: 0.5px;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--k-border);
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

/* ---- Carte package ---- */
.pkg-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30, 33, 44, 0.9), rgba(18, 20, 28, 0.95));
  border: 1px solid var(--k-border);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.pkg-card:hover {
  transform: translateY(-5px);
  border-color: rgba(233, 79, 79, 0.5);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}
.pkg-media {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--k-border);
}
.pkg-media img { max-height: 100%; max-width: 100%; object-fit: contain; }
.pkg-body { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.2rem 1.2rem 1.2rem; }
.pkg-body h3 { margin: 0 0 0.5rem 0; font-size: 1.1rem; color: #fff; }
.pkg-desc {
  color: var(--k-muted);
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  flex: 1;
  max-height: 4.6em;
  overflow: hidden;
}
.pkg-desc * { font-size: inherit !important; color: inherit !important; margin: 0 0 0.3rem 0 !important; }
.pkg-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.pkg-price { font-size: 1.15rem; font-weight: 800; color: #fff; }
.pkg-add { padding: 0.5rem 1rem !important; font-size: 0.82rem !important; }

/* ---- Panier ---- */
.cart-panel {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--k-border);
  overflow: hidden;
}
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--k-border);
}
.cart-head h3 { margin: 0; font-size: 1.1rem; color: #fff; }
.cart-close { display: none; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; line-height: 1; }

.cart-link-btn {
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(88, 101, 242, 0.5);
  background: rgba(88, 101, 242, 0.14);
  color: #aeb6ff;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.cart-link-btn:hover { background: rgba(88, 101, 242, 0.24); }

.cart-items { flex: 1; max-height: 340px; overflow-y: auto; padding: 0.6rem 1.2rem; }
.cart-empty { color: var(--k-muted); font-size: 0.9rem; text-align: center; padding: 1.5rem 0; }
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.cart-item-name { color: #fff; font-size: 0.9rem; }
.cart-item-qty { color: var(--k-muted); font-size: 0.75rem; }
.cart-item-right { display: flex; align-items: center; gap: 0.6rem; }
.cart-item-price { color: #fff; font-size: 0.88rem; white-space: nowrap; }
.cart-item-remove { background: none; border: none; color: #ff8a8a; font-size: 1.2rem; cursor: pointer; line-height: 1; }

.cart-foot { padding: 1.1rem 1.2rem; border-top: 1px solid var(--k-border); }
.cart-total { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.cart-total span { color: var(--k-muted); font-size: 0.9rem; }
.cart-total strong { color: #fff; font-size: 1.3rem; }
.cart-checkout { width: 100%; justify-content: center; }
.cart-checkout:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.3); }
.cart-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.7rem 0 0 0;
  color: var(--k-muted);
  font-size: 0.74rem;
}
.cart-secure svg { color: #3ad07f; }

/* ---- FAB mobile ---- */
.cart-fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 260;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--k-accent), var(--k-accent-2));
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}
.cart-fab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--k-accent-2);
  font-size: 0.75rem;
  font-weight: 800;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.cart-overlay.show { opacity: 1; visibility: visible; }

/* ---- Modale lier compte ---- */

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .store-layout { grid-template-columns: 1fr; }
  .cart-fab { display: inline-flex; }
  .cart-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(360px, 88vw);
    border-radius: 0;
    transform: translateX(105%);
    transition: transform 0.3s ease;
    z-index: 300;
  }
  .cart-panel.open { transform: none; }
  .cart-close { display: block; }
  .cart-items { max-height: none; }
}

/* =====================  ONGLETS DE CATEGORIES  ===================== */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--k-border);
}
.cat-tab {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--k-border);
  background: rgba(255, 255, 255, 0.04);
  color: #d6d9e0;
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.cat-tab:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.cat-tab.active {
  background: linear-gradient(180deg, var(--k-accent), var(--k-accent-2));
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: 0 4px 14px rgba(233, 79, 79, 0.35);
}

/* La carte package est cliquable */
.pkg-card { cursor: pointer; }

/* =====================  POPUP DETAIL PACKAGE  ===================== */
.pkg-modal {
  position: fixed;
  inset: 0;
  z-index: 620;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  visibility: hidden;
}
.pkg-modal.open { visibility: visible; }
.pkg-modal-card {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow: hidden;
  border-radius: 18px;
  background: var(--k-panel-solid);
  border: 1px solid var(--k-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.pkg-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.pkg-modal-close:hover { background: rgba(233, 79, 79, 0.5); }
.pkg-modal-media {
  flex: 0 0 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid var(--k-border);
}
.pkg-modal-media img { max-width: 100%; max-height: 240px; object-fit: contain; }
.pkg-modal-body { flex: 1; padding: 1.8rem; overflow-y: auto; }
.pkg-modal-body h3 { margin: 0 0 0.4rem 0; color: #fff; font-size: 1.4rem; }
.pkg-modal-price { color: var(--k-accent); font-size: 1.3rem; font-weight: 800; margin-bottom: 1rem; }
.pkg-modal-desc { color: #d6d9e0; font-size: 0.92rem; line-height: 1.7; margin-bottom: 1.4rem; }
.pkg-modal-desc img { max-width: 100%; border-radius: 8px; }
.pkg-modal-add { width: 100%; justify-content: center; }

@media (max-width: 620px) {
  .pkg-modal-card { flex-direction: column; max-height: 90vh; overflow-y: auto; }
  .pkg-modal-media { flex: none; border-right: none; border-bottom: 1px solid var(--k-border); }
}

/* =====================  FINITIONS  ===================== */

/* Ancre de scroll sous la navbar fixe */
.store-main { scroll-margin-top: 96px; }
.store-cat  { scroll-margin-top: 96px; }

/* Tete Minecraft a cote du pseudo */

/* Emoji d'onglet */
.cat-emoji { font-size: 0.95em; }

/* Description : troncature propre avec "..." (2 lignes sur la carte) */
.pkg-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: none;
}
/* le contenu HTML injecte par Tebex doit s'inliner pour que l'ellipsis marche */
.pkg-desc p, .pkg-desc ul, .pkg-desc li, .pkg-desc div, .pkg-desc span {
  display: inline !important;
}
.pkg-desc br { display: none; }

/* Nom de package : une ligne max, ellipsis */
.pkg-body h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Ergonomie mobile ===== */
@media (max-width: 900px) {
  .cat-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.8rem;
    margin-bottom: 1.2rem;
  }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { white-space: nowrap; flex: 0 0 auto; font-size: 0.8rem; padding: 0.45rem 0.9rem; }
  .store-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.9rem; }
  .pkg-media { height: 110px; }
  .pkg-body { padding: 0.9rem; }
  .pkg-body h3 { font-size: 0.98rem; }
  .pkg-price { font-size: 1rem; }
  .store-main { scroll-margin-top: 80px; }
  .store-cat { scroll-margin-top: 80px; }
}

/* =====================  RETOUCHES  ===================== */

/* Lien vers la boutique Tebex classique (discret) */
.cart-tebex-link {
  display: block;
  margin: 0;
  padding: 0.6rem 1.2rem;
  border-bottom: 1px solid var(--k-border);
  color: var(--k-muted);
  font-size: 0.78rem;
  text-decoration: none;
  text-align: center;
  transition: color 0.18s ease, background 0.18s ease;
}
.cart-tebex-link:hover { color: #aeb6ff; background: rgba(88, 101, 242, 0.08); }

/* Flash du panier quand on ajoute (desktop) */
@keyframes cartFlash {
  0%   { box-shadow: 0 0 0 0 rgba(233, 79, 79, 0); }
  30%  { box-shadow: 0 0 0 3px rgba(233, 79, 79, 0.55); border-color: rgba(233,79,79,0.6); }
  100% { box-shadow: 0 0 0 0 rgba(233, 79, 79, 0); }
}
.cart-panel.flash { animation: cartFlash 0.7s ease; }

/* Item ajoute : petite apparition */
@keyframes cartItemIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.cart-item { animation: cartItemIn 0.28s ease; }

/* ===== Transition propre au clic sur une carte / ouverture popup ===== */
.pkg-card { transition: transform 0.18s ease, border-color 0.22s ease, box-shadow 0.22s ease; }
.pkg-card:active { transform: scale(0.98); }

.pkg-modal {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pkg-modal.open { opacity: 1; }
.pkg-modal-card {
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.24s cubic-bezier(.2,.7,.3,1), opacity 0.24s ease;
}
.pkg-modal.open .pkg-modal-card { transform: none; opacity: 1; }

/* même effet doux pour la modale pseudo */

/* Description carte : 1 seule ligne desormais (1re phrase) */
.pkg-desc {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* =====================  RETOUCHES 2  ===================== */

/* Bouton "retirer le compte" */

/* Lien Tebex classique : visible mais pas criard */
.cart-tebex-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0 0;
  padding: 0.6rem 0.9rem;
  border-radius: 9px;
  border: 1px solid rgba(88, 101, 242, 0.35);
  background: rgba(88, 101, 242, 0.1);
  color: #aeb6ff;
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.cart-tebex-link:hover { background: rgba(88, 101, 242, 0.2); transform: translateY(-1px); }
.tebex-dot { width: 7px; height: 7px; border-radius: 50%; background: #7c86ff; box-shadow: 0 0 8px rgba(124,134,255,0.9); }

/* Toast (messages d'erreur ergonomiques) */
.kz-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  z-index: 900;
  max-width: 90vw;
  padding: 0.85rem 1.3rem;
  border-radius: 12px;
  background: #14161f;
  border: 1px solid rgba(233, 79, 79, 0.5);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.kz-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* =====================  PANIER : QUANTITES  ===================== */
.cart-qty-ctrl { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.25rem; }
.qty-btn {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--k-border);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #fff; font-family: inherit; font-size: 0.85rem; line-height: 1; cursor: pointer;
}
.qty-btn:hover { background: rgba(233,79,79,0.25); border-color: var(--k-accent); }
.cart-item-qty { color: #fff; font-size: 0.82rem; min-width: 14px; text-align: center; }

/* Mentions legales dans le panier */
.cart-terms {
  margin: 0.8rem 0 0 0;
  color: #6f7686;
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
}
.cart-terms a { color: var(--k-muted); }
.cart-terms a:hover { color: var(--k-accent); }
.trust-note a { color: #aeb6ff; }

/* Actions de la popup */
.pkg-modal-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.pkg-modal-actions .btn-red { flex: 1; justify-content: center; }
.pkg-modal-actions .btn-ghost { flex: 1; justify-content: center; padding: 0.85rem 1rem; font-size: 0.9rem; }

/* =========================================================
   RESPONSIVE : TABLETTES & TELEPHONES
   ========================================================= */

/* Tablette : le panier passe en drawer des 980px */
@media (max-width: 980px) {
  .store-layout { grid-template-columns: 1fr; }
  .cart-fab { display: inline-flex; }
  .cart-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(370px, 90vw);
    border-radius: 0;
    border-top: none; border-bottom: none; border-right: none;
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(.2,.7,.3,1);
    z-index: 400;
    overflow-y: auto;
  }
  .cart-panel.open { transform: none; }
  .cart-close { display: block; }
  .cart-items { max-height: none; }
  .store-section { padding: 1.5rem 1.2rem 3rem 1.2rem; }
  .store-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
}

/* Telephone */
@media (max-width: 640px) {
  .store-hero { padding-top: 115px; }
  .store-hero .section-heading { font-size: 1.6rem; }
  .store-hero .section-sub { font-size: 0.9rem; }
  .trust-badge { font-size: 0.74rem; padding: 0.38rem 0.8rem; }
  .trust-note { font-size: 0.72rem; padding: 0 0.5rem; }

  .store-section { padding: 1.2rem 0.9rem 4.5rem 0.9rem; }
  .store-cat-title { font-size: 1.1rem; }

  /* 2 colonnes serrees, lisibles au pouce */
  .store-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .pkg-media { height: 96px; padding: 0.6rem; }
  .pkg-body { padding: 0.7rem 0.75rem 0.8rem 0.75rem; }
  .pkg-body h3 { font-size: 0.88rem; margin-bottom: 0.3rem; }
  .pkg-desc { font-size: 0.75rem; -webkit-line-clamp: 2; line-clamp: 2; margin-bottom: 0.6rem; }
  .pkg-foot { flex-direction: column; align-items: stretch; gap: 0.45rem; }
  .pkg-price { font-size: 0.95rem; text-align: center; }
  .pkg-add { width: 100%; padding: 0.5rem !important; font-size: 0.78rem !important; }

  /* Popup pleine largeur */
  .pkg-modal { padding: 0.8rem; }
  .pkg-modal-card { max-height: 92vh; }
  .pkg-modal-media { padding: 1rem; }
  .pkg-modal-media img { max-height: 150px; }
  .pkg-modal-body { padding: 1.2rem; }
  .pkg-modal-body h3 { font-size: 1.15rem; }
  .pkg-modal-desc { font-size: 0.86rem; }
  .pkg-modal-actions { flex-direction: column; }

  /* FAB plus accessible */
  .cart-fab { right: 14px; bottom: 14px; padding: 0.7rem 1rem; font-size: 0.92rem; }

  .kz-toast { bottom: 76px; font-size: 0.84rem; padding: 0.7rem 1rem; }
}

/* Tres petits ecrans : 1 colonne */
@media (max-width: 380px) {
  .store-grid { grid-template-columns: 1fr; }
  .pkg-media { height: 130px; }
}

/* =====================  MODALE PSEUDO  ===================== */
.link-modal {
  position: fixed;
  inset: 0;
  z-index: 640;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.link-modal.open { visibility: visible; opacity: 1; }
.link-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  border-radius: 18px;
  background: var(--k-panel-solid);
  border: 1px solid var(--k-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.24s cubic-bezier(.2,.7,.3,1), opacity 0.24s ease;
}
.link-modal.open .link-modal-card { transform: none; opacity: 1; }
.link-modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.link-modal-card h3 { margin: 0 0 0.7rem 0; color: #fff; font-size: 1.3rem; }
.link-modal-card p { color: var(--k-muted); font-size: 0.9rem; line-height: 1.65; margin: 0 0 1.2rem 0; }
.link-label { display: block; font-size: 0.72rem; letter-spacing: 1.4px; text-transform: uppercase; color: #9ca3b8; margin-bottom: 0.4rem; }
.link-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d0f15;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}
.link-input:focus { border-color: var(--k-accent); box-shadow: 0 0 0 3px rgba(233, 79, 79, 0.15); }
.link-error { color: #ff9d9d; font-size: 0.85rem; min-height: 1.1em; margin: 0.5rem 0 0 0 !important; }
.link-submit { width: 100%; justify-content: center; margin-top: 0.8rem; }
.link-fallback { margin: 1rem 0 0 0 !important; font-size: 0.78rem !important; text-align: center; }
.link-fallback a { color: var(--k-accent); }

/* =====================  PANNEAU DEBUG  ===================== */
.debug-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 950;
  width: min(460px, 92vw);
  max-height: 55vh;
  display: none;
  flex-direction: column;
  border-radius: 12px;
  background: #0b0d13;
  border: 1px solid var(--k-accent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.debug-panel.open { display: flex; }
.debug-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: rgba(233, 79, 79, 0.15);
  border-bottom: 1px solid var(--k-border);
  color: #fff; font-size: 0.85rem;
}
.debug-head button {
  margin-left: 0.4rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--k-border);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #fff; font-family: inherit; font-size: 0.75rem; cursor: pointer;
}
.debug-head button:hover { background: rgba(233,79,79,0.35); }
#debugLog {
  margin: 0;
  padding: 0.8rem;
  overflow: auto;
  color: #9fe6c0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* =====================  PRIX : police lisible  =====================
   Pixelify Sans rend les chiffres ambigus (8/9/3/5).
   Silkscreen garde l'esprit pixel avec des chiffres nets. */
.pkg-price,
.pkg-modal-price,
.cart-item-price,
.cart-total strong {
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.2px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pkg-price { font-size: 1.05rem; }
.pkg-modal-price { font-size: 1.3rem; }
.cart-item-price { font-size: 0.9rem; }
.cart-total strong { font-size: 1.25rem; }

@media (max-width: 640px) {
  .pkg-price { font-size: 0.95rem; }
}

/* =====================  HERO ALLEGE  ===================== */
.store-hero { padding-top: 120px; padding-bottom: 0; }
.store-hero .section-sub { margin-bottom: 0; }

/* Badge de confiance dans le panier */
.cart-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 0.8rem;
  background: rgba(88, 101, 242, 0.12);
  border-bottom: 1px solid rgba(88, 101, 242, 0.28);
  color: #aeb6ff;
  font-size: 0.76rem;
  letter-spacing: 0.4px;
}
.cart-trust strong { color: #fff; }
.cart-trust svg { color: #7c86ff; flex-shrink: 0; }

/* =========================================================
   BURGER & NAVBAR — page store et responsive general
   ========================================================= */
@media (max-width: 980px) {
  /* le FAB ne doit pas passer sous le menu mobile */
  .cart-fab { z-index: 240; }
  .mobile-nav { z-index: 500; }
}

@media (max-width: 640px) {
  /* Navbar : icones et burger bien cadres */
  .navbar-v2 { padding: 0 0.6rem; }
  .navbar-v2 .navbar-content {
    width: 100%;
    max-width: 100%;
    gap: 0.4rem;
    padding: 0.35rem 0.4rem 0.35rem 0.6rem;
    box-sizing: border-box;
  }
  .nav-brand img { height: 24px; }
  .navbar-actions { gap: 0.35rem; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 20px; height: 20px; padding: 3px; }
  .nav-cta { height: 34px; padding: 0 0.7rem; font-size: 0.72rem; letter-spacing: 0.8px; }
  .nav-cta .cart-icon { margin-right: 0.2rem; font-size: 0.9em; }

  .navbar-v2 .burger {
    display: flex;
    width: 34px; height: 34px;
    flex-shrink: 0;
    border: 1px solid var(--k-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
  }
  .navbar-v2 .burger span { width: 16px; height: 2px; margin: 2px 0; }
  .navbar-v2 .burger.open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
  .navbar-v2 .burger.open span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }

  /* Menu mobile : liens confortables */
  .mobile-nav .nav-link { font-size: 1.15rem; padding: 0.6rem 1.4rem; }
  .mobile-close { top: 14px; right: 14px; width: 40px; height: 40px; font-size: 1.7rem; }

  /* Hero store compact */
  .store-hero { padding-top: 105px; }
  .store-hero .section-heading { font-size: 1.5rem; }
  .store-hero .section-sub { font-size: 0.85rem; }
  .store-hero .section-kicker { font-size: 0.68rem; }
}

/* =====================  BOUTONS POPUP : plus compacts  ===================== */
.pkg-modal-actions .btn-red,
.pkg-modal-actions .btn-ghost {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.65rem 0.9rem !important;
  font-size: 0.88rem !important;
  letter-spacing: 0.8px;
  white-space: nowrap;       /* plus de texte sur 2 lignes */
  text-align: center;
}

/* =========================================================
   RESPONSIVE ITEMS — cartes propres, aucun debordement
   ========================================================= */

/* Tablette : 3 puis 2 colonnes regulieres */
@media (max-width: 980px) {
  .store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
}
@media (max-width: 780px) {
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Telephone : 1 carte par ligne, format horizontal compact */
@media (max-width: 560px) {
  .store-grid { grid-template-columns: 1fr; gap: 0.75rem; }

  .pkg-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: stretch;
  }
  .pkg-media {
    height: auto;
    min-height: 100%;
    padding: 0.6rem;
    border-bottom: none;
    border-right: 1px solid var(--k-border);
  }
  .pkg-media img { max-height: 84px; }

  .pkg-body {
    min-width: 0;               /* empeche tout debordement */
    padding: 0.75rem 0.85rem;
    justify-content: center;
  }
  .pkg-body h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }
  .pkg-desc { font-size: 0.76rem; -webkit-line-clamp: 2; line-clamp: 2; margin-bottom: 0.6rem; }

  .pkg-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .pkg-price { font-size: 0.95rem; text-align: left; }
  .pkg-add { width: auto; padding: 0.45rem 0.9rem !important; font-size: 0.78rem !important; flex-shrink: 0; }

  /* Popup : boutons empiles proprement */
  .pkg-modal-actions { flex-direction: column; }
  .pkg-modal-actions .btn-red,
  .pkg-modal-actions .btn-ghost { width: 100%; }
}

/* Tres petits ecrans : garder le format horizontal, image reduite */
@media (max-width: 380px) {
  .store-grid { grid-template-columns: 1fr; }
  .pkg-card { grid-template-columns: 78px minmax(0, 1fr); }
  .pkg-media img { max-height: 66px; }
  .pkg-body h3 { font-size: 0.88rem; }
  .pkg-desc { display: none; }   /* on garde l'essentiel : nom + prix */
}

/* =========================================================
   CORRECTIF DEBORDEMENT MOBILE
   Le panier ferme etait en position:fixed translateX(105%),
   donc hors ecran a droite -> scroll horizontal sur mobile.
   On le retire completement du flux quand il est ferme.
   ========================================================= */
@media (max-width: 980px) {
  .cart-panel {
    display: none;              /* ferme = pas rendu du tout */
    transform: none;
  }
  .cart-panel.open {
    display: flex;
    animation: cartSlideIn 0.28s cubic-bezier(.2,.7,.3,1);
  }
  @keyframes cartSlideIn {
    from { transform: translateX(100%); }
    to   { transform: none; }
  }
  /* pendant l'ouverture, on verrouille le scroll de la page */
  body.cart-open { overflow: hidden; }
}

/* Garde-fous : min-width uniquement (ne pas toucher aux max-width centres) */
.store-page { overflow-x: hidden; }
.store-layout,
.store-main,
.store-cat,
.store-grid { min-width: 0; box-sizing: border-box; }
/* on re-affirme la largeur centree du bloc boutique */
.store-section { max-width: 1200px; margin-inline: auto; box-sizing: border-box; }
.store-grid > * { min-width: 0; }
.pkg-card { max-width: 100%; overflow: hidden; }
.pkg-body, .pkg-foot, .pkg-media { min-width: 0; }
.pkg-body h3, .pkg-desc { overflow-wrap: anywhere; }
.pkg-media img, .pkg-modal-media img { max-width: 100%; height: auto; }

/* Onglets : scroll interne, jamais de debordement de page */
.cat-tabs { max-width: 100%; }

/* =========================================================
   PANIER MOBILE — regles definitives (surchargent tout)
   ========================================================= */
@media (max-width: 980px) {
  .cart-panel {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(360px, 88vw) !important;
    max-width: 88vw;
    height: 100%;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-left: 1px solid var(--k-border) !important;
    background: #14161f !important;      /* fond opaque, pas translucide */
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.6);
    z-index: 460 !important;
    overflow-y: auto;
    animation: none;
  }
  .cart-panel.open { display: flex !important; animation: cartSlideIn 0.28s cubic-bezier(.2,.7,.3,1); }

  .cart-overlay { z-index: 450; }
  .cart-close { display: block !important; }
  .cart-items { max-height: none !important; }
  .cart-fab { z-index: 240; }
}

/* =====================  PAIEMENTS RECENTS (preuve sociale)  ===================== */
.recent-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.8rem;
  margin-top: 1.2rem;
}
.recent-wrap::before { content: ''; }   /* colonne vide, aligne le bloc sous le panier */

.recent-card {
  padding: 1rem 1.1rem 0.9rem 1.1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--k-border);
}
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--k-border);
}
.recent-head h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  font-size: 0.9rem;
}
.recent-sub {
  color: #7c86ff;
  font-size: 0.68rem;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

/* Pastille "live" */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3ad07f;
  box-shadow: 0 0 0 0 rgba(58, 208, 127, 0.7);
  animation: livePulse 2s infinite;
  flex-shrink: 0;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(58, 208, 127, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(58, 208, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(58, 208, 127, 0); }
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  animation: recentIn 0.35s ease both;
}
.recent-item:last-child { border-bottom: none; }
@keyframes recentIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.recent-head-img {
  width: 26px; height: 26px;
  border-radius: 5px;
  image-rendering: pixelated;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}
.recent-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.recent-name {
  color: #fff; font-size: 0.82rem; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-pkg {
  color: var(--k-muted); font-size: 0.72rem; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-check { color: #3ad07f; font-size: 0.85rem; flex-shrink: 0; }

.recent-foot {
  margin: 0.7rem 0 0 0;
  color: #6f7686;
  font-size: 0.7rem;
  text-align: center;
}

@media (max-width: 980px) {
  .recent-wrap { grid-template-columns: 1fr; margin-top: 1.5rem; }
  .recent-wrap::before { display: none; }
}

/* =========================================================
   COLONNE LATERALE : panier + achats recents empiles
   ========================================================= */
.store-side {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
/* le panier n'est plus sticky lui-meme : c'est la colonne qui l'est */
.cart-panel { position: relative; top: auto; }

/* le bloc recent suit simplement le panier */
.recent-wrap {
  display: block;
  grid-template-columns: none;
  margin-top: 0;
  gap: 0;
}
.recent-wrap::before { display: none; }

@media (max-width: 980px) {
  /* le panier redevient un tiroir : la colonne ne doit plus le contraindre */
  .store-side { position: static; display: block; }
  .recent-wrap { margin-top: 1.5rem; }
}

/* =====================  MESSAGES DE LA MODALE  ===================== */
/* Texte d'erreur : plus lisible (clair, aere) */
.link-error {
  color: #ffb3b3;
  font-size: 0.85rem !important;
  line-height: 1.6;
  min-height: 0;
  margin: 0.7rem 0 0 0 !important;
}

/* Cas "achat unique deja possede" : ce n'est pas un bug -> ton informatif */
.link-error.is-notice {
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 176, 102, 0.1);
  border: 1px solid rgba(255, 176, 102, 0.35);
  color: #ffd7b0;
}
.link-error.is-notice::before {
  content: 'ℹ️ ';
}

.link-remove {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.link-remove:hover { background: rgba(233, 79, 79, 0.25); border-color: var(--k-accent); }

/* Texte de la modale : plus clair et plus aere */
.link-modal-card p { color: #c9cede !important; font-size: 0.92rem !important; line-height: 1.7 !important; }
.link-modal-card h3 { font-size: 1.35rem; }
.link-label { color: #b6bccb !important; }

/* =========================================================
   TIROIR MOBILE — correction du contexte d'empilement
   Le panier est dans <section> qui porte z-index:1, ce qui
   l'enfermait sous l'overlay et sous la navbar.
   ========================================================= */
@media (max-width: 980px) {
  /* la section ne doit plus creer de contexte d'empilement */
  body > .store-section,
  .store-section { z-index: auto !important; }

  /* le tiroir passe au-dessus de tout (navbar comprise) */
  .cart-panel { z-index: 620 !important; }
  .cart-overlay { z-index: 600 !important; }

  /* le scroll de la page est bien bloque, y compris sur iOS */
  body.cart-open { overflow: hidden !important; }
  /* mais le tiroir, lui, reste defilable */
  .cart-panel {
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  /* zone de clic confortable dans le tiroir */
  .cart-close { width: 40px; height: 40px; font-size: 1.9rem; }
  .qty-btn { width: 26px; height: 26px; font-size: 1rem; }
  .cart-item-remove { padding: 0 0.35rem; font-size: 1.4rem; }
  .cart-checkout { padding: 0.85rem 1.2rem !important; font-size: 1rem !important; }
}
