:root {
  --blue: #284884;
  --ink: #182d50;
  --yellow: #ffcc35;
  --muted: #536276;
  --line: #e0e4ea;
  --wash: #f5f6f8;
  --gutter: max(5vw, calc((100% - 1280px) / 2));
  font: 100%/1.5 "DM Sans", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body, h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.14; text-wrap: balance; }
h2 { font-size: clamp(1.65rem, 3vw, 2.5rem); letter-spacing: -.045em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
:focus-visible { outline: 3px solid #3676c9; outline-offset: 3px; }
[hidden] { display: none !important; }
.store-header {
  position: sticky; inset-block-start: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem var(--gutter); background: white; border-bottom: 1px solid var(--line);
}
.logo { display: block; width: clamp(125px, 14vw, 176px); }
nav { display: flex; gap: clamp(1rem, 3vw, 2.5rem); }
nav a, footer a { font-size: .94rem; font-weight: 600; }
nav a:hover, footer a:hover { text-decoration: underline; text-underline-offset: .35em; }
.cart-button, .button, .add {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  min-height: 44px; padding: .65rem 1rem; border-radius: .65rem;
  font-weight: 650; font-size: .94rem; background: var(--blue); color: white;
}
.button:hover, .add:hover, .cart-button:hover { background: var(--ink); }
.cart-button span { background: var(--yellow); color: var(--ink); border-radius: 2rem; padding: .1em .55em; font-size: .85rem; }
svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; flex: none; }

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: stretch; margin: 1rem var(--gutter) 0;
  background: var(--ink); color: white; border-radius: .85rem; overflow: hidden;
}
.hero h1 {
  align-self: center; padding: .75rem clamp(.8rem, 2.5vw, 2rem);
  font-size: clamp(1.25rem, 2.5vw, 2.25rem); letter-spacing: -.04em;
}
.hero h1 em { color: var(--yellow); font-style: normal; }
.hero img {
  display: block; width: 100%; height: clamp(96px, 13vw, 160px);
  object-fit: cover; object-position: center 55%;
}
.category, .eyebrow {
  font-size: .78rem; text-transform: uppercase; font-weight: 700; letter-spacing: .095em;
}

.catalog { padding: clamp(2rem, 4vw, 4rem) var(--gutter); }
.section-head, .results-line, .total, .cart-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.search, select, textarea, .quantity input { border: 1px solid var(--line); border-radius: .55rem; background: white; }
.search { display: flex; align-items: center; gap: .6rem; width: min(320px, 100%); padding: 0 .9rem; color: var(--muted); }
.search input { border: 0; background: transparent; min-width: 0; width: 100%; min-height: 44px; }
.categories { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.4rem 0 0; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.categories button { background: var(--wash); border-radius: 3rem; padding: .58rem .95rem; font-size: .9rem; }
.categories button:hover { background: #e3e9f1; }
.categories button[aria-pressed=true] { background: var(--blue); color: white; }
.results-line { margin: .8rem 0 1rem; font-size: .875rem; color: var(--muted); }
select { max-width: 100%; padding: .5rem; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.product-card { display: flex; flex-direction: column; min-width: 0; padding: .8rem; border: 1px solid var(--line); border-radius: 1rem; background: white; }
.product-image { display: block; position: relative; padding: 0; aspect-ratio: 1.2; border-radius: .65rem; overflow: hidden; background: var(--wash); }
.product-image img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform .2s; }
.product-image:hover img { transform: scale(1.04); }
.product-tag { position: absolute; bottom: .5rem; left: .5rem; background: white; font-size: .75rem; padding: .25rem .5rem; border-radius: .3rem; }
.category { color: var(--blue); margin: 1rem 0 .4rem; }
.product-card h3 { font-size: 1.12rem; letter-spacing: -.025em; }
.price { font-size: 1.3rem; font-weight: 750; margin: .8rem 0 .15rem; }
.price small, .minimum, .small, .detail-code, .catalog-note { color: var(--muted); font-size: .83rem; font-weight: 400; }
.minimum { margin-bottom: 1rem; }
.color-picker { display: flex; align-items: center; gap: .6rem; font-size: .9rem; margin-bottom: .7rem; }
.color-picker select { flex: 1; min-width: 0; }
.add { width: 100%; margin-top: auto; justify-content: space-between; }
.load-more { text-align: center; margin-top: 2rem; }
.catalog-note { margin-top: 1.5rem; }
.how, .about, footer { padding: 3rem var(--gutter); }
.how { background: var(--wash); }
.how ol, .conditions { display: grid; gap: 2rem; }
.how ol { grid-template-columns: repeat(3, 1fr); list-style: none; padding: 0; margin: 1.5rem 0 0; }
.how li > span { display: inline-block; border-bottom: 3px solid var(--yellow); font-weight: bold; }
.how h3 { margin: .8rem 0 .4rem; }
.how p, .about p, footer p { color: var(--muted); }
.about h2 { margin: .7rem 0 1rem; }
.about > p { max-width: 70ch; }
.conditions { grid-template-columns: repeat(2, 1fr); margin-top: 1.5rem; max-width: 800px; }
.conditions strong { display: block; color: var(--ink); }
footer { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; background: var(--wash); font-size: .88rem; }
footer img { width: 155px; mix-blend-mode: multiply; }
.copyright { width: 100%; padding-top: 1rem; border-top: 1px solid var(--line); }

dialog { border: 0; color: var(--ink); padding: clamp(1rem, 3vw, 2rem); }
dialog::backdrop { background: #101e35a6; }
body:has(dialog[open]) { overflow: hidden; }
#cart { margin: 0 0 0 auto; width: min(490px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; }
.cart-header { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.icon-button { background: var(--wash); border-radius: 50%; width: 44px; height: 44px; }
.cart-item { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 80px; height: 90px; object-fit: contain; border-radius: .5rem; background: var(--wash); }
.cart-item p, .cart-item label, .quantity { margin: .4rem 0; font-size: .9rem; }
.quantity { display: flex; justify-content: space-between; gap: .5rem; }
.quantity input { width: 6rem; padding: .4rem; }
.remove { background: transparent; text-decoration: underline; color: #88303a; }
#cart-checkout > label { display: block; font-weight: 600; margin: 1.25rem 0 .5rem; }
textarea { width: 100%; min-height: 5rem; resize: vertical; padding: .7rem; }
.total { margin: 1rem 0 .5rem; font-weight: 650; }
#checkout { width: 100%; margin-top: 1rem; }
.empty { grid-column: 1 / -1; text-align: center; padding: 2rem .5rem; color: var(--muted); }
.empty button { margin-top: 1rem; }
.product-dialog { width: min(850px, 95vw); max-height: 90dvh; border-radius: 1rem; }
#detail-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.detail-image { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--wash); border-radius: .65rem; }
.thumbnails { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumbnails button { width: 54px; height: 54px; background: white; padding: 2px; border: 2px solid var(--line); border-radius: .45rem; }
.thumbnails button[aria-pressed=true] { border-color: var(--blue); }
.thumbnails img { width: 100%; height: 100%; object-fit: contain; }
.detail-info h2 { margin: .6rem 0; }
.detail-info .description { margin-top: 1rem; }
#toast { position: fixed; z-index: 10; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; padding: .7rem 1rem; border-radius: .65rem; opacity: 0; pointer-events: none; }
#toast.visible { opacity: 1; }
@media (max-width: 950px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 7rem; }
  .store-header { flex-wrap: wrap; row-gap: .4rem; padding-block: .55rem; }
  nav { order: 1; width: 100%; justify-content: space-between; }
  .section-head { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .categories { flex-wrap: nowrap; overflow-x: auto; margin-top: 1rem; }
  .categories button { flex: none; min-height: 44px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .product-card { padding: .55rem; }
  .product-card h3 { font-size: 1rem; }
  .product-card .add { font-size: .875rem; padding-inline: .4rem; gap: .15rem; }
  .product-card .color-picker { display: grid; gap: .2rem; }
  .results-line { gap: .4rem; flex-wrap: wrap; }
  .how ol, .conditions, #detail-content { grid-template-columns: 1fr; gap: 1rem; }
  .detail-image { max-height: 38dvh; }
  .how, .about, footer { padding-block: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
