#category-list,
#product-list {
  display: grid;
  gap: clamp(12px, 1.5vw, 22px);
}

#category-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#product-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#category-list button,
#product-list button,
.lx-dialog button,
.lx-filter-status button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

#category-list button:focus-visible,
#product-list button:focus-visible,
.lx-filter-status button:focus-visible,
.lx-dialog :is(button, input):focus-visible {
  outline: 2px solid #ffd383;
  outline-offset: 3px;
}

.lx-category,
.lx-product {
  overflow: hidden;
  text-align: left;
  position: relative;
  isolation: isolate;
  border: 1px solid #33302c;
  border-radius: 12px;
  background: #171718;
}

.lx-category {
  transition: border-color .18s, background .18s;
}

#category-list .lx-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: end;
  align-items: center;
  gap: 8px;
  aspect-ratio: 1.48;
  padding: clamp(14px, 1.6vw, 23px);
  color: #f6f2ed;
}

.lx-category-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.lx-category-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.lx-category::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #090909fa, #0a0a0bd9 17%, #0c0b0b25 62%, transparent 80%);
}

.lx-category-label { display: grid; gap: 3px; }
.lx-category-label strong {
  font-size: clamp(1.12rem, 1.65vw, 1.5rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.lx-category-label small { font-size: .83rem; color: #d0cbc3; }
.lx-category-arrow {
  display: block;
  width: clamp(17px, 1.75vw, 24px);
  height: auto;
  object-fit: contain;
}

.lx-category[aria-pressed="true"] {
  border-color: #b58a48;
  background: #26211b;
}

.lx-filter-status:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 12px 0 18px;
  color: #d2c9bc;
  font-size: .9rem;
}

.lx-filter-status button,
.lx-dialog .lx-text-btn {
  border: 0;
  background: none;
  padding: 8px 1px;
  color: #f6c775;
  text-decoration: underline;
  text-underline-offset: 4px;
}

#product-list .lx-product {
  display: flex;
  flex-direction: column;
  padding: 0;
  color: #f5f1eb;
}

.lx-product-media {
  display: block;
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 8 / 3;
  background: #090908;
  border-bottom: 1px solid #252323;
}

.lx-product-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lx-product-info {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  padding: clamp(14px, 1.35vw, 22px);
}

.lx-dialog .lx-meta {
  color: #c9a56a;
  font-size: .73rem;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.lx-product-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.lx-product-head > strong {
  font-size: clamp(1.08rem, 1.45vw, 1.4rem);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.24;
}

.lx-product-head > b {
  flex: none;
  color: #efc372;
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.lx-buy-frame {
  margin-top: auto;
  padding: 3px;
  border: 1px solid #3c3528;
  border-radius: 10px;
  background: #131210;
}

#product-list .lx-buy-btn {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #fbd79b;
  border-radius: 7px;
  background: #ecc27a;
  color: #211b11;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.01em;
}

#product-list .lx-buy-btn img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  filter: brightness(.18);
}

@media (hover: hover) {
  .lx-category:hover { border-color: #8b7048; background: #1c1b1a; }
  .lx-category:hover .lx-category-art img { transform: scale(1.045); }
  .lx-dialog button:hover { filter: brightness(1.1); }
}

body:has(.lx-dialog[open]) { overflow: hidden; }

.lx-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(490px, calc(100vw - 32px));
  max-height: calc(100dvh - 42px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: auto;
  border: 1px solid #494133;
  border-radius: 16px;
  padding: 0;
  background: #181819;
  color: #f5f1e9;
  box-shadow: 0 24px 100px #0008;
}

.lx-dialog::backdrop { background: #080809cd; }
.lx-dialog-inner { padding: clamp(20px, 4.5vw, 32px); }

.lx-dialog .lx-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.lx-dialog-head h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(1.6rem, 5vw, 2rem);
  letter-spacing: -.045em;
  line-height: 1.15;
}

.lx-dialog .lx-text-btn { font-size: .86rem; }
.lx-dialog-body p { margin: 16px 0; color: #dedad2; line-height: 1.55; }
.lx-dialog .lx-fine { color: #bcb7ad; font-size: .855rem; }
.lx-dialog-product-art {
  overflow: hidden;
  width: 100%;
  border: 1px solid #33302c;
  border-radius: 8px;
}
.lx-dialog-product-art .lx-product-media { border-bottom: 0; }
.lx-dialog .lx-meta { margin-bottom: 0; }

.lx-price-line,
.lx-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.lx-price-line strong, .lx-total strong { font-size: 1.35rem; }
.lx-price-line span { color: #bcb7ad; font-size: .855rem; }

.lx-dialog .lx-action {
  width: 100%;
  min-height: 46px;
  border: 1px solid #e3b665;
  border-radius: 7px;
  background: #efc078;
  color: #191612;
  font-weight: 700;
}

.lx-dialog .lx-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.lx-dialog-actions {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.lx-bag-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.lx-bag-list li,
.lx-search-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #393530;
}

.lx-bag-list li div,
.lx-search-results button > span { display: grid; gap: 4px; }
.lx-bag-list li div:last-child { justify-items: end; }
.lx-bag-list li span, .lx-search-results small { color: #bdb8af; font-size: .82rem; }
.lx-input-label { display: block; margin-bottom: 8px; font-size: .9rem; }

#lx-search-field {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #595144;
  border-radius: 7px;
  background: #111112;
  color: inherit;
  font: inherit;
}

.lx-search-results button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #393530;
  background: transparent;
  text-align: left;
}

@media (max-width: 880px) {
  #category-list, #product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  #product-list { grid-template-columns: 1fr; }
}

@media (max-width: 450px) {
  #category-list, #product-list { gap: 10px; }
  #category-list .lx-category { aspect-ratio: 1.13; padding: 12px; gap: 4px; }
  .lx-category-label strong { font-size: 1.03rem; }
  .lx-category-label small { font-size: .73rem; }
  .lx-category-arrow { width: 15px; }
  .lx-product-info { padding: 12px; }
  .lx-product-head > strong { font-size: 1.05rem; }
  .lx-product-head > b { font-size: 1.02rem; }
  #product-list .lx-buy-btn { min-height: 40px; font-size: 13px; }
}

@media (max-width: 380px) {
  #category-list .lx-category { grid-template-columns: 1fr; }
  .lx-category-arrow { position: absolute; top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #category-list *, #product-list * { transition: none; }
}
