.demo-section {
  --demo-border: #573044;
  --demo-control: #26141f;
  --demo-surface: #1c1018;
  --demo-text: #f8e8ee;
  --demo-muted: #cdb4bf;
  padding-block: clamp(44px, 7vw, 92px);
  border-block: 1px solid #472536;
  background: radial-gradient(ellipse at 85% 0%, #3d1527 0%, transparent 38%), #160b13;
}

.demo-heading .section-subtitle {
  max-width: 44ch;
}

.demo-panel {
  min-width: 0;
  padding: clamp(15px, 2.75vw, 34px);
  border: 1px solid var(--demo-border);
  border-radius: 15px;
  background: linear-gradient(150deg, #291522, var(--demo-surface) 34%);
  box-shadow: 0 12px 32px #07030638;
}

.demo-panel + .demo-panel {
  margin-top: clamp(20px, 3.5vw, 42px);
}

.demo-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
  margin-bottom: clamp(19px, 2.5vw, 30px);
}

.demo-panel-head h3 {
  color: var(--demo-text);
  font-size: clamp(25px, 3.25vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.038em;
}

.demo-panel-head .eyebrow {
  margin-bottom: 8px;
}

.demo-panel-head p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--demo-muted);
  font-size: 14px;
}

.demo-toolbar {
  display: grid;
  gap: 12px;
  align-items: end;
}

.catalog-toolbar {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.admin-toolbar {
  grid-template-columns: minmax(0, 27rem) auto;
  justify-content: space-between;
}

.demo-field {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--demo-text);
  font-size: 13px;
  font-weight: 500;
}

.demo-field :is(input:not([type='checkbox']), select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #704157;
  border-radius: 7px;
  color: var(--demo-text);
  background: var(--demo-control);
  font: 400 16px/1.35 var(--body-font);
}

.demo-field input::placeholder,
.demo-field textarea::placeholder {
  color: #b49ba7;
  opacity: 1;
}

.demo-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 6px;
  color: var(--demo-text);
  font-size: 13px;
  cursor: pointer;
}

.demo-checkbox input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #d45276;
  cursor: pointer;
}

.demo-results {
  margin-block: 12px 16px;
  color: var(--demo-muted);
  font: 400 12px/1.4 var(--mono-font);
}

.demo-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.35vw, 16px);
}

.demo-product {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #5e354a;
  border-radius: 10px;
  background: #24131e;
}

.demo-product-image {
  display: block;
  width: 100%;
  aspect-ratio: 6 / 5;
  border-bottom: 1px solid #5e354a;
  background: radial-gradient(ellipse at 70% 34%, #684657, transparent 61%), linear-gradient(130deg, #241622, #3c2838);
  color: #d2b8c5;
}

.demo-product-photo {
  position: relative;
  overflow: hidden;
}

.demo-product-subject {
  position: absolute;
  inset: 0;
}

.demo-product-subject img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-product-placeholder {
  display: grid;
  place-items: center;
  font-size: 13px;
  text-align: center;
}

.demo-product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: clamp(12px, 1.45vw, 18px);
}

.demo-product-category {
  color: #f1a7bb;
  font: 500 11px/1.35 var(--mono-font);
  letter-spacing: .045em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.demo-product h4 {
  margin: 0;
  color: var(--demo-text);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.22;
  font-weight: 630;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.demo-product-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 7px;
}

.demo-product-prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 9px;
}

.demo-price {
  color: #ffb7ca;
  font: 500 clamp(14px, 1.55vw, 18px)/1.3 var(--mono-font);
  white-space: nowrap;
}

.demo-old-price {
  color: #d1a5b5;
  font: 500 12px/1.3 var(--mono-font);
  text-decoration-thickness: 1px;
  white-space: nowrap;
}

.demo-table .demo-product-prices {
  display: grid;
  gap: 2px;
}

.demo-table .demo-price {
  font-size: 14px;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #456358;
  border-radius: 100px;
  background: #1b342e;
  color: #a9e6ca;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}

.demo-badge::before {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.demo-badge-unavailable,
.demo-badge-hidden {
  border-color: #765064;
  background: #362333;
  color: #e6c0cf;
}

.demo-button,
.demo-card-action,
.demo-row-action,
.demo-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid #875067;
  border-radius: 7px;
  background: #392032;
  color: var(--demo-text);
  font: 500 13px/1.25 var(--body-font);
  text-align: center;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}

.demo-button:hover,
.demo-card-action:hover,
.demo-row-action:hover,
.demo-dialog-close:hover {
  border-color: #d6819c;
  background: #502941;
}

.demo-button:disabled,
.demo-card-action:disabled,
.demo-row-action:disabled {
  opacity: .6;
  cursor: default;
}

.demo-button {
  border-color: #db7290;
  background: #863751;
  color: #fff6f8;
}

.demo-button:hover {
  background: #a04160;
}

.demo-button-secondary {
  border-color: #805069;
  background: #30202d;
  color: #ebcbd7;
}

.demo-button-secondary:hover {
  background: #4c2b41;
}

.demo-card-action {
  width: 100%;
  margin-top: 5px;
}

.demo-actions,
.demo-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.demo-table-wrap {
  min-width: 0;
  margin-top: 15px;
  overflow: auto;
  border: 1px solid var(--demo-border);
  border-radius: 9px;
}

.demo-table {
  width: 100%;
  border-spacing: 0;
  color: var(--demo-text);
  font-size: 14px;
  text-align: left;
}

.demo-table th,
.demo-table td {
  padding: 8px clamp(8px, 1.35vw, 16px);
  vertical-align: middle;
}

.demo-table th {
  background: #331d2d;
  color: #f0cad8;
  font: 500 11px/1.25 var(--mono-font);
  letter-spacing: .055em;
  text-transform: uppercase;
}

.demo-table td {
  border-top: 1px solid #523044;
}

.demo-table td:first-child {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.demo-table tbody tr:nth-child(even) {
  background: #291722;
}

.demo-table tbody tr:focus-within {
  background: #3b2233;
}

.demo-table td:nth-child(3),
.demo-table td:nth-child(4) {
  font-family: var(--mono-font);
  white-space: nowrap;
}

.demo-table td:last-child {
  text-align: right;
}

.demo-row-action {
  min-height: 40px;
}

.demo-status,
.demo-form-error {
  color: #ffd5e1;
  font-size: 13px;
}

.demo-note {
  margin-top: 13px;
  color: var(--demo-muted);
  font-size: 13px;
}

.demo-status:not(:empty),
.demo-form-error:not(:empty) {
  margin-top: 10px;
}

.demo-form-error:not(:empty) {
  padding: 8px 10px;
  border-left: 2px solid #fb85a5;
  background: #492537;
}

.demo-empty {
  margin-top: 12px;
  padding: 21px;
  border: 1px dashed #785267;
  border-radius: 9px;
  color: var(--demo-muted);
  text-align: center;
}

.demo-dialog {
  --demo-border: #73465e;
  --demo-control: #26141f;
  --demo-text: #f8e8ee;
  --demo-muted: #cdb4bf;
  width: min(calc(100% - 28px), 570px);
  max-width: none;
  max-height: 90vh;
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--demo-border);
  border-radius: 13px;
  background: #24141f;
  color: var(--demo-text);
  box-shadow: 0 24px 90px #050204e8;
}

.demo-dialog::backdrop {
  background: #0e070cdc;
  backdrop-filter: blur(4px);
}

.demo-dialog-inner {
  padding: clamp(15px, 4vw, 28px);
}

.demo-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.demo-dialog-head :is(h3, h4),
#demo-product-content :is(h3, h4) {
  margin: 0;
  color: var(--demo-text);
  font-size: clamp(21px, 5vw, 27px);
  line-height: 1.18;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.demo-dialog-close {
  flex-shrink: 0;
}

.demo-form,
.demo-form-grid,
#demo-product-content {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.demo-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#demo-old-price[aria-invalid="true"] {
  border-color: #fb85a5;
}

.demo-dialog-actions {
  margin-top: 5px;
}

#demo-delete {
  border-color: #995674;
  background: #472336;
  color: #ffd4e1;
}

#demo-delete:hover {
  border-color: #e089a7;
  background: #6a324c;
}

#demo-product-content p:not(.demo-product-category, .demo-price) {
  color: var(--demo-muted);
  overflow-wrap: anywhere;
}

#demo-product-content .demo-product-image {
  max-height: min(34vh, 300px);
  border: 1px solid #6f4258;
  border-radius: 9px;
}

@media (max-width: 940px) {
  .catalog-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  .admin-toolbar {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .admin-toolbar > .demo-button {
    justify-self: start;
  }

  .demo-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

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

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

  .demo-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 11px;
    padding: 11px;
    border: 1px solid var(--demo-border);
    border-radius: 8px;
    background: #251521;
  }

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

  .demo-table td:first-child,
  .demo-table td:last-child {
    grid-column: 1 / -1;
  }

  .demo-table td:first-child {
    padding-bottom: 7px;
    border-bottom: 1px solid #503044;
  }

  .demo-table td:last-child {
    text-align: left;
  }

  .demo-table td:not(:first-child, :last-child)::before {
    display: block;
    margin-bottom: 2px;
    color: var(--demo-muted);
    font: 400 11px/1.3 var(--body-font);
    content: attr(data-label);
  }

  .demo-row-action {
    min-height: 44px;
  }
}

@media (max-width: 440px) {
  .catalog-toolbar,
  .demo-catalog-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-checkbox {
    padding-inline: 0;
  }
}

.demo-product-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.demo-add-cart {
  border-color: #a35875;
  background: #702b45;
}

.demo-add-cart:hover:enabled {
  border-color: #df839e;
  background: #8a3656;
}

@media (max-width: 700px) and (min-width: 481px) {
  .demo-product-actions {
    grid-template-columns: 1fr;
  }
}
