:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f7f5f1;
  color: #1d1b17;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #886634; outline-offset: 4px; }
.container { width: min(100% - 36px, 1100px); margin-inline: auto; }
.page-header {
  padding: 22px 0 18px;
  background: #1d1b17;
  color: #fff;
}
h1 { font-size: clamp(1.375rem, 4vw, 1.625rem); line-height: 1.2; margin: 0; }
.page-header p { margin: 6px 0 0; color: #cdc5b6; font-size: .875rem; }
main { padding-block: 12px 55px; }
.category-navigation { position: relative; }
.categories { display: flex; gap: 8px; overflow: auto; padding: 5px 4px 12px; margin-inline: -4px; }
.category-scroll-hint { display: none; }
.category-tab, #retry {
  flex: none;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #ded7cd;
  border-radius: 30px;
  background: #fff;
  color: #1d1b17;
  font-size: .875rem;
}
.category-tab:hover, #retry:hover { background: #eee6d8; }
.category-tab[aria-pressed="true"] { color: white; background: #1d1b17; border-color: #1d1b17; }
.category { margin-top: 21px; }
h2 { font-weight: 700; font-size: 1.0625rem; margin: 0; }
.category-description { margin: 6px 0 0; color: #625846; white-space: pre-line; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 15px; }
.product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ece5da;
  border-radius: 16px;
  padding: 0;
  text-align: left;
  color: inherit;
}
.product:hover { border-color: #a5906d; }
.product-media { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; background: #eee6d8; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.image-unavailable { font-size: .875rem; padding: 8px; color: #625846; }
.product-name { font-weight: 650; padding: 12px 14px 14px; overflow-wrap: anywhere; }
.preview-open { overflow: hidden; }
#preview {
  background: #1d181c;
  color: white;
  border: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  overflow: auto;
}
#preview[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#preview::backdrop { background: #1d181c; }
.preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
}
.preview-bar span { overflow-wrap: anywhere; }
.preview-bar button {
  color: white;
  background: #423740;
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
}
#preview-image-wrap { display: grid; place-items: center; padding: 6px 12px max(12px, env(safe-area-inset-bottom)); }
#preview-image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
#preview-error { place-self: center; }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .container { width: calc(100% - 28px); }
  .categories { scrollbar-width: none; }
  .categories::-webkit-scrollbar { display: none; }
  .category-tab { white-space: nowrap; }
  .category-scroll-hint {
    position: absolute;
    inset-block: 5px 12px;
    width: 28px;
    place-items: center;
    color: #625846;
    pointer-events: none;
  }
  .category-navigation.has-more-left .category-scroll-hint--left,
  .category-navigation.has-more-right .category-scroll-hint--right { display: grid; }
  .category-scroll-hint::before {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid;
    border-right: 2px solid;
  }
  .category-scroll-hint--left {
    left: -4px;
    background: linear-gradient(to right, #f7f5f1 55%, #f7f5f100);
  }
  .category-scroll-hint--right {
    right: -4px;
    background: linear-gradient(to left, #f7f5f1 55%, #f7f5f100);
  }
  .category-scroll-hint--left::before { transform: rotate(-135deg); }
  .category-scroll-hint--right::before { transform: rotate(45deg); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-name { padding-inline: 9px; }
}
