/* ---------------------------
   FAVORITES ICON BUTTON
---------------------------- */
.acesoftech-fav-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.acesoftech-fav-iconbtn:focus { outline: none; }

.acesoftech-fav-iconbtn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.35);
  outline-offset: 3px;
  border-radius: 999px;
}

/* default black heart */
.acesoftech-fav-heart {
  fill: #000;
  transition: transform 0.12s ease, fill 0.12s ease, opacity 0.12s ease;
}

/* active maroon */
.acesoftech-fav-iconbtn.is-favorited .acesoftech-fav-heart {
  fill: #800000;
}

.acesoftech-fav-iconbtn:active .acesoftech-fav-heart {
  transform: scale(0.92);
}

/* disabled/loading state */
.acesoftech-fav-iconbtn[disabled],
.acesoftech-fav-iconbtn.is-loading {
  cursor: not-allowed;
  opacity: 0.6;
}

.acesoftech-fav-iconbtn[disabled] .acesoftech-fav-heart,
.acesoftech-fav-iconbtn.is-loading .acesoftech-fav-heart {
  opacity: 0.85;
}

/* spacing after cart / in loop */
.acesoftech-fav-after-cart,
.acesoftech-fav-in-loop {
  margin-top: 8px;
}

/* ---------------------------
   HEADER ICON + BADGE
---------------------------- */
.acesoftech-fav-header {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.acesoftech-fav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.acesoftech-fav-header-heart { fill: #000; }

/* red badge like cart */
.acesoftech-fav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ff0000;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.acesoftech-fav-badge.is-zero { display: none; }

/* ---------------------------
   FAVORITES PAGE (CART TABLE)
---------------------------- */
.acesoftech-fav-page {
  max-width: 1100px;
  margin: 0 auto;
}

.acesoftech-fav-empty {
  margin: 14px 0;
}

.acesoftech-fav-total {
  margin-top: 14px;
  font-weight: 600;
}

/* Make sure table looks like Woo cart */
.acesoftech-fav-cart-table {
  width: 100%;
  border-collapse: collapse;
}

/* Some themes add weird spacing/padding */
.acesoftech-fav-cart-table th,
.acesoftech-fav-cart-table td {
  vertical-align: middle;
}

/* Header */
.acesoftech-fav-cart-table thead th {
  font-weight: 700;
  padding: 16px 14px;
}

/* Body cells */
.acesoftech-fav-cart-table tbody td {
  padding: 18px 14px;
}

/* Keep thumbnail small like cart */
.acesoftech-fav-cart-table td.product-thumbnail {
  width: 90px;
}

.acesoftech-fav-cart-table td.product-thumbnail img {
  width: 72px !important;
  height: 72px !important;
  object-fit: cover !important;
  border-radius: 10px;
  display: block;
  max-width: 72px !important;
}

/* Product name link */
.acesoftech-fav-cart-table td.product-name a {
  font-weight: 700;
  text-decoration: none;
}

.acesoftech-fav-cart-table td.product-name a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Price */
.acesoftech-fav-cart-table td.product-price {
  font-weight: 600;
  white-space: nowrap;
}

/* ---------------------------
   ACTION COLUMN (RIGHT SIDE)
---------------------------- */
.acesoftech-fav-cart-table th.acesoftech-fav-action,
.acesoftech-fav-cart-table td.acesoftech-fav-action {
  text-align: right;
  width: 90px;
  white-space: nowrap;
}

/* Trash button */
.acesoftech-fav-remove-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 10px;
  line-height: 1;
  border-radius: 10px;
}

.acesoftech-fav-remove-btn:hover {
  background: rgba(0,0,0,0.05);
}

/* Trash SVG */
.acesoftech-fav-trash {
  display: inline-block;
  vertical-align: middle;
  fill: #800000;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.acesoftech-fav-remove-btn:active .acesoftech-fav-trash {
  transform: scale(0.95);
}

.acesoftech-fav-remove-btn:hover .acesoftech-fav-trash {
  opacity: 0.8;
}

/* Optional row removing state */
.acesoftech-fav-item.is-removing {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ---------------------------
   MOBILE FRIENDLY (clean cards)
---------------------------- */
@media (max-width: 768px) {

  /* SUPER STRONG FALLBACK:
     If any theme still prints labels using td:before, kill it. */
  .acesoftech-fav-page .acesoftech-fav-cart-table td::before,
  .acesoftech-fav-page .acesoftech-fav-cart-table td:before {
    content: none !important;
    display: none !important;
  }

  /* Hide header on mobile */
  .acesoftech-fav-cart-table thead {
    display: none !important;
  }

  /* Turn row into grid card */
  .acesoftech-fav-cart-table tbody tr.acesoftech-fav-item {
    display: grid !important;
    grid-template-columns: 74px 1fr 64px;
    grid-template-areas:
      "thumb name action"
      "thumb price action";
    gap: 10px 12px;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    align-items: center;
  }

  .acesoftech-fav-cart-table tbody td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .acesoftech-fav-cart-table td.product-thumbnail {
    grid-area: thumb;
    width: auto !important;
  }

  .acesoftech-fav-cart-table td.product-name {
    grid-area: name;
  }

  .acesoftech-fav-cart-table td.product-price {
    grid-area: price;
    white-space: nowrap;
    font-weight: 600;
  }

  .acesoftech-fav-cart-table td.acesoftech-fav-action {
    grid-area: action;
    text-align: right !important;
    width: auto !important;
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
  }

  /* Smaller thumbnail */
  .acesoftech-fav-cart-table td.product-thumbnail img {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    border-radius: 10px;
    object-fit: cover !important;
    display: block;
  }

  .acesoftech-fav-remove-btn {
    padding: 10px 10px;
    border-radius: 12px;
  }
}
