/**
 * Melanin Stories — assets/css/components/shop.css
 *
 * Boutique « Pharmacopée africaine » : hero, barre de recherche/filtres
 * collante, grille de produits, bloc de transparence.
 * Grille : 2 colonnes (mobile) → 3 (tablette) → 4 (ordinateur).
 */

[hidden] { display: none !important; }

/* ---------- Hero ---------- */
.ms-shop-hero {
  padding: 48px 0 34px;
  text-align: center;
}
.ms-shop-hero h1 {
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: clamp(34px, 7vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.ms-shop-hero h1 em { font-style: italic; color: var(--ms-green); }
.ms-shop-hero__lead {
  max-width: 640px;
  margin: 0 auto;
  color: var(--ms-charcoal);
  font-size: 16px;
}
.ms-shop-hero__note {
  display: inline-block;
  margin-top: 20px;
  padding: 7px 12px;
  background: var(--ms-cream);
  border: 1px solid var(--ms-line);
  font-family: var(--ms-font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ms-charcoal);
}
.ms-shop-hero__note a { color: var(--ms-green); font-weight: 500; }

/* ---------- Barre recherche + filtres (collante) ---------- */
.ms-shop-toolbar {
  position: sticky;
  top: var(--ms-shop-top, 0px); /* ajusté par shop.js : juste sous l'en-tête collant du site */
  z-index: 20;
  background: var(--ms-paper);
  border-top: 1px solid var(--ms-line);
  border-bottom: 1px solid var(--ms-line);
}
.ms-shop-toolbar__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.ms-shop-search { position: relative; display: block; }
.ms-shop-search input[type="search"] {
  width: 100%;
  border: 1px solid var(--ms-ink);
  border-radius: 0;
  background: #fff;
  color: var(--ms-ink);
  padding: 11px 14px 11px 40px;
  font-family: var(--ms-font-body);
  font-size: 16px; /* 16px : évite le zoom automatique sur iPhone */
  -webkit-appearance: none;
  appearance: none;
}
.ms-shop-search input[type="search"]:focus { outline: 2px solid var(--ms-gold); outline-offset: 1px; }
.ms-shop-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--ms-charcoal);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}
.ms-shop-search .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ms-shop-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ms-shop-chips::-webkit-scrollbar { display: none; }
.ms-shop-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--ms-ink);
  border-radius: 0;
  background: transparent;
  color: var(--ms-ink);
  font-family: var(--ms-font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.ms-shop-chip:hover { background: var(--ms-cream); }
.ms-shop-chip.is-active { background: var(--ms-ink); color: var(--ms-paper); }
.ms-shop-chip__n { margin-left: 5px; opacity: 0.55; }

@media (min-width: 900px) {
  .ms-shop-toolbar__inner { flex-direction: row; align-items: center; }
  .ms-shop-search { flex: 0 0 300px; }
  .ms-shop-chips { flex: 1; flex-wrap: wrap; overflow: visible; }
}

/* ---------- Catégories ---------- */
.ms-shop-catalog { padding-bottom: 20px; }
.ms-shop-cat { padding-top: 42px; scroll-margin-top: calc(var(--ms-shop-top, 0px) + 130px); }
.ms-shop-cat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--ms-ink);
}
.ms-shop-cat__head h2 {
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: clamp(24px, 4.5vw, 34px);
  line-height: 1.1;
}
.ms-shop-cat__count {
  font-family: var(--ms-font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ms-charcoal);
  white-space: nowrap;
}
.ms-shop-cat__intro {
  max-width: 680px;
  margin: 10px 0 22px;
  color: var(--ms-charcoal);
  font-size: 14.5px;
}

/* ---------- Grille ---------- */
.ms-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 640px) {
  .ms-shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 1024px) {
  .ms-shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
}

/* ---------- Carte produit ---------- */
.ms-shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--ms-line);
  transition: transform 0.18s, box-shadow 0.18s;
}
.ms-shop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(26, 20, 16, 0.1);
}
.ms-shop-card__img {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ms-cream);
}
.ms-shop-card__imglink {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.ms-shop-card__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ms-shop-card__ph {
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: 64px;
  line-height: 1;
  color: var(--ms-ink);
  opacity: 0.3;
}
.ms-shop-card.is-unavailable .ms-shop-card__img img { filter: grayscale(0.7); opacity: 0.75; }

.ms-shop-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 8px;
  background: var(--ms-gold);
  color: var(--ms-ink);
  font-family: var(--ms-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ms-shop-badge--off { background: var(--ms-charcoal); color: var(--ms-paper); }

.ms-shop-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 14px;
}
.ms-shop-card__brand {
  font-family: var(--ms-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ms-charcoal);
}
.ms-shop-card__name {
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  color: var(--ms-ink);
}
.ms-shop-card__desc {
  display: none;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ms-charcoal);
}
@media (min-width: 640px) {
  .ms-shop-card__body { padding: 14px 14px 16px; }
  .ms-shop-card__name { font-size: 17px; }
  .ms-shop-card__desc { display: block; }
}

.ms-shop-card__foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
}
.ms-shop-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: 20px;
}
.ms-shop-card__amt { white-space: nowrap; }
.ms-shop-card__price small {
  font-family: var(--ms-font-mono);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ms-charcoal);
}

.ms-shop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 11px 8px;
  background: var(--ms-green);
  color: var(--ms-paper);
  font-family: var(--ms-font-mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
.ms-shop-btn:hover,
.ms-shop-btn:focus-visible { background: var(--ms-gold); color: var(--ms-ink); }
.ms-shop-btn.is-disabled {
  background: #d9d0bc;
  color: var(--ms-charcoal);
  cursor: not-allowed;
}
.ms-shop-btn.is-disabled:hover { background: #d9d0bc; color: var(--ms-charcoal); }
@media (min-width: 640px) {
  .ms-shop-btn { font-size: 11.5px; letter-spacing: 0.07em; }
}

/* ---------- Aucun résultat ---------- */
.ms-shop-empty {
  display: none;
  padding: 60px 16px;
  text-align: center;
  color: var(--ms-charcoal);
}
.ms-shop-empty.is-visible { display: block; }

/* ---------- Bloc transparence ---------- */
.ms-shop-disclosure {
  margin-top: 56px;
  padding: 34px 0 38px;
  background: var(--ms-ink);
  color: var(--ms-paper);
}
.ms-shop-disclosure .ms-eyebrow { color: var(--ms-gold); }
.ms-shop-disclosure h2 {
  font-family: var(--ms-font-display);
  font-weight: 600;
  font-size: clamp(22px, 4vw, 28px);
  margin-bottom: 14px;
}
.ms-shop-disclosure p {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: 14.5px;
  line-height: 1.65;
  color: rgba(250, 244, 230, 0.86);
}
.ms-shop-disclosure p strong { color: var(--ms-paper); }
.ms-shop-disclosure__amz {
  padding-left: 14px;
  border-left: 3px solid var(--ms-gold);
  font-style: italic;
}
