/* =========================================================
   TF CART OVERLAY — FINAL CLEAN & STABLE
   DIVI + WOOCOMMERCE SAFE
========================================================= */

/* =========================================================
   1) HEADER CART ICON
========================================================= */

.tf-header-icon svg {
  pointer-events: none;
}

.tf-cart-toggle {
  position: relative;
  z-index: 10;
}

/* =========================================================
   2) CART OVERLAY PANEL
========================================================= */

.tf-cart-overlay {
  position: fixed;
  top: 0;
  right: 0;

  width: 380px;
  max-width: 100%;
  height: 100vh;

  background: #fff;
  z-index: 99999;

  transform: translateX(100%);
  transition: transform 0.35s ease;

  overflow-y: auto;
}

.tf-cart-overlay.is-open {
  transform: translateX(0);
}

body.tf-cart-open {
  overflow: hidden;
}

/* =========================================================
   3) CLOSE BUTTON (OVERLAY)
========================================================= */

.tf-cart-close {
  position: absolute;
  top: 16px;
  right: 16px;

  width: 40px;
  height: 40px;

  background: #111;
  color: #fff;
  border: none;

  font-size: 20px;
  cursor: pointer;
  z-index: 10;
}

/* =========================================================
   4) MINI CART RESET (OVERLAY ONLY)
========================================================= */

.tf-cart-overlay ul.cart_list,
.tf-cart-overlay ul.product_list_widget {
  margin: 0;
  padding: 80px 16px 24px;
  list-style: none;
}

.tf-cart-overlay ul.cart_list li,
.tf-cart-overlay ul.product_list_widget li {
  margin: 0 0 24px;
  padding: 0 0 24px;

  border-bottom: 1px solid #eee;
  list-style: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  position: relative;
}

/* On retire uniquement les clearfix Woo, PAS de reset global */
.tf-cart-overlay ul.cart_list li::before,
.tf-cart-overlay ul.cart_list li::after,
.tf-cart-overlay ul.product_list_widget li::before,
.tf-cart-overlay ul.product_list_widget li::after,
.tf-cart-overlay ul.cart_list li dl::before,
.tf-cart-overlay ul.cart_list li dl::after,
.tf-cart-overlay ul.product_list_widget li dl::before,
.tf-cart-overlay ul.product_list_widget li dl::after {
  content: none !important;
  display: none !important;
}

/* =========================================================
   5) PRODUCT (IMAGE / TITLE / PRICE)
========================================================= */

/* Lien produit = image + titre (Woo) */
.tf-cart-overlay ul.cart_list li > a:not(.remove),
.tf-cart-overlay ul.product_list_widget li > a:not(.remove) {
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: center;

  color: #111;
  text-decoration: none;

  /* on évite d'intercepter le clic sur remove */
  pointer-events: none;
}

/* Image */
.tf-cart-overlay ul.cart_list li > a:not(.remove) img,
.tf-cart-overlay ul.product_list_widget li > a:not(.remove) img {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto 10px;

  pointer-events: auto;
}

/* Titre */
.tf-cart-overlay ul.cart_list li > a:not(.remove),
.tf-cart-overlay ul.product_list_widget li > a:not(.remove) {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

/* Quantité + prix */
.tf-cart-overlay ul.cart_list li .quantity,
.tf-cart-overlay ul.product_list_widget li .quantity {
  order: 2;
  margin-top: 6px;
  font-size: 15px;
  color: #555;
}

/* =========================================================
   6) REMOVE BUTTON — CLEAN UX
   👉 "Supprimer du panier" juste sous l'image/prix
========================================================= */

/* On garde le lien Woo (sinon plus de suppression),
   mais on masque le caractère "×" et on affiche notre texte */
.tf-cart-overlay ul.cart_list li > a.remove,
.tf-cart-overlay ul.product_list_widget li > a.remove {
  order: 3;

  position: static !important;
  display: inline-block !important;

  margin-top: 10px !important;
  padding: 0 !important;

  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  /* masque le × sans casser l'accessibilité */
  text-indent: -9999px !important;
  overflow: hidden !important;
  white-space: nowrap !important;

  width: auto !important;
  height: auto !important;
  line-height: normal !important;

  cursor: pointer !important;
}

/* Texte UX */
.tf-cart-overlay ul.cart_list li > a.remove::after,
.tf-cart-overlay ul.product_list_widget li > a.remove::after {
  content: "Supprimer du panier";
  display: inline-block;

  text-indent: 0;
  overflow: visible;

  font-size: 13px;
  font-weight: 500;
  color: #777;
  text-decoration: underline;
}

/* Hover */
.tf-cart-overlay ul.cart_list li > a.remove:hover::after,
.tf-cart-overlay ul.product_list_widget li > a.remove:hover::after {
  color: #e33d3d;
}

/* Sécurité : pas de pseudo Woo parasites */
.tf-cart-overlay ul.cart_list li > a.remove::before,
.tf-cart-overlay ul.product_list_widget li > a.remove::before {
  content: none !important;
}

/* =========================================================
   7) SUBTOTAL
========================================================= */

.tf-cart-overlay .total {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin: 24px 16px;
  font-size: 18px;
  font-weight: 700;
}

/* =========================================================
   8) ACTION BUTTONS
========================================================= */

.tf-cart-overlay .buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 24px;
}

.tf-cart-overlay .buttons a {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;

  text-decoration: none;
  border-radius: 6px;
}

.tf-cart-overlay .buttons .wc-forward {
  border: 2px solid #111;
  background: transparent;
  color: #111;
}

.tf-cart-overlay .buttons .checkout {
  background: #111;
  color: #fff;
}

/* =========================================================
   9) MOBILE
========================================================= */

@media (max-width: 480px) {
  .tf-cart-overlay {
    width: 100%;
  }

  .tf-cart-overlay .buttons {
    grid-template-columns: 1fr;
  }

  .tf-cart-overlay ul.cart_list li > a.remove::after,
  .tf-cart-overlay ul.product_list_widget li > a.remove::after {
    font-size: 14px;
  }
}

/* =========================================================
   10) DISABLE WOO LOADERS (OVERLAY ONLY)
========================================================= */

.tf-cart-overlay .blockUI,
.tf-cart-overlay .blockOverlay,
.tf-cart-overlay .woocommerce-mini-cart__loading {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* =========================================================
   11) CART COUNT BADGE
========================================================= */

.tf-cart-count {
  position: absolute;
  top: -4px;
  right: -6px;

  min-width: 18px;
  height: 18px;
  padding: 0 5px;

  background: #e33d3d;
  color: #fff;

  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;

  border-radius: 999px;
  display: none;
}

.tf-cart-count.is-visible {
  display: inline-block;
}

/* =========================================================
   12) DISABLE ATC OVERLAY (WE USE SIDE CART ONLY)
========================================================= */

.tf-atc-overlay {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}