/**
 * AWL Melaka Integration Styles
 *
 * Ensures Advanced Woo Labels display correctly in Melaka UI blocks
 */

/* Ensure product containers can position labels */
.best-selling .product,
.hot-deals-products .product {
  position: relative;
}

/* Ensure product image containers can position labels */
.best-selling .product__image,
.hot-deals-products .product__image {
  position: relative;
}

/* AWL labels positioning and z-index */
.best-selling .advanced-woo-labels,
.hot-deals-products .advanced-woo-labels {
  z-index: 20; /* Above product image, below carousel navigation */
}

/* On-image position labels (absolute positioning) */
.product__image > .advanced-woo-labels {
  position: absolute !important;
  /* Let AWL's inline styles control top/left/right/bottom positioning */
  /* Don't override: top, left, right, bottom, transform */
}

/* Before/after title and price positions (relative positioning) */
.product__name > .advanced-woo-labels,
.price > .advanced-woo-labels {
  position: relative !important;
  display: inline-block;
  margin: 0 0 8px 0;
}

/* ==========================================================================
   Carousel and Swiper Compatibility
   ========================================================================== */

/* Prevent label interference with carousel drag */
.vanilla-carousel-track .advanced-woo-labels,
.swiper .advanced-woo-labels {
  pointer-events: none;
}

/* Allow clicks on label links if AWL has clickable labels */
.vanilla-carousel-track .advanced-woo-labels a,
.swiper .advanced-woo-labels a {
  pointer-events: auto;
}

/* Ensure labels in cloned cells are visible */
.vanilla-carousel-cell .advanced-woo-labels {
  display: block !important;
  display: flex !important;
  visibility: visible !important;
  width: 100%;
  height: 100%;
  justify-content: flex-end !important;
}

/* Ensure labels don't interfere with product swatches */
.product__swatches-container,
.wvs-archive-variations-wrapper {
  position: relative;
  z-index: 10;
}

/* ==========================================================================
   Hot Deals Section Label Positioning
   ========================================================================== */

/* Hot deals thumbnail wrapper positioning (WooCommerce card) */
.hot-deals-thumbnail-wrapper {
  position: relative !important;
  overflow: visible !important;
}

/* Hot deals default image wrapper positioning (Default card) */
.hot-deals-default-image-wrapper {
  position: relative !important;
  overflow: visible !important;
}

/* Ensure .woocommerce-thumbnail in hot-deals also supports positioning */
.hot-deals-wc-card .woocommerce-thumbnail,
.hot-deals-product-slide .woocommerce-thumbnail {
  position: relative !important;
  overflow: visible !important;
}

/* Default card product-image container */
.hot-deals-product-slide .product-image,
.hot-deals-product-card .product-image {
  position: relative !important;
  overflow: visible !important;
}

/* AWL label positioning within hot-deals cards (both WC and Default) */
.hot-deals-wc-card .advanced-woo-labels,
.hot-deals-product-slide .advanced-woo-labels,
.hot-deals-thumbnail-wrapper .advanced-woo-labels,
.hot-deals-default-image-wrapper .advanced-woo-labels,
.hot-deals-product-card .advanced-woo-labels {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10 !important;
}

/* Ensure labels don't get hidden by swiper */
.hot-deals-product-slide .swiper ~ .woocommerce-thumbnail .advanced-woo-labels,
.hot-deals-product-slide .hot-deals-thumbnail-wrapper .advanced-woo-labels,
.hot-deals-product-slide .hot-deals-default-image-wrapper .advanced-woo-labels {
  z-index: 15 !important;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  .vanilla-carousel-track .advanced-woo-labels,
  .hot-deals-product-slide .advanced-woo-labels {
    /* Adjust label size for mobile if needed */
    font-size: 0.9em;
  }

  .vanilla-carousel-track .awl-product-label,
  .hot-deals-product-slide .awl-product-label {
    /* Adjust label padding for mobile */
    padding: 4px 8px;
  }
}
