:root {
  color: #171717;
  background: #f5f5f3;
  font: 16px/1.5 "Segoe UI", Arial, sans-serif;
  --red: #c71c29;
  --line: #dcdcd8;
}
* { box-sizing: border-box; }
body { margin: 0; padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.shell { width: min(1344px, calc(100% - 64px)); margin-inline: auto; }
.masthead { background: #121212; color: white; border-bottom: 4px solid var(--red); }
.brand { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: 20px; font-size: 1.2rem; font-weight: 850; letter-spacing: .13em; }
.brand span { color: #ff5260; }
main { padding-block: 44px 68px; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 26px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.6rem, 7vw, 5.25rem); font-weight: 850; letter-spacing: -.055em; line-height: .95; }
.search { display: grid; gap: 5px; width: min(100%, 400px); font-weight: 600; font-size: .875rem; }
.search input { width: 100%; min-height: 48px; background: white; border: 1px solid #9b9b97; border-radius: 4px; padding: 8px 13px; font-size: 1rem; }
nav { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 16px; border-block: 1px solid var(--line); }
nav:empty { display: none; }
nav button { color: #171717; background: white; border: 1px solid var(--line); border-radius: 4px; padding: 9px 13px; min-height: 44px; text-align: left; font-size: .875rem; font-weight: 650; }
nav button[aria-pressed="true"] { color: white; background: #171717; border-color: #171717; box-shadow: inset 0 -3px var(--red); }
.status { margin-block: 15px; color: #535353; font-size: .875rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 17px; }
.card { display: flex; flex-direction: column; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.cover { position: relative; display: block; width: 100%; aspect-ratio: 4/3; padding: 0; border: 0; background: #edeeec; overflow: hidden; }
.cover:focus-visible { outline-offset: -4px; }
.cover img, .gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.photo-count { position: absolute; right: 9px; bottom: 9px; color: white; background: #171717; padding: 4px 8px; border-radius: 3px; font-size: .875rem; }
.empty-photo { display: grid; place-items: center; height: 100%; color: #555; }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 9px; padding: 16px; }
.category, .article, .inventory { font-size: .875rem; color: #535353; overflow-wrap: anywhere; }
.category { font-weight: 650; }
.card h2 { font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.card .description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .9rem; color: #414141; }
.card-bottom { display: grid; gap: 6px; margin-top: auto; padding-top: 8px; }
.price { color: #171717; font-size: 1.4rem; font-weight: 800; }
.open { min-height: 44px; margin-top: 5px; padding: 8px 12px; border: 0; border-radius: 4px; color: white; background: var(--red); font-weight: 650; }
.open:hover { background: #a71320; }
.open:disabled { background: #e7e7e7; color: #555; cursor: default; }
.card-bottom .details-button { min-height: 44px; background: white; border: 1px solid var(--line); border-radius: 4px; }
dialog { padding: 0; width: min(960px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 6px; color: inherit; }
dialog::backdrop { background: #000b; }
.detail-top { display: flex; justify-content: end; background: white; padding: 8px 12px; position: sticky; top: 0; z-index: 1; }
.close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 4px; background: white; font-size: 1.6rem; line-height: 1; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; padding: 0 24px 24px; }
.gallery-main { aspect-ratio: 4/3; background: #edeeec; border-radius: 4px; overflow: hidden; }
.gallery-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 7px; margin-block: 9px; }
.gallery-controls button { padding: 6px 10px; min-height: 44px; background: white; border: 1px solid var(--line); border-radius: 4px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 7px; }
.thumbs button { width: 56px; height: 52px; border: 2px solid var(--line); background: #edeeec; border-radius: 4px; padding: 2px; }
.thumbs button[aria-pressed="true"] { border-color: var(--red); }
.thumbs img { width: 100%; height: 100%; display: block; object-fit: contain; }
.detail-copy { display: grid; align-content: start; gap: 10px; min-width: 0; }
.detail-copy h2 { line-height: 1.15; overflow-wrap: anywhere; }
.detail-copy h3 { margin-top: 8px; font-size: 1rem; }
.bottom-nav { position: fixed; z-index: 2; inset: auto 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: #121212; border: 0; border-top: 3px solid var(--red); padding: 4px max(env(safe-area-inset-right), calc((100vw - 720px) / 2)) calc(4px + env(safe-area-inset-bottom)) max(env(safe-area-inset-left), calc((100vw - 720px) / 2)); }
.bottom-nav button { padding: 6px 3px; min-height: 48px; text-align: center; color: white; border: 0; background: transparent; font-size: .875rem; }
.bottom-nav button[aria-current] { color: #ff6974; background: #262626; }
.cart-items { display: grid; gap: 10px; margin-block: 22px; }
.cart-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.cart-line img { display: block; width: 64px; height: 64px; object-fit: contain; background: #edeeec; }
.cart-line h2 { font-size: 1rem; overflow-wrap: anywhere; }
.quantity { display: flex; align-items: center; gap: 8px; }
.quantity button { width: 44px; height: 44px; background: white; border: 1px solid var(--line); border-radius: 4px; }
.quantity button:disabled { opacity: .45; cursor: default; }
.cart-total { font-size: 1.3rem; font-weight: 800; }
.section-note { margin-top: 18px; }
@media (max-width: 430px) {
  .cart-line { grid-template-columns: 56px minmax(0, 1fr); }
  .cart-line img { width: 56px; height: 56px; }
  .quantity { grid-column: 2; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 32px); }
  main { padding-block: 28px 38px; }
  .heading { align-items: stretch; flex-direction: column; gap: 18px; }
  .detail-layout { grid-template-columns: 1fr; padding-inline: 14px; gap: 15px; }
}
@media (min-width: 430px) and (max-width: 620px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 11px; }
}
