/* Store sample + order modals (preview stores) */
.store-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

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

.store-modal {
  background: #fff;
  border-radius: 12px;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  position: relative;
}

.store-modal-wide {
  width: min(640px, 100%);
}

.store-modal-header {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid #e4e4e7;
  padding-right: 3rem;
}

.store-modal-header h2 {
  font-size: 1.15rem;
  margin: 0;
  color: #1a1a1a;
}

.store-modal-header p {
  font-size: 0.875rem;
  color: #6b6b6b;
  margin: 0.35rem 0 0;
}

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

.store-modal-close:hover {
  color: #1a1a1a;
}

.store-modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.store-field-group > label,
.store-modal-body > label:not(.store-auth-box):not(.store-design-option),
.store-order-row-note > label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.35rem;
}

.store-modal-body input[type="text"],
.store-modal-body input[type="email"],
.store-modal-body input[type="number"],
.store-modal-body select,
.store-modal-body textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  font: inherit;
  margin-bottom: 1rem;
}

.store-modal-body .order-line input,
.store-modal-body .order-line select,
.store-modal-body .store-order-row-note input {
  margin-bottom: 0;
}

.store-modal-body textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.store-field-group {
  margin-bottom: 0.25rem;
}

.store-design-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.store-design-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 400;
  margin-bottom: 0;
}

.store-design-option input[type="checkbox"],
.store-design-option input[type="radio"] {
  margin: 0.15rem 0 0 0;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

.store-auth-box {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

.store-auth-box input[type="checkbox"] {
  margin: 0.2rem 0 0 0;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

.store-auth-box > span {
  flex: 1;
  min-width: 0;
}

.store-order-row {
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.65rem;
}

.store-order-row.is-disabled {
  opacity: 0.55;
}

.store-order-row-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.store-order-row-head input[type="checkbox"] {
  margin: 0.15rem 0 0 0;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

.store-order-row-head > span {
  flex: 1;
  min-width: 0;
}

.store-order-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.order-line {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: end;
}

.order-line-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.order-line-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0;
  color: #1a1a1a;
}

.order-line-field input,
.order-line-field select {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
  min-height: 2.5rem;
}

.order-line-action {
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding-bottom: 0;
}

.store-design-option:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
}

.order-line-spacer {
  width: 2.25rem;
  height: 2.25rem;
}

.order-line-remove {
  background: none;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  color: #6b6b6b;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  margin-bottom: 0;
}

.order-line-remove:hover {
  color: #991b1b;
  border-color: #fecaca;
  background: #fef2f2;
}

.order-add-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #2563eb;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.order-add-line:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #2563eb;
}

.order-add-line:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.store-order-row-note input {
  margin-bottom: 0;
}

.store-modal-note {
  font-size: 0.8125rem;
  color: #6b6b6b;
  margin: 0 0 1rem;
}

.store-modal-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.store-modal-success {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.store-modal-success h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.store-modal-success p {
  font-size: 0.9rem;
  color: #6b6b6b;
  margin: 0;
}

.store-modal-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.store-modal-submit:hover {
  opacity: 0.92;
}

.store-modal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cta-section .cta-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-section button.cta {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.cta-section .cta-order {
  background: transparent;
  color: var(--accent, #2563eb);
  box-shadow: inset 0 0 0 2px var(--accent, #2563eb);
}

.cta-section .cta-order:hover {
  opacity: 0.88;
}

.store-modal-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

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

  .order-line-remove {
    grid-column: 2;
    justify-self: end;
  }
}
