/**
 * BH Store - Buy Now Styles
 */

/* Buttons Wrapper */
.bhstore-buttons-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* Responsive: side by side on larger screens */
@media (min-width: 640px) {
  .bhstore-buttons-wrapper {
    flex-direction: row;
    align-items: stretch;
  }

  .bhstore-buttons-wrapper > .single_add_to_cart_button {
    flex: 1;
    margin-top: 0 !important;
  }

  .bhstore-buttons-wrapper > .bhstore-buy-now-button {
    flex: 1;
    margin-top: 0 !important;
  }
}

/* Buy Now Button */
.bhstore-buy-now-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0;
  width: 100%;
  background-color: transparent;
  border: 1px solid currentColor;
  color: inherit;
  transition: all 0.3s ease;
  position: relative;
}
/*
.bhstore-buy-now-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateX(4px);
}
*/

.bhstore-buy-now-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bhstore-buy-now-button.loading {
  pointer-events: none;
}

/* Arrow icon */
.bhstore-buy-now-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.bhstore-buy-now-button:hover .bhstore-buy-now-arrow {
  transform: translateX(4px);
}

/* Loading spinner */
.bhstore-buy-now-button .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: bhstore-spinner 0.6s linear infinite;
  margin-right: 0.5rem;
}

@keyframes bhstore-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Notices */
.bhstore-buynow-notice {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  animation: bhstore-notice-in 0.3s ease;
}

@keyframes bhstore-notice-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bhstore-buynow-notice--error {
  background-color: #fee;
  border: 1px solid #fcc;
  color: #c33;
}

.bhstore-buynow-notice--success {
  background-color: #efe;
  border: 1px solid #cfc;
  color: #3c3;
}

/* WAPF Field Error State */
.wapf-field-error {
  animation: bhstore-shake 0.4s ease;
}

.wapf-field-error .wapf-field-input input,
.wapf-field-error .wapf-field-input textarea,
.wapf-field-error .wapf-field-input select {
  border-color: #c33 !important;
  box-shadow: 0 0 0 2px rgba(204, 51, 51, 0.1) !important;
}

@keyframes bhstore-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .bhstore-buy-now-button {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }

  .bhstore-buttons-wrapper {
    gap: 0.75rem;
  }
}

/* Dark theme compatibility */
@media (prefers-color-scheme: dark) {
  .bhstore-buy-now-button {
    border-color: rgba(255, 255, 255, 0.3);
  }

  .bhstore-buy-now-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

button.bhstore-buy-now-button.single_add_to_cart_button.button.alt {
  background-color: #e22415;
}

button.bhstore-buy-now-button.single_add_to_cart_button.button.alt:hover {
  border-color: #b21f13;
}
