/* === General Layout === */
.custom-carousel-wrapper {
  padding: 20px;
}

.category-carousel-block {
  border: 2px solid #ccc;
  padding: 30px 20px 20px 20px;
  margin-bottom: 40px;
  position: relative;
  background: #fff;
  border-radius: 10px;
  overflow: visible;
}

/* === Category Header === */
.category-header {
  position: absolute;
  top: -15px;
  left: 0;
  width: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.category-label {
  background-color: #f97316;
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
  position: relative;
  z-index: 2;
}

.category-label:hover {
  background-color: #ea580c;
}

.see-all-link {
  background-color: #e2e8f0;
  color: #333;
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
  z-index: 2;
}

.see-all-link:hover {
  background-color: #cbd5e1;
}

/* === Swiper Container === */
.custom-carousel {
  margin-top: 20px;
  direction: rtl;
}

.swiper-slide {
  display: flex;
  justify-content: center;
}

/* === Product Card === */
.carousel-product-card {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 15px;
  box-sizing: border-box;
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s ease;
}

.carousel-product-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.carousel-image-container {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f5f5f5;
}

.carousel-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* === Product Title === - FIXED CSS TRUNCATION */
.carousel-product-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
  text-align: center;
  width: 100%;
  
  /* CSS-ONLY TRUNCATION - ELLIPSIS AT END */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

/* === Price Styling === */
.carousel-price {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.carousel-price .old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
}

.carousel-price .new-price {
  color: #e74c3c;
  font-weight: bold;
  font-size: 16px;
}

/* === Buttons === */
.carousel-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-to-cart-btn,
.whatsapp-btn {
  display: inline-block;
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s;
}

.add-to-cart-btn {
  background-color: #ff6600;
  color: #fff;
}

.add-to-cart-btn:hover {
  background-color: #e55b00;
}

.whatsapp-btn {
  background-color: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s;
}

.whatsapp-btn:hover {
  background-color: #1ebe5b;
}

/* === Swiper Controls === */
.swiper-button-next,
.swiper-button-prev {
  color: #000;
  background: rgba(255, 255, 255, 0.8);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 16px;
  font-weight: bold;
}

.swiper-pagination-bullet {
  background: #000;
  opacity: 0.4;
}

.swiper-pagination-bullet-active {
  background: #000;
  opacity: 1;
}

.custom-carousel .swiper-pagination {
  position: relative;
  margin-top: 15px;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .carousel-price {
    flex-direction: column;
    gap: 4px;
  }
  
  .carousel-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .whatsapp-btn, 
  .add-to-cart-btn {
    width: 100%;
  }
  
  /* Ensure truncation works on mobile */
  .carousel-product-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}