/* ============================================================
   Kilokwa Market Place — Styles ESPACE CLIENT / CATALOGUE
   (complète style.css — ne le modifie pas)
   ============================================================ */

/* ---------- Header public : recherche + icônes ---------- */
.app-header .search-wrap {
  flex: 1; position: relative; min-width: 0;
}
.app-header .search-wrap input {
  width: 100%; border: none; border-radius: 24px; background: #fff;
  padding: 9px 14px 9px 40px; font-size: 14px; color: var(--text);
}
.app-header .search-wrap input:focus { outline: 2px solid var(--orange); }
.app-header .search-wrap .search-ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; pointer-events: none;
}
.app-header .header-action {
  color: #fff; font-size: 20px; position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; text-decoration: none;
}
.app-header .header-action .count {
  position: absolute; top: -4px; right: -6px; background: var(--orange); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 700;
}

/* ---------- Bannière promo ---------- */
.promo-banner {
  border-radius: var(--radius); color: #fff; overflow: hidden;
  background: linear-gradient(120deg, #FF6B00 0%, #ff9540 60%, #ffb56b 100%);
  display: flex; align-items: center; gap: 10px; padding: 22px 18px;
  box-shadow: var(--shadow-lg); position: relative; margin-bottom: 20px;
}
.promo-banner .promo-text { flex: 1; min-width: 0; }
.promo-banner h2 { color: #fff; font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.promo-banner p { opacity: .95; font-size: 14px; margin: 4px 0 12px; }
.promo-banner .promo-cta {
  display: inline-block; background: #fff; color: var(--orange); font-weight: 800;
  padding: 9px 20px; border-radius: 24px; font-size: 14px; box-shadow: 0 3px 10px rgba(0,0,0,.18);
  transition: .2s;
}
.promo-banner .promo-cta:hover { transform: translateY(-2px); }
.promo-banner .promo-img { font-size: 58px; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
@media (max-width: 420px) {
  .promo-banner h2 { font-size: 21px; }
  .promo-banner .promo-img { font-size: 44px; }
}

/* ---------- Pastilles catégories ---------- */
.cats-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px;
  scrollbar-width: none; margin-bottom: 6px;
}
.cats-scroll::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 10px; min-width: 84px; text-align: center; color: var(--text);
  transition: .15s; border: 1.5px solid transparent;
}
.cat-pill:hover { border-color: var(--blue-light); transform: translateY(-2px); }
.cat-pill .cat-ico { font-size: 26px; display: block; margin-bottom: 6px; }
.cat-pill .cat-name { font-size: 12px; font-weight: 600; color: var(--blue); line-height: 1.25; display: block; }

/* ---------- Grille produits / cartes ---------- */
.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 18px 0 12px;
}
.section-title h2 { font-size: 18px; margin: 0; }
.section-title .see-all { font-size: 13px; font-weight: 600; color: var(--orange); }

.products-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 720px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; position: relative; display: flex; flex-direction: column;
  transition: .15s;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.product-card .p-photo { position: relative; display: block; background: #f4f6fa; }
.product-card .p-photo img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.product-card .p-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card .p-name {
  font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.product-card .p-shop { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .p-price { font-size: 15.5px; font-weight: 800; color: var(--orange); margin-top: auto; }
.product-card .p-rupture { font-size: 11px; font-weight: 700; color: var(--red); }

/* Cœur favori sur les cartes */
.fav-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.15);
  font-size: 16px; color: #b6bfd0; display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.active { color: var(--red); }
.fav-btn.pop { animation: favpop .3s; }
@keyframes favpop { 50% { transform: scale(1.35); } }

/* Suppression favoris (page favoris) */
.fav-remove-anim { transition: opacity .3s, transform .3s; opacity: 0; transform: scale(.85); }

/* ---------- Bouton "Voir plus" / fin de liste ---------- */
.load-more-wrap { text-align: center; margin: 18px 0 6px; }
.catalog-end { text-align: center; color: var(--muted); font-size: 13px; padding: 16px 0; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-state .big { font-size: 46px; display: block; margin-bottom: 10px; }

/* ---------- Fiche produit ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 14px; color: var(--blue); }

.gallery { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { width: 100%; flex-shrink: 0; scroll-snap-align: center; aspect-ratio: 1/1; object-fit: cover; background: #f4f6fa; }
.gallery .gal-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(0,0,0,.18);
  font-size: 17px; color: var(--blue); display: flex; align-items: center; justify-content: center;
}
.gallery .gal-prev { left: 10px; } .gallery .gal-next { right: 10px; }
.gallery-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0; background: #fff; }
.gallery-dots span { width: 7px; height: 7px; border-radius: 50%; background: #d4dbe8; transition: .2s; }
.gallery-dots span.on { background: var(--orange); width: 18px; border-radius: 5px; }

.pd-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.pd-name { font-size: 20px; margin-bottom: 6px; }
.pd-price { font-size: 24px; font-weight: 800; color: var(--orange); margin-bottom: 10px; }
.pd-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pd-desc { color: #374151; white-space: pre-line; }
.pd-vues { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* Carte boutique */
.shop-card { display: flex; gap: 14px; align-items: center; }
.shop-card .shop-logo {
  width: 62px; height: 62px; border-radius: 16px; object-fit: cover; flex-shrink: 0;
  border: 1.5px solid var(--border); background: #f4f6fa;
}
.shop-card .shop-name { font-weight: 800; color: var(--blue); font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop-card .shop-slogan { font-size: 13px; color: var(--muted); font-style: italic; }
.shop-card .shop-ville { font-size: 13px; color: var(--muted); }

/* Actions produit */
.pd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.share-row { display: flex; gap: 10px; }
.share-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 8px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--border); background: #fff; color: var(--blue); transition: .15s;
}
.share-btn:hover { background: var(--blue-light); }
.share-btn.share-wa { background: #25d366; border-color: #25d366; color: #fff; }
.share-btn.share-fb { background: #1877f2; border-color: #1877f2; color: #fff; }

/* ---------- Chat : liste conversations ---------- */
.convo-list { display: flex; flex-direction: column; gap: 10px; }
.convo-item {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 13px 14px; color: var(--text); transition: .15s;
}
.convo-item:hover { box-shadow: var(--shadow-lg); }
.convo-item img { width: 50px; height: 50px; border-radius: 14px; object-fit: cover; border: 1.5px solid var(--border); flex-shrink: 0; }
.convo-item .c-body { flex: 1; min-width: 0; }
.convo-item .c-name { font-weight: 700; color: var(--blue); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.convo-item .c-last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-item .c-time { font-size: 11px; color: var(--muted); flex-shrink: 0; text-align: right; }
.convo-badge {
  background: var(--orange); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 12px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Chat : fil de discussion ---------- */
.chat-thread { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 14px; }
.msg-row { display: flex; }
.msg-row.me { justify-content: flex-end; }
.msg-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px;
  background: #fff; color: var(--text); box-shadow: var(--shadow);
  border-bottom-left-radius: 4px; word-break: break-word; white-space: pre-line;
}
.msg-row.me .msg-bubble {
  background: var(--blue); color: #fff; border-radius: 16px; border-bottom-right-radius: 4px;
}
.msg-bubble .msg-time { display: block; font-size: 10.5px; opacity: .7; margin-top: 4px; text-align: right; }

.chat-input-bar {
  position: sticky; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 50;
  display: flex; gap: 8px; background: #fff; border-radius: 30px; padding: 8px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.chat-input-bar input {
  flex: 1; border: none; background: transparent; padding: 8px 10px; font-size: 15px; min-width: 0;
}
.chat-input-bar input:focus { outline: none; }
.chat-input-bar button {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--orange); color: #fff; font-size: 17px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.chat-input-bar button:hover { background: #e05e00; }

/* ---------- Profil client ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-avatar {
  width: 62px; height: 62px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; flex-shrink: 0;
}
.profile-head .ph-name { font-size: 18px; font-weight: 800; color: var(--blue); }
.profile-head .ph-info { font-size: 13px; color: var(--muted); }
