/* Order form */
.order-section h2 { margin: 6px 0 6px; }
.order-card { padding: 22px; }
.order-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.order-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.order-tab:hover { transform: translateY(-1px); }
.order-tab.is-active {
  background: linear-gradient(180deg, #2780ff, #1462d3);
  border-color: rgba(255,255,255,.18);
}
.order-form { margin-top: 6px; }
.order-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
[data-tab-panel] { display: none; }
.order-field {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.order-field--wide { grid-column: span 12; }
.order-field label { font-weight: 600; color: #dfe7f1; }
.order-field input,
.order-field select {
  background: #0d131b;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.order-field input:focus,
.order-field select:focus {
  outline: 2px solid rgba(77,163,255,.45);
  outline-offset: 2px;
}
.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.option-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  cursor: pointer;
}
.option-pill input { accent-color: var(--brand); }
.color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.color-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(77,163,255,.15);
  border: 1px solid rgba(77,163,255,.35);
  font-size: .9rem;
}
.perf-preview {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(255,255,255,.02);
}
.perf-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #0a0f14;
  border-radius: 10px;
}
.perf-preview figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: .9rem;
}
.perf-code-group {
  margin-top: 12px;
}
.perf-code-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.perf-code-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .15s ease, background .15s ease;
}
.perf-code-btn:hover {
  transform: translateY(-1px);
}
.perf-code-btn.is-active {
  background: linear-gradient(180deg, #2780ff, #1462d3);
  border-color: rgba(255,255,255,.18);
}
.perf-code-placeholder {
  color: var(--muted);
  font-size: .9rem;
}
.order-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.order-card .btn,
.actions-row .btn,
.order-table .btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
  box-shadow: none;
}

.order-card .btn:hover,
.actions-row .btn:hover,
.order-table .btn:hover {
  transform: translateY(-1px);
}

.order-card .btn-primary,
.actions-row .btn-primary,
.order-table .btn-primary {
  background: linear-gradient(180deg, #2780ff, #1462d3);
  border-color: rgba(255,255,255,.18);
  color: #fff;
}

.order-table .order-edit,
.actions-row #send-order {
  background: linear-gradient(180deg, #2780ff, #1462d3);
  border-color: rgba(255,255,255,.18);
  color: #fff;
}

.order-table .order-remove,
.actions-row #clear-all {
  background: linear-gradient(180deg, #d9534f, #b6403b);
  border-color: rgba(255,255,255,.18);
  color: #fff;
}
.form-note {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
@media (max-width: 900px) {
  .order-field { grid-column: span 12; }
}

/* Order form v2 layout (single + collated) */
body {
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, Arial, sans-serif;
}



.banner { display: none; }

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.96);
  z-index: 300;
  width: min(680px, calc(100vw - 32px));
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 800;
  text-align: center;
  font-size: 1rem;
  line-height: 1.45;
  color: #f8fbff;
  background: rgba(10, 18, 28, .92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  backdrop-filter: blur(8px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.toast--error {
  background: linear-gradient(180deg, rgba(120, 22, 22, .96), rgba(76, 12, 12, .96));
  border-color: rgba(255, 180, 180, .22);
}

.toast--success {
  background: linear-gradient(180deg, rgba(20, 115, 58, .96), rgba(12, 76, 39, .96));
  border-color: rgba(180, 255, 210, .24);
}

.order-panel { margin-top: 8px; }
.order-panel[hidden] { display: none; }

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 24px;
  align-items: start;
}

.form-preview { order: 2; }
.form-fields { order: 1; }

.form-preview {
  position: relative;
  max-width: 360px;
}

.sketch-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(255,255,255,.02);
  height: clamp(220px, 28vw, 320px);
}

.sketch-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #0a0f14;
}

.brand-collage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-collage img {
  max-height: 36px;
  width: auto;
  background: transparent;
}

.preview-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.form-fields { width: 100%; }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-row--quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.form-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-label {
  font-weight: 700;
  color: #dfe7f1;
}

.form-input,
.form-select,
.form-textarea {
  background: #0d131b;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.98rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: 2px solid rgba(77,163,255,.45);
  outline-offset: 2px;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-static {
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}

.form-cell--colors,
.form-cell--radio {
  grid-column: span 2;
}

.form-cell--radio {
  min-width: 0;
}

fieldset.form-cell--radio {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 8px;
  align-items: center;
}

legend.form-label {
  margin-bottom: 0;
  padding: 0;
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
}

.radio-stack {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.color-grid--row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.color-select {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.color-placeholder,
.perf-code-placeholder {
  color: var(--muted);
  font-size: .9rem;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-start;
}

.addon-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}

.addon-title {
  font-weight: 700;
  color: #dfe7f1;
  margin-bottom: 10px;
}

.addon-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.addon-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.addon-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}

.addon-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.addon-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
}

.addon-remove {
  padding-left: 12px;
  padding-right: 12px;
}

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

.order-list {
  margin-top: 22px;
}

.order-list__header h2 {
  margin: 0 0 10px;
}

.customer-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}

.customer-account__copy {
  display: grid;
  gap: 4px;
}

.customer-account__copy p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

.customer-account__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.order-table th,
.order-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: .95rem;
}

.order-table img {
  display: block;
  max-height: 20px;
  width: auto;
  margin: 0 auto;
}

.order-table th {
  background: rgba(255,255,255,.04);
  font-weight: 700;
}

.order-empty td {
  color: var(--muted);
  font-style: italic;
}

.order-table .order-actions {
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: center;
  margin-top: 0;
}

.order-table .btn {
  white-space: nowrap;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.contact-grid > label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.contact-grid > label > span {
  min-width: 70px;
}

.contact-grid > label > input {
  flex: 1;
  min-width: 0;
}

.order-list > label {
  display: block;
  width: 100%;
}

.order-list .form-textarea {
  width: 100%;
}

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

@media (max-width: 1000px) {
  .form-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .form-preview {
    max-width: 100%;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-row--quad {
    grid-template-columns: 1fr;
  }
  .form-cell--colors,
  .form-cell--radio {
    grid-column: span 1;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .customer-account {
    flex-direction: column;
    align-items: stretch;
  }
  .contact-grid > label {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

@media (max-width: 700px) {
  .order-card {
    padding: 14px;
  }

  .order-tabs {
    gap: 8px;
    margin-bottom: 12px;
  }

  .order-tab {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
  }

  .form-layout {
    gap: 14px;
  }

  .form-preview {
    order: 1;
  }

  .form-fields {
    order: 2;
  }

  .sketch-frame {
    height: clamp(140px, 42vw, 190px);
    padding: 10px;
  }

  .preview-note {
    margin-top: 6px;
    font-size: .84rem;
  }

  .form-row,
  .form-row--quad,
  .color-grid,
  .color-grid--row,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-label,
  legend.form-label {
    font-size: .95rem;
    white-space: normal;
  }

  fieldset.form-cell--radio {
    display: block;
  }

  .radio-stack {
    gap: 10px 14px;
    align-items: flex-start;
  }

  .radio-stack label {
    font-size: .95rem;
  }

  .customer-account {
    padding: 12px;
    gap: 12px;
  }

  .customer-account__actions,
  .actions-row,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .customer-account__actions .btn,
  .actions-row .btn,
  .form-actions .btn {
    width: 100%;
  }

  .table-scroll {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .order-table {
    min-width: 0;
    display: block;
  }

  .order-table thead {
    display: none;
  }

  .order-table tbody {
    display: grid;
    gap: 12px;
  }

  .order-table tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    padding: 10px 12px;
  }

  .order-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-align: left;
    font-size: .92rem;
  }

  .order-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .order-table td::before {
    content: "";
    flex: 0 0 92px;
    color: var(--muted);
    font-weight: 700;
  }

  .order-table td:nth-child(1)::before { content: "#"; }
  .order-table td:nth-child(2)::before { content: "Type"; }
  .order-table td:nth-child(3)::before { content: "Size"; }
  .order-table td:nth-child(4)::before { content: "Perf"; }
  .order-table td:nth-child(5)::before { content: "Details"; }
  .order-table td:nth-child(6)::before { content: "Qty"; }
  .order-table td:nth-child(7)::before { content: "Print"; }
  .order-table td:nth-child(8)::before { content: "Brand"; }
  .order-table td:nth-child(9)::before { content: "Actions"; }

  .order-table .order-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .order-table .btn {
    flex: 1 1 140px;
  }

  .order-empty td {
    display: block;
    border: 0;
    padding: 0;
    text-align: left;
  }

  .order-empty td::before {
    content: none;
  }
}
