.orders-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

@media (min-width: 561px) {
  .orders-filters:has(#orders-reset:not([hidden])) {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  }
}

.orders-filters label {
  display: grid;
  min-width: 0;
  gap: 5px;
  margin: 0;
}

.orders-filters input, .orders-filters select {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.orders-filters .button, .orders-pagination .button, .orders-state .button {
  min-height: 44px;
  font-size: .85rem;
}

.orders-state {
  background: var(--surface);
}

.orders-table-wrap:not([hidden]) + .orders-state {
  margin-top: 12px;
}

.orders-state #orders-feedback {
  margin: 0;
  color: var(--wine);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
}

.orders-state #orders-feedback-detail {
  margin: 7px auto 0;
  max-width: 52ch;
}

.orders-state .button {
  margin-top: 14px;
}

.orders-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
  font-size: .9rem;
}

.orders-table th, .orders-table td {
  padding: 13px clamp(7px, 1.25vw, 17px);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.orders-table th {
  background: var(--paper);
  color: var(--muted);
  font-size: .76rem;
  letter-spacing: .01em;
}

.orders-table th:first-child { width: 24%; }
.orders-table th:nth-child(2) { width: 22%; }
.orders-table th:nth-child(3) { width: 16%; }
.orders-table th:nth-child(4) { width: 15%; }
.orders-table th:nth-child(5) { width: 11%; }

.orders-table td {
  border-top: 1px solid var(--line);
}

.orders-table td strong, .orders-table td small {
  display: block;
}

.orders-table td small, .orders-table td time {
  color: var(--muted);
}

.orders-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--wine);
  font-weight: 700;
  text-underline-offset: .18em;
}

.orders-action:hover {
  text-decoration-thickness: 2px;
}

.orders-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 13px;
}

.orders-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1040px) {
  .orders-table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
  }

  .orders-table, .orders-table tbody {
    display: grid;
    gap: 9px;
  }

  .orders-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .orders-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 13px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
  }

  .orders-table td {
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .orders-table td:first-child {
    grid-column: span 2;
  }

  .orders-table td:last-child {
    grid-column: 1 / -1;
  }

  .orders-table td::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: .75rem;
  }

  .orders-table td[data-label]::before {
    content: attr(data-label) / "";
  }
}

@media (max-width: 560px) {
  .orders-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .orders-filters .button {
    justify-self: start;
  }

  .orders-table tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orders-table td:first-child {
    grid-column: 1 / -1;
  }
}
