/* ════════════════════════════════════════════════════════════
   GRILLE PRODUITS — Style rhinoshield / Boturea
   Utilisé sur : catégories, boutique, best-sellers, recherche
   ════════════════════════════════════════════════════════════ */

/* ─── Wrapper ────────────────────────────────────────────────── */
.bpl-wrap {
  width: 100%;
  background: var(--gray);
}

/* ─── Toolbar (résultats + tri) ──────────────────────────────── */
.bpl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.bpl-count {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--muted);
}

.bpl-ordering select {
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--black);
  background: var(--white);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

/* ─── Grille produits ────────────────────────────────────────── */
.bpl-grid,
.bpl-wrap ul.products {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  background: var(--white);
  border-top: 1px solid var(--border);
}

/* ─── Carte produit ──────────────────────────────────────────── */
.bpl-card,
.bpl-wrap ul.products li.product {
  display: flex !important;
  flex-direction: column !important;
  background: var(--white) !important;
  border-right: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
}

.bpl-card:hover,
.bpl-wrap ul.products li.product:hover {
  background: #fafafa !important;
}

/* Enlever la bordure droite sur les derniers de chaque rangée */
.bpl-wrap ul.products li.product:nth-child(5n) { border-right: none !important; }

/* ─── Zone image ─────────────────────────────────────────────── */
.bpl-card__img,
.bpl-wrap ul.products li.product .woocommerce-LoopProduct-link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 28px 20px !important;
  background: var(--gray) !important;
  position: relative !important;
  overflow: hidden !important;
  text-decoration: none !important;
  aspect-ratio: 1 !important;
}

.bpl-wrap ul.products li.product img,
.bpl-card__img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1) !important;
  display: block !important;
}

.bpl-card:hover .bpl-card__img img,
.bpl-wrap ul.products li.product:hover img {
  transform: scale(1.06) translateY(-4px) !important;
}

/* ─── Bouton panier rapide ───────────────────────────────────── */
.bpl-add-btn {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 10 !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  text-decoration: none !important;
  color: var(--black) !important;
  opacity: 0 !important;
  transform: scale(0.8) !important;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.18s ease !important;
}

.bpl-card:hover .bpl-add-btn,
.bpl-wrap ul.products li.product:hover .bpl-add-btn {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.bpl-add-btn:hover {
  background: var(--g) !important;
  border-color: var(--g) !important;
  color: var(--white) !important;
}

.bpl-add-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* ─── Infos produit ──────────────────────────────────────────── */
.bpl-card__info {
  padding: 16px 18px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  border-top: 1px solid var(--border) !important;
}

.bpl-card__name,
.bpl-wrap ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-body) !important;
  font-size: 0.875rem !important;
  font-weight: var(--weight-semibold) !important;
  color: var(--black) !important;
  text-align: center !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-decoration: none !important;
  display: block !important;
}

.bpl-card__desc {
  font-family: var(--font-body) !important;
  font-size: 0.75rem !important;
  color: var(--muted) !important;
  text-align: center !important;
  line-height: 1.4 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.bpl-card__price,
.bpl-wrap ul.products li.product .price {
  font-family: var(--font-body) !important;
  font-size: 0.9rem !important;
  font-weight: var(--weight-semibold) !important;
  color: var(--g) !important;
  text-align: center !important;
  margin: 4px 0 0 !important;
  padding: 0 !important;
  display: block !important;
}

/* Cacher badge "Solde" WooCommerce */
.bpl-wrap .onsale { display: none !important; }

/* Cacher les boutons WooCommerce natifs dans la loop */
.bpl-wrap ul.products li.product .button,
.bpl-wrap ul.products li.product .add_to_cart_button {
  display: none !important;
}

/* ─── Pagination ─────────────────────────────────────────────── */
.bpl-pagination,
.bpl-wrap .woocommerce-pagination {
  padding: 32px 48px !important;
  display: flex !important;
  justify-content: center !important;
  background: var(--white) !important;
  border-top: 1px solid var(--border) !important;
}

.bpl-wrap .woocommerce-pagination ul {
  display: flex !important;
  gap: 6px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.bpl-wrap .woocommerce-pagination ul li a,
.bpl-wrap .woocommerce-pagination ul li span {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
  font-family: var(--font-body) !important;
  font-size: 0.875rem !important;
  font-weight: var(--weight-medium) !important;
  border: 1px solid var(--border) !important;
  color: var(--black) !important;
  text-decoration: none !important;
  transition: all 0.18s ease !important;
}

.bpl-wrap .woocommerce-pagination ul li a:hover,
.bpl-wrap .woocommerce-pagination ul li span.current {
  background: var(--g) !important;
  border-color: var(--g) !important;
  color: var(--white) !important;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .bpl-grid,
  .bpl-wrap ul.products { grid-template-columns: repeat(4, 1fr) !important; }
  .bpl-wrap ul.products li.product:nth-child(5n) { border-right: 1px solid var(--border) !important; }
  .bpl-wrap ul.products li.product:nth-child(4n) { border-right: none !important; }
}

@media (max-width: 900px) {
  .bpl-toolbar { padding: 14px 20px; }
  .bpl-grid,
  .bpl-wrap ul.products { grid-template-columns: repeat(3, 1fr) !important; }
  .bpl-wrap ul.products li.product:nth-child(4n) { border-right: 1px solid var(--border) !important; }
  .bpl-wrap ul.products li.product:nth-child(3n) { border-right: none !important; }
}

@media (max-width: 640px) {
  .bpl-grid,
  .bpl-wrap ul.products { grid-template-columns: repeat(2, 1fr) !important; }
  .bpl-wrap ul.products li.product:nth-child(3n) { border-right: 1px solid var(--border) !important; }
  .bpl-wrap ul.products li.product:nth-child(2n) { border-right: none !important; }
  .bpl-pagination, .bpl-wrap .woocommerce-pagination { padding: 24px 20px !important; }
}
