/**
 * Public-facing styles for WooCommerce Product Order Form
 */

.wcpof-order-form-container {
  margin: 40px 0;
  padding: 25px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.wcpof-order-form-container h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.wcpof-form-description {
  margin-bottom: 25px;
  color: #6c757d;
}

.wcpof-message-container {
  margin-bottom: 20px;
  padding: 12px 15px;
  border-radius: 4px;
  display: none; /* Hidden by default */
}

.wcpof-message-container.success {
  background-color: #f0f9eb;
  border-left: 4px solid #67c23a;
  color: #67c23a;
}

.wcpof-message-container.error {
  background-color: #fef0f0;
  border-left: 4px solid #f56c6c;
  color: #f56c6c;
}

.wcpof-message {
  font-size: 14px;
  line-height: 1.5;
}

.wcpof-order-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.wcpof-form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.wcpof-form-row label {
  margin-bottom: 5px;
  font-weight: 500;
  color: #495057;
}

.wcpof-form-row label .required {
  color: #dc3545;
}

.wcpof-form-row input[type="text"],
.wcpof-form-row input[type="tel"],
.wcpof-form-row input[type="email"],
.wcpof-form-row textarea {
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.wcpof-form-row input[type="text"]:focus,
.wcpof-form-row input[type="tel"]:focus,
.wcpof-form-row input[type="email"]:focus,
.wcpof-form-row textarea:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.wcpof-form-row.error input,
.wcpof-form-row.error textarea {
  border-color: #dc3545;
}

.wcpof-error-message {
  margin-top: 5px;
  color: #dc3545;
  font-size: 14px;
}

.wcpof-submit-row {
  margin-top: 10px;
}

.wcpof-submit-button {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 16px;
  line-height: 1.5;
  border-radius: 0.25rem;
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.wcpof-submit-button:hover {
  color: #fff;
  background-color: #0069d9;
  border-color: #0062cc;
}

.wcpof-submit-button:focus {
  color: #fff;
  background-color: #0069d9;
  border-color: #0062cc;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

.wcpof-submit-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Quantity input styles */
.wcpof-quantity-wrapper {
  display: flex;
  align-items: center;
  max-width: 150px;
}

.wcpof-quantity-input {
  width: 60px;
  text-align: center;
  border: 1px solid #007bff;
  border-radius: 0;
  height: 40px;
  padding: 0 5px;
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
  font-weight: bold;
  font-size: 16px;
  color: #333;
}

.wcpof-quantity-input:focus {
  outline: none;
  border-color: #0069d9;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.wcpof-quantity-input::-webkit-outer-spin-button,
.wcpof-quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wcpof-quantity-btn {
  flex: 0 0 40px;
  height: 40px;
  background-color: #f7f7f7;
  border: 1px solid #e5e5e5;
  color: rgb(32, 32, 32);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin: 0 4px;
}

.wcpof-quantity-btn:hover {
  background-color: #e5e5e5;
  border-color: #e5e5e5;
}

/* Order Information and Shipping Fees Styles */
.wcpof-additional-info {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

/* Order Summary Styles */
.wcpof-order-summary {
  margin-top: 20px;
  padding: 15px;
  background-color: #f7f7f7;
  border-radius: 5px;
  border: 1px solid #d9d9d9;
}

.wcpof-order-summary h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
}

.wcpof-summary-table {
  width: 100%;
}

.wcpof-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #e0e0e0;
}

.wcpof-summary-row:last-child {
  border-bottom: none;
}

.wcpof-summary-total {
  font-weight: bold;
  margin-top: 0px;
  border-top: 2px solid #e0e0e0;
  border-bottom: none !important;
  padding-top: 10px;
}

/* Sticky button styles */
.wcpof-sticky-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  transition: all 0.3s ease;
}

.wcpof-scroll-to-form {
  background-color: #0073aa;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.wcpof-scroll-to-form:hover {
  background-color: #005177;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .wcpof-order-form-container {
    padding: 20px 15px;
  }

  .wcpof-submit-button {
    width: 100%;
  }

  .wcpof-sticky-button {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    border-top: 1px solid #a7a7a7;
    background-color: white;
  }

  .wcpof-scroll-to-form {
    width: 100%;
    border-radius: 0;
    padding: 15px 20px;
    font-size: 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  }

  .wcpof-scroll-to-form:hover {
    transform: none;
  }
}

.wcpof-order-info,
.wcpof-shipping-fees {
  margin-top: 15px;
  margin-bottom: 15px;
  padding: 12px 15px;
  background-color: #f1f8ff;
  border-radius: 4px;
  border-left: 4px solid #007bff;
}

.wcpof-shipping-fees {
  background-color: #fff8f1;
  border-left-color: #ff9800;
}

.wcpof-order-info p,
.wcpof-shipping-fees p {
  margin: 0;
  display: flex;
  align-items: center;
  color: #495057;
  font-size: 14px;
  line-height: 1.5;
}

.wcpof-order-info .dashicons,
.wcpof-shipping-fees .dashicons {
  margin-right: 8px;
  color: #007bff;
  font-size: 18px;
}

.wcpof-shipping-fees .dashicons {
  color: #ff9800;
}

/* Preloader styles */
.wcpof-preloader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.wcpof-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: wcpof-spin 1s linear infinite;
  margin-bottom: 15px;
}

.wcpof-preloader-text {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

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