* { box-sizing: border-box; }
:root { color-scheme: light; font: 16px system-ui, sans-serif; color: #242623; background: #f7f8f4; }
body { margin: 0; }
header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.1rem max(1rem, calc((100% - 72rem) / 2)); background: #163b30; color: white; }
header a { color: inherit; font-size: 1.25rem; font-weight: 700; text-decoration: none; }
main { max-width: 74rem; margin: auto; padding: 2rem 1rem 3rem; }
.heading { max-width: 35rem; }
h1 { margin: 0 0 1.25rem; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.045em; }
label { display: block; font-weight: 600; margin-bottom: .4rem; }
input, button { font: inherit; min-height: 44px; }
input { width: 100%; border: 1px solid #56665c; border-radius: .5rem; padding: .65rem .8rem; }
button { cursor: pointer; color: #163b30; }
:focus-visible { outline: 3px solid #934713; outline-offset: 3px; }
#result-count { color: #41554a; min-height: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.card { display: grid; gap: .75rem; text-align: left; align-content: start; border: 1px solid #d4ded5; border-radius: .85rem; background: white; padding: .85rem; }
.card img, dialog img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: white; }
.name { color: #242623; font-weight: 650; line-height: 1.35; }
.sku { color: #41554a; font-size: .875rem; }
.price { color: #163b30; font-weight: 700; }
#more, #close-detail { padding: .65rem 1rem; border: 1px solid #56665c; border-radius: .5rem; background: white; }
#more { margin-top: 1.25rem; }
dialog { max-width: min(50rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 1rem; border: 1px solid #56665c; border-radius: .85rem; }
dialog::backdrop { background: #152921bf; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; align-items: center; }
@media (max-width: 36rem) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .card { padding: .55rem; overflow-wrap: anywhere; }
}
