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

.kw-checkout-upsells {
	margin-top: 25px;
	margin-bottom: 25px;
}

.kw-checkout-upsells .added_to_cart {
	display: none!important;
}

/* Title Element */
.kw-checkout-upsells__title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  text-align: left;
}

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

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

.kw-checkout-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-checkout-upsells__shipping-notice--achieved {
  background: #e8f5e8;
  border-color: #4caf50;
  color: #2e7d32;
}

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

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


/* Minimum order notice styling */
.kw-checkout-upsells__minimum-notice {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* Disabled carousel styling */
.kw-checkout-upsells__carousel--disabled {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.kw-checkout-upsells__carousel--disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* Disabled button styling */
.kw-checkout-upsells__add-btn:disabled,
.kw-checkout-upsells__add-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Disabled select styling */
.kw-checkout-upsells__variation-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* Product card when disabled */
.kw-checkout-upsells__carousel--disabled .kw-checkout-upsells__product {
    filter: grayscale(30%);
}

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

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

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

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

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

/* Product Card */
.kw-checkout-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-checkout-upsells__product-image {
  flex-shrink: 0;
}

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

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

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

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



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

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

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

.kw-checkout-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-checkout-upsells__product-price del {
  color: #999;
  font-weight: 400;
}

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

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

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

/* Add to Cart Button */

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

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

/* Minimum order notice styling */
.kw-checkout-upsells__minimum-notice {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* Disabled carousel styling */
.kw-checkout-upsells__carousel--disabled {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.kw-checkout-upsells__carousel--disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* Disabled button styling */
.kw-checkout-upsells__add-btn:disabled,
.kw-checkout-upsells__add-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Disabled select styling */
.kw-checkout-upsells__variation-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* Product card when disabled */
.kw-checkout-upsells__carousel--disabled .kw-checkout-upsells__product {
    filter: grayscale(30%);
}

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

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

.kw-checkout-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-checkout-spin 1s linear infinite;
}

/* Navigation Elements - Mobile Only */
.kw-checkout-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-checkout-upsells__nav {
    display: flex;
  }
}

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

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

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

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

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

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

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

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

.kw-checkout-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-checkout-upsells__pagination .swiper-pagination-bullet.swiper-pagination-bullet-active {
  background: #4CAF50;
  transform: scale(1.2);
}


    .kw-checkout-upsells__variation-select {
        width:100%; padding:8px; border:1px solid #ddd; border-radius:4px; font-size:14px; background:#fff;
    }
    .kw-checkout-upsells__variation-select:focus {
        outline:none; border-color:#007cba; box-shadow:0 0 0 1px #007cba;
    }
    .kw-checkout-upsells__add-btn:disabled { opacity:.6; cursor:not-allowed; }
    .kw-checkout-upsells__product-price del { opacity:.7; margin-right:5px; }
    .kw-checkout-upsells__product-price ins { text-decoration:none; font-weight:700; color:#e74c3c; }
    .kw-checkout-upsells.kw-checkout-upsells--hidden { display:none !important; }

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

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

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

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