/* ==============================================
   Lilith Paris - Product Grid (style Sessun)
   v1.3 - arrows + cart feedback
   ============================================== */

/* --- Reset card --- */
ul.products .entry.product {
  border-radius: 0 !important;
  overflow: visible;
  position: relative;
  border: none !important;
  box-shadow: none !important;
}

/* --- Image wrapper --- */
ul.products .entry.product .woocommerce-loop-image-link,
ul.products .entry.product .woocommerce-loop-image-link img,
ul.products .entry.product .wpcbm-wrapper {
  border-radius: 0 !important;
  border: none !important;
}

ul.products .entry.product .wpcbm-wrapper {
  position: relative;
  overflow: hidden;
}

ul.products .entry.product .woocommerce-loop-image-link {
  display: block;
  aspect-ratio: 3/4;
  overflow: hidden;
}

ul.products .entry.product .woocommerce-loop-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* --- Fleches blanches cliquables (meme style que le plugin lilith) --- */
.lilith-grid-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  opacity: 0;
  transition: opacity 0.3s;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  -webkit-user-select: none;
  user-select: none;
}

ul.products .entry.product:hover .lilith-grid-nav {
  opacity: 1;
}

.lilith-grid-nav:hover {
  opacity: 0.7 !important;
}

.lilith-grid-prev {
  left: 4px;
}

.lilith-grid-next {
  right: 4px;
}

/* --- Texte a gauche, prix a droite --- */
ul.products .entry.product .product-details.entry-content-wrap {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between;
  padding: 10px 0 8px !important;
  gap: 0;
  position: relative !important;
  background: transparent !important;
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

ul.products .entry.product .woocommerce-loop-product__title {
  flex: 1 1 auto;
  text-align: left !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em;
  text-transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

ul.products .entry.product .woocommerce-loop-product__title a {
  color: #222 !important;
  text-decoration: none !important;
}

ul.products .entry.product .price {
  flex: 0 0 auto;
  text-align: right !important;
  font-size: 13px !important;
  font-weight: 400;
  color: #222 !important;
  margin: 0 !important;
  padding: 0 !important;
  order: 2;
}

ul.products .entry.product .price del {
  color: #999 !important;
  font-size: 12px;
  margin-right: 4px;
}

ul.products .entry.product .price ins {
  text-decoration: none !important;
  color: #c0392b !important;
  font-weight: 500;
}

/* --- Icone panier ENTRE nom et prix --- */
ul.products .entry.product .product-action-wrap {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 6px !important;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 10;
  display: flex !important;
  align-items: center;
  pointer-events: none;
  background: none !important;
  order: 1;
  flex: 0 0 auto;
}

ul.products .entry.product:hover .product-action-wrap {
  opacity: 1;
  pointer-events: auto;
}

ul.products .entry.product .product-action-wrap .button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #222 !important;
  border: none !important;
  font-size: 0 !important;
  line-height: 1 !important;
  transition: transform 0.15s ease, opacity 0.2s;
  box-shadow: none !important;
  overflow: hidden;
}

ul.products .entry.product .product-action-wrap .button:hover {
  transform: scale(1.15);
  opacity: 0.7;
}

/* Feedback animation on click */
ul.products .entry.product .product-action-wrap .button.lilith-cart-clicked {
  transform: scale(0.85);
  opacity: 0.4;
}

ul.products .entry.product .product-action-wrap .button .kadence-svg-iconset,
ul.products .entry.product .product-action-wrap .button span {
  display: none !important;
}

ul.products .entry.product .product-action-wrap .button::before {
  content: "";
  display: block !important;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* --- Badge promo --- */
ul.products .entry.product .onsale {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  right: auto !important;
  z-index: 11;
  background: #222 !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 600;
  padding: 4px 10px !important;
  border-radius: 0 !important;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

/* --- Espacement grille --- */
ul.products.grid-cols {
  gap: 24px 18px !important;
}

/* --- Mini toast feedback --- */
.lilith-cart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #222;
  color: #fff;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  z-index: 99999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.lilith-cart-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Mobile --- */
@media (max-width: 768px) {
  ul.products .entry.product .product-details.entry-content-wrap {
    padding: 8px 0 6px !important;
  }
  ul.products .entry.product .woocommerce-loop-product__title {
    font-size: 12px !important;
  }
  ul.products .entry.product .price {
    font-size: 12px !important;
  }
  ul.products .entry.product .product-action-wrap {
    opacity: 1;
    pointer-events: auto;
  }
  ul.products .entry.product .wpcbm-wrapper::before,
  ul.products .entry.product .wpcbm-wrapper::after {
    display: none;
  }
}
