/* Custom Woo QuickView Plugin Styles */

/* Hide add to cart button for variable products only on shop and archive pages when quick view is available */
.woocommerce ul.products li.product.product-type-variable .add_to_cart_button {
  display: none !important;
}

/* Hide add to cart button for variable products only on single product page related products and upsells */
.single-product
  .related.products
  ul.products
  li.product.product-type-variable
  .add_to_cart_button,
.single-product
  .upsells.products
  ul.products
  li.product.product-type-variable
  .add_to_cart_button,
.single-product
  .related.products
  .products
  li.product.product-type-variable
  .add_to_cart_button,
.single-product
  .upsells.products
  .products
  li.product.product-type-variable
  .add_to_cart_button {
  display: none !important;
}

/* Ensure quick view button is visible and properly styled for variable products */
li.product.product-type-variable .sp-wqv-view-button-wrapper {
  display: flex;
  justify-items: flex-end;
  margin-top: auto;
}

li.product.product-type-variable
  .sp-wqv-view-button-wrapper
  .sp-wqv-view-button {
  display: inline-block !important;
  margin-top: 10px;
}

/* Ensure simple products show their add to cart buttons normally */
li.product.product-type-simple .add_to_cart_button {
  display: inline-block !important;
}

/* Hide quick view button for simple products - they should only show add to cart */
li.product.product-type-simple .sp-wqv-view-button-wrapper {
  display: none !important;
}

.single-product
  .related.products
  li.product.product-type-simple
  .sp-wqv-view-button-wrapper,
.single-product
  .upsells.products
  li.product.product-type-simple
  .sp-wqv-view-button-wrapper {
  display: none !important;
}

.single-product
  .related.products
  li.product.product-type-variable
  .sp-wqv-view-button-wrapper
  .sp-wqv-view-button,
.single-product
  .upsells.products
  li.product.product-type-variable
  .sp-wqv-view-button-wrapper
  .sp-wqv-view-button {
  display: inline-block !important;
}

.products li.product.product-type-simple .button.sp-wqv-view-button {
  display: none !important;
}

#sp-wqv-view-button.sp-wqv-view-button.button.after_add_to_cart {
  margin: 0;
}

/* Quantity validation warning styles */
.cwqv-quantity-warning {
  display: flex;
  align-items: center;
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 14px;
  color: #856404;
  animation: cwqv-fadeIn 0.3s ease-in-out;
}

.cwqv-warning-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ff9f43;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: bold;
  margin-right: 8px;
  flex-shrink: 0;
}

.cwqv-warning-text {
  flex: 1;
  line-height: 1.4;
}

@keyframes cwqv-fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 767px) {
  #wqv-quick-view-content
    .wqv-product-info
    .single_add_to_cart_button.button:not(.components-button):not(
      .customize-partial-edit-shortcut-button
    ) {
    border-radius: 0px !important;
  }

  .cwqv-quantity-warning {
    font-size: 13px;
    padding: 6px 10px;
  }

  .cwqv-warning-icon {
    width: 18px;
    height: 18px;
    font-size: 11px;
    margin-right: 6px;
  }
}

/* Disabled button styles for quantity validation */
button.cwqv-disabled,
.single_add_to_cart_button.cwqv-disabled {
  cursor: not-allowed !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

button.cwqv-disabled:hover,
.single_add_to_cart_button.cwqv-disabled:hover {
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Loading animation for quick view add to cart buttons */
.sp-wqv-content .single_add_to_cart_button.loading,
.mfp-content .single_add_to_cart_button.loading {
  position: relative;
  color: white !important;
  cursor: wait !important;
  pointer-events: none !important;
}

.sp-wqv-content .single_add_to_cart_button.loading::after,
.mfp-content .single_add_to_cart_button.loading::after {
  font-family: WooCommerce;
  content: "\e01c";
  vertical-align: top;
  font-weight: 400;
  position: absolute;
  top: 0.618em;
  right: 1em;
  animation: spin 2s linear infinite;
}

/* Success state for add to cart buttons */
.sp-wqv-content .single_add_to_cart_button.added:after,
.mfp-content .single_add_to_cart_button.added:after {
  font-family: WooCommerce;
  content: "\e017";
  margin-left: 0.53em;
  vertical-align: bottom;
}
