/* CSS Custom Properties for Notice Styling */
:root {
  --wsbp-notice-bg: #ff6b6b;
  --wsbp-notice-text: #ffffff;
  --wsbp-notice-border: #ff4757;
}

/* Bricks Builder Integration - Use Bricks colors if available */
:root {
  --wsbp-notice-bg: var(--bricks-color-error, #ff6b6b);
  --wsbp-notice-text: var(--bricks-text-on-error, #ffffff);
  --wsbp-notice-border: var(--bricks-color-error-dark, #ff4757);
}

.b2b-validating .checkout-button,
.b2b-validating #place_order,
.b2b-validating .woocommerce-checkout-button,
.b2b-validating .wfacp_next_page_button,
.b2b-validating .wfacp_main_form .button,
.b2b-validating button[type="submit"]:not(.wfacp-coupon-btn),
.b2b-validating input[type="submit"],
.b2b-validating .wfacp-form .button,
.b2b-validating button[name="woocommerce_checkout_place_order"]{
  opacity:.6;pointer-events:none;transition:none!important
}

/* Keep asterisk inline with price */
.wsbp-asterisk{white-space:nowrap;}

/* FunnelKit: visible focus outline */
#fkcart-modal :is(a,button,[role="button"],
.fkcart-button,.fkcart-add-product-button,
.fkcart-quantity-button,.fkcart-nav-btn,
.fkcart-modal-close,.fkcart-quick-view-close,.fkcart-close,
.fkcart-remove-item,.fkcart-select-product,.fkcart-spl-addon-select,
#fkcart-checkout-button):focus-visible{
  outline:2px solid #0073aa !important;
  outline-offset:2px !important;
}

/* Pulse effect on floating toggler */
#fkcart-floating-toggler.pulsing{
  animation: wsbp-pulse 1s ease-in-out 3;
}
@keyframes wsbp-pulse{
  0%{ transform: scale(1); box-shadow: 0 0 0 0 rgba(0,115,170,.4); }
  50%{ transform: scale(1.06); box-shadow: 0 0 0 10px rgba(0,115,170,0); }
  100%{ transform: scale(1); box-shadow: 0 0 0 0 rgba(0,115,170,0); }
}

/* Hide special addons for B2B users when setting is enabled */
body.b2b-hide-special-addons .fkcart-spl-addons-wrap {
  display: none !important;
}

/* Prevent button flash on single product pages - only main product form buttons */
.single-product form.cart .single_add_to_cart_button:not(.wsbp-button-validated),
.single-product form.cart .add_to_cart_button:not(.wsbp-button-validated),
.single-product form.cart button[name="add-to-cart"]:not(.wsbp-button-validated) {
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.single-product .wsbp-button-validated {
  opacity: 1;
}

/* Local Pickup Checkout Enhancements */
.hide-shipping-address .single_preview:last-child {
  display: none;
}

/* Hide shipping address fields when local pickup is selected */
.hide-shipping-address .shipping_address {
  display: none !important;
}

/* Ensure billing fields are visible when local pickup is selected */
.hide-shipping-address .wfacp_billing_fields {
  display: block !important;
}

.hide-shipping-address .wfacp_billing_field_show {
  display: block !important;
}

/* Hide billing checkbox when local pickup is selected */
.hide-shipping-address #billing_same_as_shipping,
.hide-shipping-address #billing_same_as_shipping + label,
.hide-shipping-address .woocommerce-billing-fields__field-wrapper:has(#billing_same_as_shipping),
.hide-shipping-address .form-row:has(#billing_same_as_shipping) {
  display: none !important;
}

/* Smooth transitions for better UX */
.shipping_address .form-row,
.wfacp_billing_fields,
.wfacp_billing_field_show,
#billing_same_as_shipping,
[class*="form_section_single_step_2_"] {
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

/* Optimize for immediate visibility changes */
.hide-shipping-address .shipping_address .form-row {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hide-shipping-address .wfacp_billing_fields,
.hide-shipping-address .wfacp_billing_field_show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Customer Account Management Styles */
.woo-suite-email-verification {
  margin-top: 10px;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  font-size: 14px;
}

.woo-suite-login-suggestion {
  position: relative;
}

.woo-suite-login-message {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.woo-suite-magic-login-btn {
  background: #0073aa;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.woo-suite-magic-login-btn:hover {
  background: #005a87;
  color: white;
  text-decoration: none;
}

.woo-suite-magic-login-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.woo-suite-success {
  background: #28a745 !important;
}

.woo-suite-error {
  background: #dc3545 !important;
}

.woo-suite-loading {
  color: #666;
  font-style: italic;
}

.woo-suite-login-suggestion .close {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  line-height: 1;
}

.woo-suite-login-suggestion .close:hover {
  color: #666;
}

/* Account creation notice styling */
.woo-suite-account-creation-notice {
  background: #f0f8ff;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #b3d9ff;
  margin: 10px 0;
  font-size: 14px;
  color: #0073aa;
  font-weight: 500;
}

.woo-suite-account-creation-notice:before {
  content: "ℹ️ ";
  margin-right: 8px;
}

/* Hide the original account creation checkbox */
.woocommerce-checkout .form-row.create-account {
  display: none !important;
}

/* Style for when account creation is forced */
.woocommerce-checkout .form-row.create-account.woo-suite-forced {
  display: block !important;
  background: #f0f8ff;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #b3d9ff;
}

.woocommerce-checkout .form-row.create-account.woo-suite-forced label {
  font-weight: 600;
  color: #0073aa;
}

/* Login Link Styles */
.woo-suite-login-button {
  display: inline-block;
  padding: 10px 20px;
  background: #0073aa;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.woo-suite-login-button:hover {
  background: #005a87;
  color: white;
  text-decoration: none;
}

.woo-suite-login-text-link {
  color: #0073aa;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.woo-suite-login-text-link:hover {
  color: #005a87;
  text-decoration: underline;
}

/* Login Modal Styles */
.woo-suite-login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.woo-suite-login-modal-overlay.woo-suite-modal-show {
  opacity: 1;
  visibility: visible;
}

.woo-suite-login-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.woo-suite-login-modal-overlay.woo-suite-modal-show .woo-suite-login-modal {
  transform: scale(1);
}

.woo-suite-login-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0 20px;
  border-bottom: 1px solid #e1e1e1;
  margin-bottom: 20px;
}

.woo-suite-login-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.woo-suite-login-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.woo-suite-login-modal-close:hover {
  background: #f0f0f0;
  color: #666;
}

.woo-suite-login-modal-body {
  padding: 0 20px 20px 20px;
}

.woo-suite-login-modal-description {
  margin: 0 0 20px 0;
  color: #666;
  font-size: 14px;
  text-align: center;
}

.woo-suite-login-modal-form {
  /* Uses same styles as .woo-suite-login-form */
}

/* Loading Styles */
.woo-suite-login-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 999998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.woo-suite-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  animation: woo-suite-spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes woo-suite-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.woo-suite-login-loading p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

/* Body scroll prevention */
body.woo-suite-modal-open {
  overflow: hidden;
}

/* Login Form Styles (for modal) */
.woo-suite-login-form {
  max-width: 400px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.woo-suite-login-title {
  margin: 0 0 15px 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.woo-suite-login-description {
  margin: 0 0 20px 0;
  color: #666;
  text-align: center;
  font-size: 14px;
}

.woo-suite-form-group {
  margin-bottom: 20px;
}

.woo-suite-form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.woo-suite-form-group input[type="email"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.woo-suite-form-group input[type="email"]:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.woo-suite-login-submit {
  width: 100%;
  padding: 12px 24px;
  background: #0073aa;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.woo-suite-login-submit:hover:not(:disabled) {
  background: #005a87;
}

.woo-suite-login-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.woo-suite-login-messages {
  margin-top: 15px;
}

.woo-suite-message {
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.woo-suite-message-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.woo-suite-message-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Bundle Item Price Hiding */
.bundled_table_item .product-total del,
.bundled_table_item .product-total ins {
  display: none;
}

/* Product Title Enhancement Styles */
.product-title-enhancement {
  font-weight: 300;
  font-style: italic;
  color: #666;
}

/* More specific selectors for different contexts if needed */
.product h1 .product-title-enhancement,
.woocommerce-loop-product__title .product-title-enhancement,
.woocommerce div.product .product_title .product-title-enhancement,
.wfacp_mini_cart_item_title .product-title-enhancement,
.woocommerce-cart-item-name .product-title-enhancement,
.woocommerce-order-item-name .product-title-enhancement,
.woocommerce table.cart .product-name .product-title-enhancement,
.woocommerce table.order_details .product-name .product-title-enhancement,
.woocommerce-email .product-name .product-title-enhancement,
.woocommerce-invoice .product-name .product-title-enhancement {
  font-weight: 300;
  font-style: italic;
  color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .woo-suite-login-message {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .woo-suite-login-suggestion .close {
    margin-left: 0;
    margin-top: 10px;
  }
  
  .woo-suite-login-form {
    margin: 10px;
    padding: 15px;
  }
  
  .woo-suite-login-title {
    font-size: 20px;
  }
}

