/* Product Loop Compare Button */
.product-loop-action .product-compare-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-top: 1px solid #e7e7e7;
  text-decoration: none;
}

.product-loop-action .product-compare-btn:hover,
.product-loop-action .product-compare-btn.active {
  background-color: #3a3a3a;
  color: #fff;
}

.product-loop-action .product-compare-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.product-loop-action .product-compare-btn svg path {
  fill: currentColor;
}

/* Single Product Compare Button */
.woostify-compare-button-single {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  vertical-align: middle;
  line-height: 1;
}

.woostify-compare-button-single:hover,
.woostify-compare-button-single.active {
  color: #4644b7;
}

.woostify-compare-button-single svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.woostify-compare-button-single svg path {
  fill: currentColor;
}

/* Toggle Compare Icons */
.product-compare-btn .compare-icon,
.woostify-compare-button-single .compare-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-compare-btn .compare-icon-check,
.woostify-compare-button-single .compare-icon-check {
  display: none;
}

.product-compare-btn.active .compare-icon-loop,
.woostify-compare-button-single.active .compare-icon-loop {
  display: none;
}

.product-compare-btn.active .compare-icon-check,
.woostify-compare-button-single.active .compare-icon-check {
  display: inline-flex;
}

/* Compare Page Wrapper and Table */
.woostify-compare-page {
  margin: 40px 0;
  font-family: inherit;
}

.woostify-compare-empty {
  text-align: center;
  padding: 60px 20px;
  background: #fdfdfd;
  border: 1px dashed #ddd;
  border-radius: 8px;
}

.woostify-compare-empty-message {
  font-size: 16px;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.woostify-compare-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.woostify-compare-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.woostify-compare-table th,
.woostify-compare-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  text-align: left;
  vertical-align: top;
}

.woostify-compare-table th {
  background-color: #fafafa;
}

.compare-row-label-col {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  font-weight: 600;
  color: #333;
  background-color: #f7f7f7;
  border-right: 1px solid #e5e5e5;
  position: sticky;
  left: 0;
  z-index: 10;
  box-sizing: border-box;
}

.woostify-compare-table td.compare-row-label-col {
  background-color: #f7f7f7;
}

.woostify-compare-table th.compare-row-label-col {
  background-color: #f7f7f7;
  border-bottom: 1px solid #e5e5e5;
}

.compare-product-header {
  position: relative;
  text-align: center !important;
  padding: 20px 15px !important;
  vertical-align: top;
  width: 200px;
  min-width: 200px;
  box-sizing: border-box;
}

.compare-remove-wrapper {
  text-align: left;
  margin-bottom: 15px;
}

.compare-product-header .woostify-remove-compare {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  height: auto;
  line-height: 1;
  border-radius: 0;
  background: none;
  color: #999;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.compare-product-header .woostify-remove-compare:hover {
  background: none;
  color: #333;
}

.compare-product-header .woostify-remove-compare .remove-icon {
  font-size: 16px;
  font-weight: bold;
}

.compare-product-price {
  margin-top: 10px;
  margin-bottom: 8px;
  font-weight: 600;
}

.compare-product-price del {
  color: #aaa;
  font-size: 14px;
  font-weight: normal;
  margin-right: 5px;
}

.compare-product-price ins {
  text-decoration: none;
}

.compare-product-rating {
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
}

.compare-product-rating .star-rating {
  margin: 0;
  font-size: 14px;
  color: #ffcc00;
}

.compare-product-add-to-cart {
  margin-top: 10px;
  margin-bottom: 10px;
}

.compare-product-add-to-cart .button {
  display: inline-flex;
  justify-content: center;
  gap: 5px;
  align-items: center;
  width: 100%;
  background-color: #84b93b;
  color: #fff;
  border: none;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
  border-radius: 0px;
  cursor: pointer;
  line-height: 25px;
}

.compare-product-add-to-cart .button:hover {
  background-color: #72a230;
}

/* AJAX Add to cart loading state in Compare Page */
.compare-product-add-to-cart .ajax_add_to_cart.loading .woostify-svg-icon {
  display: none !important;
}
.compare-product-add-to-cart .ajax_add_to_cart.loading:before {
  content: "" !important;
  z-index: 2;
  border: 1px solid #ddd;
  border-top-color: #222;
  border-radius: 50%;
  height: 14px;
  width: 14px;
  margin-right: 7px;
  animation: circle-loading 0.35s linear infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: static;
  transform: none;
}

.compare-product-add-to-cart .added_to_cart {
  display: inline-flex;
  justify-content: center;
  gap: 5px;
  align-items: center;
  width: 100%;
  background-color: #84b93b;
  color: #fff;
  border: none;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
  border-radius: 0px;
  cursor: pointer;
  line-height: 25px;
  margin-top: 8px;
}

.compare-product-add-to-cart .added_to_cart:hover {
  background-color: #72a230;
  color: #fff;
  text-decoration: none;
}

.compare-product-image img {
  max-width: 120px;
  height: auto;
  margin: 0 auto 15px;
  display: block;
  border-radius: 4px;
}

.compare-product-title {
  display: block;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
  margin-top: 10px;
  transition: color 0.2s ease;
}

.compare-product-title:hover {
  color: #4644b7;
}

.compare-val-col {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  width: 200px;
  min-width: 200px;
  box-sizing: border-box;
}

/* Specific Row Styles */
.compare-row-price .price {
  font-size: 16px;
  font-weight: 600;
  color: #4644b7;
}

.compare-row-price del .amount {
  font-size: 14px;
  color: #999;
  font-weight: normal;
}

.compare-row-price ins {
  text-decoration: none;
}

.compare-row-price ins .amount {
  color: #4644b7;
}

.compare-row-availability .stock {
  font-weight: 600;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.compare-row-availability .in-stock {
  background: #e6f7ed;
  color: #2e7d32;
}

.compare-row-availability .out-of-stock {
  background: #ffebee;
  color: #c62828;
}

.compare-row-rating .star-rating {
  margin: 0;
  font-size: 14px;
  color: #ffcc00;
}

.compare-row-add_to_cart .button {
  background-color: #4644b7;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: inline-block;
  text-decoration: none;
}

.compare-row-add_to_cart .button:hover {
  background-color: #35339c;
}

.compare-row-add_to_cart .added_to_cart {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #4644b7;
  text-decoration: underline;
}

/* Hover effects on table columns */
.woostify-compare-table tbody tr:hover td {
  background-color: #fcfcfc;
}

.woostify-compare-table tbody tr:hover td.compare-row-label-col {
  background-color: #f7f7f7;
}

/* Header Compare Icon & Count Badge */
.site-tools .compare-item-count {
  position: absolute;
  top: -6px;
  right: -12px;
  padding: 0 5px;
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  min-width: 18px;
  pointer-events: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Empty Compare Page Styling */
.woostify-compare-empty-container {
  text-align: center;
  padding: 80px 20px;
  max-width: 800px;
  margin: 0 auto;
}

.woostify-compare-empty-title {
  font-size: 40px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 20px;
  line-height: 1.2;
}

.woostify-compare-empty-message {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.woostify-compare-return-shop-btn {
  display: inline-block;
  padding: 12px 30px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1;
}

/* Compare button positioning and text styling on shop archives */
.compare-with-text {
  position: absolute;
  padding: 0.35em 1.5em;
  line-height: 1.8em;
  opacity: 0;
  visibility: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  z-index: 2;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  line-height: 26px;
}

.compare-with-text .compare-icon {
  margin-right: 7px;
}

.compare-with-text .compare-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.compare-with-text.compare-on-center-image {
  top: 48%;
  left: 50%;
  transform: translateX(-50%);
}

.compare-with-text.compare-on-bottom-image {
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  border-radius: 0;
  transform: translateY(100%);
}

/* Hover effects for showing compare button */
@media (min-width: 992px) {
  .products .product:hover .compare-with-text {
    opacity: 1;
    visibility: visible;
  }
  .products .product:hover .compare-on-bottom-image {
    transform: translateY(0);
  }
}
@media (max-width: 991px) {
  .products .product .product-loop-image-wrapper:hover .compare-with-text {
    opacity: 1;
    visibility: visible;
  }
  .products .product .product-loop-image-wrapper:hover .compare-on-bottom-image {
    transform: translateY(0);
  }
}
/* Handle overlapping when both Quick View and Compare buttons are positioned at the bottom of the image */
.product-loop-image-wrapper:has(.quick-view-on-bottom-image):has(.compare-on-bottom-image) .quick-view-on-bottom-image {
  right: 50%;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}
.product-loop-image-wrapper:has(.quick-view-on-bottom-image):has(.compare-on-bottom-image) .compare-on-bottom-image {
  left: 50%;
}

/* Handle overlapping when both Quick View and Compare buttons are positioned at the center of the image */
.product-loop-image-wrapper:has(.quick-view-on-center-image):has(.compare-on-center-image) .quick-view-on-center-image {
  top: 38%;
}
.product-loop-image-wrapper:has(.quick-view-on-center-image):has(.compare-on-center-image) .compare-on-center-image {
  top: 58%;
}
