/* =========================================
   Product Card
========================================= */

/* Shared transition */
:root {
  --card-transition: 0.3s ease-in-out;
}

.product-item {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: box-shadow 0.3s ease;
  padding: 10px;

  &:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
}
.product-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Card Content */
.content {
  overflow: hidden;
  margin-bottom: 8px;
  border-radius: 4px;
  transition:
    background-color var(--card-transition),
    border-radius var(--card-transition);
  height: clamp(11.5rem, 10.0842rem + 6.0408vw, 16.125rem);
}

/* Image */
.product-card-image-wrapper {
  transition: transform var(--card-transition);
  width: 100%;
  height: 100%;
}

.content:hover .product-card-image-wrapper {
  transform: scale(1.1);
}

/* Add To Cart */
.add-to-cart-btn-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row-reverse;
  gap: 15px;
  opacity: 1;
  transition: opacity var(--card-transition);
}

/* Wishlist & quick view */
.card-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition:
    opacity var(--card-transition),
    visibility var(--card-transition),
    transform var(--card-transition);
}

.custom_badge {
  direction: rtl;
  position: absolute;
  top: 10px !important;
  right: auto;
  left: 15px;
  gap: 10px;
  display: flex;
  align-items: end;
  /*   justify-content: space-between; */
  flex-direction: column;
  z-index: 5;
  .badge-sold,
  .remaining-text {
    background-color: var(--text-color-primary-bg);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
  }
  .Sold-text {
    background-color: var(--text-color-primary-bg);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 10px;
    /*     margin-top: 35px !important; */
  }
}

/* Show card-actions on hover */
.product-item:hover .card-actions {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Always show card-actions on mobile (no hover) */
@media (max-width: 768px) {
  .card-actions {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }
}
.comparison-trigger i,
.add-to-wishlist,
.product-item .add-to-wishlist,
.product-item .quick-view {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background-color: transparent;
  cursor: pointer;
  border: 1px solid var(--primary-color);
  position: relative;
}
.add-to-wishlist {
  border: none;
}
.comparison-trigger,
.wishlist-btn,
.quick-view-btn,
.wishlist-link,
.quick-view-btn,
.card-actions button {
  background: none;
  border: none;
  padding: 0;
  outline: none;
  font-size: 20px;
  color: var(--primary-color) !important;
  cursor: pointer;
}

/* Wishlist button loader positioning */
.add-to-wishlist .loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Wishlist Hover (merged duplicates) */
.content:hover .icon-heart-mask,
.content:hover .add-to-wishlist {
  background-color: #fff !important;
}

/* Product Text */
.product-card-name {
  font-size: clamp(1rem, 0.9235rem + 0.3265vw, 1.25rem);
  line-height: 1.2;
  text-align: start;
  overflow: hidden;
  color: black;
  text-overflow: ellipsis;
}

.product-card-category-wrapper {
  margin-bottom: 8px;
  min-height: 15px;
}

.product-card-category-wrapper p {
  font-size: clamp(0.875rem, 0.8rem + 0.32vw, 1.125rem);
  color: #696969;
  text-align: start;
  margin-bottom: 0;
}

/* Prices */
.product-item .product-price,
.product-item .section-product-price {
  font-size: clamp(1rem, 0.92rem + 0.32vw, 1.25rem);
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 8px;
}

.product-item .product-prev-price {
  font-size: clamp(0.875rem, 0.84rem + 0.16vw, 1rem);
  color: #a5a5a5;
  text-decoration: line-through;
  margin-inline: 4px;
}

/* Buttons */
.product-card-add-to-cart,
.btn-product-card-select-variant,
.btn-product-card-out-of-stock {
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  background-color: var(--primary-color);
  border: 1px solid var(--primary-color);
  color: var(--secondary-color) !important;
  transition:
    background-color var(--card-transition),
    color var(--card-transition);
}

.product-card-add-to-cart:hover,
.btn-product-card-select-variant:hover,
.btn-product-card-out-of-stock:hover {
  color: var(--primary-color) !important;
  border-color: var(--primary-color);
  background: transparent;
}
/* options */
.options_card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 15px;
}

.product-attributes {
  width: 300px !important;
}
.product-loader {
  max-width: 20px !important;
  max-height: 20px !important;
}
@media (width <= 600px) {
  .product-item .add-to-wishlist,
  .product-item .quick-view {
    width: 34px;
    height: 34px;
  }
  .wishlist-btn,
  .quick-view-btn {
    font-size: 16px;
  }
}

.add-to-cart-progress {
  max-width: 20px !important;
  max-height: 20px !important;
}

/* Horizontal card */
.herozintal_prod {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  width: 100%;
  gap: 2rem;
  direction: ltr;
  margin-bottom: 24px;
  @media (max-width: 991px) {
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
  }

  @media (max-width: 600px) {
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-right: 0;
  }

  .card-inner-content {
    width: 60%;
    @media (max-width: 600px) {
      width: 100%;
    }

    .product-card-category-wrapper p {
      text-align: end;
    }
    .card-data {
      flex-direction: column;
      align-items: end !important;
    }
  }

  .product-item {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 10px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    /* background: #fff; */
    transition: box-shadow 0.3s ease;

    &:hover {
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    @media (max-width: 600px) {
      flex-direction: column;
      padding: 10px;
    }

    /* Hide the default card-actions in horizontal view */
    .card-actions {
      position: absolute;
      top: 10px;
      right: 10px;
      flex-direction: row;
      gap: 8px;
      z-index: 10;
    }

    /* Image section */
    .content {
      flex-shrink: 0;
      width: 200px;
      height: 200px;
      margin-bottom: 0;
      border-radius: 8px;
      overflow: hidden;

      @media (max-width: 768px) {
        width: 150px;
        height: 150px;
      }

      @media (max-width: 600px) {
        width: 100%;
        height: 200px;
      }
    }
    /*.product-img-hover-wrapper {
      position: relative;
      width: 100%;
      height: 100%;

      img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        transition: opacity 0.4s ease;
      }

      .product-img-base {
        opacity: 1;
        z-index: 1;
      }

      .product-img-hover {
        opacity: 0;
        z-index: 2;
      }

      &:hover .product-img-hover {
        opacity: 1;
      }

      &:hover .product-img-base {
        opacity: 0;
      }
    }*/

    /* Main link wrapper - make it flex row */
    > a {
      display: flex;
      flex-direction: row;
      align-items: flex-start;
      gap: 20px;
      flex: 1;

      @media (max-width: 600px) {
        flex-direction: column;
        gap: 15px;
      }
    }

    /* Product details section */
    .d-block.text-start,
    .product-card-category-wrapper,
    .product-crd-spec {
      text-align: start;
    }

    .product-card-name {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 8px;
      text-align: unset;

      span {
        -webkit-line-clamp: 2;
      }

      @media (max-width: 600px) {
        font-size: 16px;
      }
    }

    .product-card-category-wrapper {
      margin-bottom: 8px;
    }

    .product-card-rating-wrapper {
      margin-bottom: 8px;
    }

    .section-product-price {
      font-size: 18px;
      margin-bottom: 8px;
      flex-direction: row-reverse;

      @media (max-width: 600px) {
        font-size: 16px;
      }
    }

    .options_card {
      justify-content: end;
      margin-bottom: 8px;
    }

    /* Add to cart section */
    .add-to-cart-btn-container {
      flex-shrink: 0;
      width: auto;
      min-width: 180px;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: center;
      gap: 10px;
      margin-inline-start: auto;

      @media (max-width: 600px) {
        width: 100%;
        margin-inline-start: 0;
        flex-direction: row;
      }

      .btn {
        width: 100%;
        padding: 12px 20px;
        border-radius: 6px;
        font-weight: 500;
        text-transform: capitalize;
        transition: all 0.3s ease;
      }

      .product-card-add-to-cart,
      .btn-product-card-select-variant {
        background: transparent;
        border: 1px solid var(--primary-color);
        color: var(--primary-color);

        &:hover {
          background: var(--primary-color);
          color: #fff;
        }
      }

      .btn-product-card-out-of-stock {
        background: #f5f5f5;
        border: 1px solid #ddd;
        color: #666;
      }
    }
  }
  .product-card-bundle-offer {
    position: relative !important;
    top: 0px !important;
    left: -2px !important;
  }
  .badge-sold,
  .remaining-text {
    position: relative !important;
    left: 0 !important;
  }
  .badge-sold {
    left: 0 !important;
  }
  /* Prices */
  .product-item .product-price,
  .product-item .section-product-price {
    display: flex !important;
  }
    .product-comparison-badge {
    bottom: 133px;
    left: 10px;
  }

   [dir="rtl"] .product-comparison-badge {
    right: auto;
    left: 10px;
  } 
  @media(max-width:425px) {
    .product-comparison-badge {
        bottom: 157px;
    }
    .product-link-special{
      width: 100% !important;
    }
    .product-comparison-badge{
      font-size: 10px !important;
    }
  }

  

}

/* Quick-view / hover image wrapper — moved here from an inline <style> that was
   duplicated in every product-card.jinja include. */
.product-img-hover-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.product-img-hover-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.4s ease;
}

.product-img-hover-wrapper .product-img-base {
  opacity: 1;
  z-index: 1;
}
