/* Add to Cart with Quantity Widget CSS */

.add-to-cart-quantity-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

/* Quantity Selector */
.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 120px;
  height: 40px;
  background-color: #f5f5f5;
  border-radius: 4px;
  margin-bottom: 15px;
  overflow: hidden;
  border: 1px solid black !important;
}

.quantity-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 100%;
  background-color: #e0e0e0;
  border: none !important;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  transition: background-color 0.2s ease;
  padding: 0 !important;
}

.quantity-button:hover {
  background-color: #b18d59 !important;
}

.quantity-button:focus {
  outline: none;
}

.quantity-input {
  flex: 1;
  height: 100%;
  border: none !important;
  background-color: transparent;
  text-align: center;
  font-size: 16px;
  color: #333;
  padding: 0 !important;
  margin: 0;
  -moz-appearance: textfield; /* Firefox */
}

/* Hide spinner for webkit browsers */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Add to Cart Button */
.add-to-cart-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  width: auto;
}

.add-to-cart-button:hover {
  background-color: #45a049;
}

.add-to-cart-button:active {
  transform: scale(0.98);
}

.button-icon {
  display: inline-flex;
  align-items: center;
}
.add-to-cart-quantity-wrapper .add-to-cart-button svg {
  width: 1em;
  fill: currentColor;
}

.add-to-cart-quantity-wrapper .button-icon-before {
  margin-right: 8px;
}

.button-icon-after {
  margin-left: 8px;
}

/* Loading State */
.add-to-cart-button.loading {
  opacity: 0.7;
  cursor: wait;
  position: relative;
}

.add-to-cart-button.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  right: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success Message */
.add-to-cart-message {
  margin-top: 10px;
  padding: 10px 15px;
  background-color: #dff0d8;
  color: #3c763d;
  border-radius: 4px;
  font-size: 14px;
  animation: fadeIn 0.5s ease-in-out;
  width: 100%;
  position: absolute;
  top: -10px;
  left: 0;
}
.added_to_cart.wc-forward {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Styles */
@media (max-width: 767px) {
  .add-to-cart-quantity-wrapper {
    width: 100%;
  }

  .add-to-cart-button {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Product Loop Context */
.products .product .add-to-cart-quantity-wrapper {
  margin-top: 10px;
}

/* Single Product Context */
.single-product .add-to-cart-quantity-wrapper {
  margin-top: 20px;
}
