/* Order Modal Styles - Story 8.2 */
/* Based on consent-banner.css pattern */

.order-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  pointer-events: all;
}

.order-modal-dialog {
  position: relative;
  z-index: 10001;
  max-width: 500px;
  width: 90%;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.order-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6c757d;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.order-modal-close:hover {
  color: #2c3e50;
}

.order-modal-dialog h2 {
  color: #2c3e50;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #007bff;
  padding-right: 2rem;
}

.order-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.order-modal-field label {
  color: #2c3e50;
  font-weight: 500;
  font-size: 0.9rem;
}

.order-modal-input {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.order-modal-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.order-modal-input.invalid {
  border-color: #dc3545;
}

.order-modal-input.invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.order-modal-error {
  color: #dc3545;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.order-modal-consents {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-modal-consent {
  padding: 0.75rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.order-modal-consent label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #495057;
}

.order-modal-consent input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.order-modal-link {
  color: #007bff;
  text-decoration: underline;
}

.order-modal-link:hover {
  color: #0056b3;
}

.order-modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.order-modal-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.order-modal-btn.primary {
  background: #007bff;
  color: white;
}

.order-modal-btn.primary:hover:not(:disabled) {
  background: #0056b3;
}

.order-modal-btn.primary:disabled {
  background: #b0c4de;
  cursor: not-allowed;
}

.order-modal-btn.secondary {
  background: #6c757d;
  color: white;
}

.order-modal-btn.secondary:hover {
  background: #545b62;
}

.order-modal-btn:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.order-modal-error-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  color: #721c24;
}

body.order-modal-active {
  overflow: hidden;
}

@media (max-width: 600px) {
  .order-modal-dialog {
    width: 95%;
    padding: 1.5rem;
    max-height: 95vh;
  }

  .order-modal-dialog h2 {
    font-size: 1.25rem;
  }

  .order-modal-buttons {
    flex-direction: column;
  }

  .order-modal-btn {
    width: 100%;
  }
}

.order-modal-dialog::-webkit-scrollbar {
  width: 8px;
}

.order-modal-dialog::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.order-modal-dialog::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 4px;
}

.order-modal-dialog::-webkit-scrollbar-thumb:hover {
  background: #c8ccd0;
}
