/* ================================================================
   KW Cart Upsells Component - BEM Structure (CSS)
   ================================================================ */

/* Title Element */
.kw-cart-upsells__title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #333;
  text-align: left;
}

@media (max-width: 768px) {
  .kw-cart-upsells__title {
    font-size: 1.25rem;
    text-align: center;
  }
}

/* Shipping Section */
.kw-cart-upsells__shipping {
  margin-bottom: 1.5rem;
  text-align: center;
}

.kw-cart-upsells__shipping-notice {
  padding: 0.75rem 1rem;
  background: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 4px;
  color: #1976d2;
  font-weight: 500;
}

/* Modifier: Achieved state */
.kw-cart-upsells__shipping-notice--achieved {
  background: #e8f5e8;
  border-color: #4caf50;
  color: #2e7d32;
}

/* Carousel Elements */
.kw-cart-upsells__carousel {
  position: relative;
  overflow: hidden;
  margin: 0;
}

.kw-cart-upsells__carousel .swiper-wrapper {
  padding: 0;
}

/* For grid layout on larger screens */
@media (min-width: 768px) {
  .kw-cart-upsells__carousel .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    transform: none !important;
  }
  
  .kw-cart-upsells__carousel .swiper-slide {
    transform: none !important;
    width: auto !important;
  }
}

.kw-cart-upsells__carousel-wrapper {
  display: flex;
  align-items: stretch;
}

.kw-cart-upsells__slide {
  height: auto;
  padding: 0;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .kw-cart-upsells__slide {
    margin-bottom: 0;
  }
}

@media (max-width: 767px) {
	.kw-cart-upsells__carousel-wrapper {
		flex-direction: column;
	}
}

/* Product Card */
.kw-cart-upsells__product {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid #f0f0f0;
  position: relative;
}


.kw-cart-upsells__product-image {
  flex-shrink: 0;
}

.kw-cart-upsells__product-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .kw-cart-upsells__product-img {
    width: 60px;
    height: 60px;
  }
}

.kw-cart-upsells__product-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  min-height: 80px;
}

.kw-cart-upsells__product-title {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: #333;
  line-height: 1.3;
  flex-grow: 1;
}



.kw-cart-upsells__product-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-wrap: wrap;
}

.kw-cart-upsells__product-price .original-price {
  font-size: 0.9rem;
  color: #999;
  text-decoration: line-through;
  font-weight: 400;
}

.kw-cart-upsells__product-price .current-price {
  font-size: 1rem;
  font-weight: 600;
  color: #e74c3c;
}

.kw-cart-upsells__product-price .discount-badge {
  background: #e74c3c;
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: auto;
}

/* WooCommerce price styling */
.kw-cart-upsells__product-price del {
  color: #999;
  font-weight: 400;
}

.kw-cart-upsells__product-price del .woocommerce-Price-amount {
  font-size: 0.85rem;
}

.kw-cart-upsells__product-price ins {
  text-decoration: none;
  font-weight: 600;
  color: #e74c3c;
}

/* Form */
.kw-cart-upsells__form {
  margin: 0;
}

/* Add to Cart Button */

.kw-cart-upsells__product-price-button__wrapper {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
}

.kw-cart-upsells__add-btn {
	margin: 0!important;
}


/* Modifier: Loading state */
.kw-cart-upsells__add-btn--loading {
  background: #81C784;
  border-color: #81C784;
  cursor: not-allowed;
  pointer-events: none;
}

.kw-cart-upsells__add-btn--loading::before {
  content: "";
}

.kw-cart-upsells__add-btn--loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: kw-spin 1s linear infinite;
}

/* Navigation Elements - Mobile Only */
.kw-cart-upsells__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  display: none; /* Hidden by default, only show on mobile */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

@media (max-width: 767px) {
  .kw-cart-upsells__nav {
    display: flex;
  }
}

.kw-cart-upsells__nav:hover {
  background: #4CAF50;
  border-color: #4CAF50;
  color: #fff;
}

.kw-cart-upsells__nav::after {
  font-size: 14px;
  font-weight: 600;
}

/* Modifier: Previous */
.kw-cart-upsells__nav--prev {
  left: 10px;
}

.kw-cart-upsells__nav--prev::after {
  content: "‹";
}

/* Modifier: Next */
.kw-cart-upsells__nav--next {
  right: 10px;
}

.kw-cart-upsells__nav--next::after {
  content: "›";
}

/* Pagination - Mobile Only */
.kw-cart-upsells__pagination {
  text-align: center;
  margin-top: 1rem;
  display: none;
}

@media (max-width: 767px) {
  .kw-cart-upsells__pagination {
    display: block;
  }
}

.kw-cart-upsells__pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: #ddd;
  border-radius: 50%;
  opacity: 1;
  margin: 0 3px;
  transition: all 0.2s ease;
}

.kw-cart-upsells__pagination .swiper-pagination-bullet.swiper-pagination-bullet-active {
  background: #4CAF50;
  transform: scale(1.2);
}

/* Keyframes for loading animation */
@keyframes kw-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .kw-cart-upsells__product-img {
    width: 70px;
    height: 70px;
  }
}

@media (max-width: 768px) {
  .kw-cart-upsells {
    padding: 0;
    margin: 1rem 0;
  }
  
  .kw-cart-upsells__title {
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .kw-cart-upsells__carousel {
    margin: 0;
  }
  
  .kw-cart-upsells__slide {
    margin-bottom: 1rem;
  }
  
  .kw-cart-upsells__product {
    padding: 1rem;
    flex-direction: row;
    gap: 0.75rem;
  }
  
  .kw-cart-upsells__product-img {
    width: 60px;
    height: 60px;
  }
  
  
  .kw-cart-upsells__product-content {
    min-height: 60px;
  }
}

@media (max-width: 480px) {
  .kw-cart-upsells__product {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .kw-cart-upsells__product-img {
    width: 50px;
    height: 50px;
  }
  
  .kw-cart-upsells__add-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }
  
  .kw-cart-upsells__product-price .current-price {
    font-size: 0.9rem;
  }
  
  .kw-cart-upsells__product-price .original-price {
    font-size: 0.75rem;
  }
  
  
  .kw-cart-upsells__product-content {
    min-height: 50px;
  }
}
