:root {
  --om-primary: #2D4739;
  --om-primary-hover: #1A3C34;
  --om-accent: #F9C8CC;
  --om-overlay: rgba(26, 60, 52, 0.45);
  --om-surface: #ffffff;
  --om-text: #333333;
  --om-text-muted: #666666;
  --om-border: #e5e5e5;
  --om-radius: 16px;
}

.order-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.order-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.order-modal__overlay {
  position: absolute;
  inset: 0;
  background: var(--om-overlay);
  border: none;
  cursor: pointer;
}

.order-modal__dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--om-surface);
  border-radius: var(--om-radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  padding: 2rem;
}

.order-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--om-text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.order-modal__close:hover {
  background: #f0f0f0;
  color: var(--om-text);
}

.order-modal__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--om-primary);
  margin-bottom: 0.25rem;
  padding-right: 2rem;
}

.order-modal__subtitle {
  font-size: 0.9375rem;
  color: var(--om-text-muted);
  margin-bottom: 1.5rem;
}

.order-modal__field {
  margin-bottom: 1.125rem;
}

fieldset.order-modal__field {
  border: none;
  padding: 0;
  margin: 0 0 1.125rem;
}

fieldset.order-modal__field legend {
  padding: 0;
}

.order-modal__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--om-text);
  margin-bottom: 0.375rem;
}

.order-modal__row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 0.875rem;
}

.order-modal__field--quantity .order-modal__input {
  text-align: center;
}

.order-modal__input,
.order-modal__textarea,
.order-modal__select {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--om-text);
  background: var(--om-surface);
  border: 1px solid var(--om-border);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.order-modal__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.order-modal__textarea {
  min-height: 80px;
  resize: vertical;
}

.order-modal__textarea--comment {
  min-height: 64px;
}

.order-modal__input:focus,
.order-modal__textarea:focus,
.order-modal__select:focus {
  outline: none;
  border-color: var(--om-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--om-primary) 15%, transparent);
}

.order-modal__input::placeholder,
.order-modal__textarea::placeholder {
  color: #aaa;
}

.order-modal__payment {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.order-modal__option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--om-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.order-modal__option:has(input:checked) {
  border-color: var(--om-primary);
  background: color-mix(in srgb, var(--om-accent) 25%, transparent);
}

.order-modal__option:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.order-modal__option input {
  margin-top: 3px;
  accent-color: var(--om-primary);
}

.order-modal__option input:disabled {
  cursor: not-allowed;
}

.order-modal__option-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.order-modal__option-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--om-text);
}

.order-modal__option-hint {
  font-size: 0.8125rem;
  color: var(--om-text-muted);
}

.order-modal__submit {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.875rem 1.5rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--om-primary);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.order-modal__submit:hover {
  background: var(--om-primary-hover);
}

.order-modal__submit:active {
  transform: scale(0.98);
}

.order-modal__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.order-modal__status {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  text-align: center;
}

.order-modal__status--success {
  color: #2d6a4f;
}

.order-modal__status--error {
  color: #b42318;
}

@media (max-width: 480px) {
  .order-modal__row {
    grid-template-columns: 1fr;
  }

  .order-modal {
    padding: 16px;
    align-items: flex-end;
  }

  .order-modal__dialog {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 90vh;
  }
}
