/* Lead Modal Styles */
.lead-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.lead-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lead-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lead-modal-overlay.open .lead-modal {
  transform: translateY(0);
}

.lead-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lead-modal-close:hover {
  background: #1d525c;
  color: #fff;
}

.lead-modal-header {
  padding: 30px 30px 20px;
  border-bottom: 1px solid #eee;
}

.lead-modal-header h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #1d525c;
  font-weight: 700;
}

.lead-modal-header p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.lead-form {
  padding: 25px 30px 30px;
}

.lead-form-row {
  display: flex;
  gap: 15px;
}

.lead-form-row .lead-form-group {
  flex: 1;
}

.lead-form-group {
  margin-bottom: 20px;
}

.lead-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.lead-form-group input[type="text"],
.lead-form-group input[type="tel"],
.lead-form-group select,
.lead-form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.lead-form-group input:focus,
.lead-form-group select:focus,
.lead-form-group textarea:focus {
  outline: none;
  border-color: #1d525c;
  box-shadow: 0 0 0 3px rgba(29, 82, 92, 0.1);
}

/* Validation error styles */
.lead-error-message {
  display: block;
  color: #dc3545;
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

.lead-input-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.lead-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Products list */
.lead-products-list {
  max-height: 280px;
  overflow-y: auto;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px;
}

.lead-product-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-bottom: 4px;
}

.lead-product-item:last-child {
  margin-bottom: 0;
}

.lead-product-item:hover {
  background: #f5f5f5;
}

.lead-product-item.selected {
  background: rgba(29, 82, 92, 0.1);
}

.lead-product-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
}

.lead-product-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1d525c;
  cursor: pointer;
  flex-shrink: 0;
}

.lead-product-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.lead-product-name {
  font-weight: 500;
  color: #333;
  flex: 1;
}

.lead-product-price {
  color: #1d525c;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  margin-left: 10px;
}

/* Product quantity selector */
.lead-product-quantity {
  display: none;
  margin-top: 10px;
  padding-left: 28px;
}

.lead-product-quantity.visible {
  display: block;
}

/* Quantity input with unit label */
.lead-quantity-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-quantity-input {
  width: 80px;
  padding: 8px 12px;
  border: 2px solid #1d525c;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: #333;
  text-align: center;
  transition: box-shadow 0.2s ease;
}

.lead-quantity-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 82, 92, 0.15);
}

.lead-quantity-input::-webkit-outer-spin-button,
.lead-quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lead-quantity-input[type=number] {
  -moz-appearance: textfield;
}

.lead-unit-label {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

/* Shipping info */
.lead-shipping-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 8px;
  border-left: 4px solid #1d525c;
}

.shipping-label {
  color: #666;
  font-size: 14px;
}

.shipping-cost {
  font-weight: 700;
  color: #1d525c;
  font-size: 15px;
}

/* Order total display */
.lead-order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1d525c, #2a6b77);
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(29, 82, 92, 0.3);
}

.lead-total-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 500;
}

.lead-total-amount {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Submit button */
.lead-submit-btn {
  width: 100%;
  padding: 16px 30px;
  background: linear-gradient(135deg, #1d525c, #2a6b77);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lead-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 82, 92, 0.4);
}

.lead-submit-btn:active {
  transform: translateY(0);
}

/* Success message */
.lead-success {
  text-align: center;
  padding: 40px 20px;
}

.lead-success svg {
  margin-bottom: 20px;
}

.lead-success h3 {
  margin: 0 0 10px;
  font-size: 22px;
  color: #1d525c;
}

.lead-success p {
  margin: 0 0 25px;
  color: #666;
}

.lead-success-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.lead-success-buttons .lead-submit-btn {
  width: auto;
  padding: 14px 28px;
}

.lead-new-order-btn {
  background: linear-gradient(135deg, #1d525c, #2a6b77);
}

.lead-close-btn {
  background: linear-gradient(135deg, #666, #888);
}

/* Lead Buy Button Section - replaces login form */
.lead-buy-section {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  border: 2px solid #e0e0e0;
  margin: 20px 0;
}

.lead-buy-section h2 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #1d525c;
  font-weight: 700;
}

.lead-buy-section p {
  margin: 0 0 20px;
  color: #666;
  font-size: 15px;
  line-height: 1.5;
}

.lead-buy-section .lead-modal-trigger.single-button {
  display: inline-block;
  padding: 16px 40px;
  background: linear-gradient(135deg, #1d525c, #2a6b77);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lead-buy-section .lead-modal-trigger.single-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 82, 92, 0.4);
}

.lead-buy-section .lead-modal-trigger.single-button:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
  .lead-modal {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }
  
  .lead-modal-header,
  .lead-form {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .lead-form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .lead-modal-header h2 {
    font-size: 20px;
  }
  
  .lead-buy-section {
    padding: 20px;
  }
  
  .lead-buy-section h2 {
    font-size: 18px;
  }
}
