/**
 * Rizwan Product Slider Styles
 * Production-ready CSS with rizwan- prefix for conflict prevention
 * All styling values are controlled via Elementor controls
 * 
 * @package Rizwan_Widgets
 * @since 2.0.0
 */

/* ==========================================================================
   Slider Wrapper
   ========================================================================== */

.rizwan-product-slider-wrapper {
  position: relative;
  width: 100%;
}

.rizwan-product-slider {
  position: relative;
}

/* ==========================================================================
   Product Card
   ========================================================================== */

.rizwan-product-item {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  /* Background color controlled by Elementor */
  /* Padding controlled by Elementor */
  /* Border radius controlled by Elementor */
  /* Box shadow controlled by Elementor */
}

.rizwan-product-item:hover {
  transform: translateY(-5px);
}

/* ==========================================================================
   Product Image Area
   ========================================================================== */

.rizwan-product-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
  /* Background color controlled by Elementor */
  /* Min height controlled by Elementor */
}

.rizwan-product-image a {
  display: block;
  width: 100%;
  text-align: center;
}

.rizwan-product-image img {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.rizwan-product-item:hover .rizwan-product-image img {
  transform: scale(1.05);
}

/* ==========================================================================
   Product Title Label (Hover)
   ========================================================================== */

.rizwan-product-label {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  /* Background color controlled by Elementor */
  /* Text color controlled by Elementor */
  /* Typography controlled by Elementor */
  /* Padding controlled by Elementor */
  /* Border radius controlled by Elementor */
}

.rizwan-product-item:hover .rizwan-product-label {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Sale Badge
   ========================================================================== */

.rizwan-sale-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  z-index: 20;
  /* Background color controlled by Elementor */
  /* Text color controlled by Elementor */
}

/* ==========================================================================
   Product Footer (Price & Add to Cart)
   ========================================================================== */

.rizwan-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 20px;
  flex-wrap: wrap;
}

.rizwan-product-price {
  font-weight: 600;
  /* Color controlled by Elementor */
  /* Typography controlled by Elementor */
}

.rizwan-product-price del {
  opacity: 0.6;
  margin-right: 8px;
  font-weight: 400;
}

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

/* ==========================================================================
   Add to Cart Button
   ========================================================================== */

.rizwan-add-to-cart {
  flex-shrink: 0;
}

.rizwan-add-to-cart a.button {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 3px;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.rizwan-add-to-cart a.button:hover {
  opacity: 0.85;
}

/* ==========================================================================
   Owl Carousel Navigation
   ========================================================================== */

.rizwan-product-slider .owl-nav {
  margin-top: 0;
}

.rizwan-product-slider .owl-nav button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  background: rgba(0, 0, 0, 0.5) !important;
  color: #fff !important;
  border-radius: 50%;
  font-size: 20px;
  line-height: 45px;
  transition: background-color 0.3s ease;
  z-index: 100;
}

.rizwan-product-slider .owl-nav button:hover {
  background: rgba(0, 0, 0, 0.8) !important;
}

.rizwan-product-slider .owl-nav .owl-prev {
  left: -22px;
}

.rizwan-product-slider .owl-nav .owl-next {
  right: -22px;
}

/* ==========================================================================
   Owl Carousel Pagination Dots
   ========================================================================== */

.rizwan-product-slider .owl-dots {
  text-align: center;
  margin-top: 30px;
}

.rizwan-product-slider .owl-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 5px;
  background: #ccc !important;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.rizwan-product-slider .owl-dot.active {
  background: #0c5d7a !important;
  width: 30px;
  border-radius: 6px;
}

.rizwan-product-slider .owl-dot:hover {
  background: #999 !important;
}

/* ==========================================================================
   Empty State & Error Messages
   ========================================================================== */

.rizwan-empty-state,
.rizwan-error-notice {
  padding: 40px 20px;
  text-align: center;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #6c757d;
  font-size: 16px;
}

.rizwan-error-notice {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

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

@media (max-width: 768px) {
  .rizwan-product-slider .owl-nav button {
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 16px;
  }

  .rizwan-product-slider .owl-nav .owl-prev {
    left: -17px;
  }

  .rizwan-product-slider .owl-nav .owl-next {
    right: -17px;
  }

  .rizwan-product-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .rizwan-product-label {
    font-size: 14px;
    padding: 8px 16px;
  }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

.rtl .rizwan-product-slider .owl-nav .owl-prev {
  right: -22px;
  left: auto;
}

.rtl .rizwan-product-slider .owl-nav .owl-next {
  left: -22px;
  right: auto;
}

.rtl .rizwan-sale-badge {
  right: auto;
  left: 15px;
}

/* ==========================================================================
   Elementor Editor Specific
   ========================================================================== */

.elementor-editor-active .rizwan-product-slider {
  /* Ensure slider is visible in editor even before initialization */
  display: block;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.rizwan-product-item a:focus,
.rizwan-add-to-cart a.button:focus {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}

/* Ensure images have alt text for screen readers */
.rizwan-product-image img[alt=""] {
  /* Fallback for products without alt text */
}

/* ==========================================================================
   Loading State (Optional)
   ========================================================================== */

.rizwan-product-slider.loading {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rizwan-product-slider.loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0c5d7a;
  border-radius: 50%;
  animation: rizwan-spin 1s linear infinite;
}

@keyframes rizwan-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
