/* NDOLI — cartes : produit, catégorie, boutique ; badges, prix, puces. */

/* ---------- Carte produit ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .product-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-5); } }

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--nd-border);
  border-radius: var(--radius-lg);
  background: var(--nd-white);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) ease;
}
.product-card__media {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 6px);
  background: var(--nd-white);
}
.product-card__image-link { display: block; aspect-ratio: 5 / 4; }
.product-card__media picture,
.product-card__img {
  width: 100%;
  height: 100%;
}
.product-card__img {
  object-fit: contain;
  transition: transform 320ms var(--ease-out);
}
.product-card__placeholder { display: grid; place-items: center; height: 100%; background: var(--nd-lavender-soft); color: var(--nd-primary); }
.product-card__body { display: flex; flex: 1; flex-direction: column; gap: 2px; padding: 10px 4px 2px; }
.product-card__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--nd-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}
.product-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg); }
.product-card__title a:focus-visible { outline: none; }
.product-card:has(.product-card__title a:focus-visible) { outline: 3px solid var(--nd-primary); outline-offset: 3px; }
.product-card__store { overflow: hidden; color: var(--nd-text-muted); font-size: var(--fs-xs); white-space: nowrap; text-overflow: ellipsis; }
.product-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-2);
}
.product-card__cart { position: relative; z-index: 2; }

@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-3px);
    border-color: var(--nd-lavender-strong);
    box-shadow: var(--shadow-card-hover);
  }
  .product-card:hover .product-card__img { transform: scale(1.02); }
}

/* Prix */
.price { display: grid; gap: 1px; min-width: 0; }
.price__current { color: var(--nd-primary); font-size: var(--fs-lg); font-weight: 700; line-height: 1.2; white-space: nowrap; }
.price__old { color: var(--nd-text-muted); font-size: var(--fs-xs); white-space: nowrap; }
.stock-out { color: var(--nd-text-muted); font-size: var(--fs-sm); font-weight: 500; }

@media (max-width: 639px) {
  .price__current { font-size: var(--fs-base); }
  .cart-btn { width: 40px; height: 40px; }
}

/* Petits téléphones (320–389 px) : prix au-dessus, bouton « Ajouter » pleine largeur */
@media (max-width: 389px) {
  .product-card__footer { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
  .product-card__cart .cart-btn { width: 100%; height: 40px; border-radius: var(--radius-sm); }
  .cart-btn__label { display: inline; }
}

/* Badges */
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.3;
}
.badge--promo { background: var(--nd-promo); color: var(--nd-white); }

/* ---------- Catégories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
@media (min-width: 768px) { .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .category-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-4); } }

.category-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 100%;
  min-height: 78px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--nd-border);
  border-radius: var(--radius-md);
  background: var(--nd-white);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) ease;
}
.category-card__media { flex-shrink: 0; width: 58px; height: 58px; }
.category-card__media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.category-card__text { display: grid; min-width: 0; }
.category-card__name { font-size: var(--fs-base); font-weight: 600; line-height: 1.3; }
.category-card__desc { overflow: hidden; color: var(--nd-text-muted); font-size: var(--fs-xs); white-space: nowrap; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) {
  .category-card:hover { border-color: var(--nd-primary); background: var(--nd-lavender-soft); }
  .category-card:hover .category-card__name { color: var(--nd-primary); }
}

/* Puces (mobile) */
.chip-row {
  display: none;
  gap: var(--sp-2);
  margin-inline: calc(var(--gutter) * -1);
  padding: 2px var(--gutter) 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row li { flex-shrink: 0; scroll-snap-align: start; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--nd-border);
  border-radius: var(--radius-pill);
  background: var(--nd-white);
  color: var(--nd-text);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.chip.is-active { border-color: transparent; background: var(--nd-gradient-accent); color: var(--nd-white); }

/* ---------- Boutiques ---------- */
.store-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-3);
}
@media (min-width: 640px) { .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .store-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-4); } }

.store-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--nd-border);
  border-radius: var(--radius-md);
  background: var(--nd-white);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) ease;
}
.store-card__logo {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--nd-lavender);
  color: var(--nd-primary);
}
.store-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.store-card__text { display: grid; flex: 1; min-width: 0; }
.store-card__name { display: flex; align-items: center; gap: 6px; font-size: var(--fs-base); font-weight: 600; }
.store-card__verified { width: 18px; height: 18px; color: var(--nd-white); fill: var(--nd-primary); stroke: var(--nd-white); }
.store-card__tagline { overflow: hidden; color: var(--nd-text-muted); font-size: var(--fs-xs); white-space: nowrap; text-overflow: ellipsis; }
.store-card__chevron { width: 20px; height: 20px; color: var(--nd-text-muted); transition: transform var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .store-card:hover { border-color: var(--nd-lavender-strong); box-shadow: var(--shadow-soft); }
  .store-card:hover .store-card__chevron { transform: translateX(3px); color: var(--nd-primary); }
}

/* Boutique de démonstration (stores.is_demo) : visible comme exemple, jamais achetable. */
.badge--demo { background: var(--nd-night); color: var(--nd-on-night); }
.store-show__demo { position: absolute; top: 10px; left: 10px; z-index: 1; }
.demo-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--nd-night); color: var(--nd-on-night); font-size: var(--fs-xs); font-weight: 600; vertical-align: middle; }
.demo-pill .icon { width: 14px; height: 14px; }
.demo-notice { margin: 0; }

/* Quantité minimale fixée par le vendeur */
.product-card__min { color: var(--nd-primary-ink); font-size: var(--fs-xs); font-weight: 600; }
.stock--min { color: var(--nd-primary-ink); }
