:root {
  color-scheme: light;
  --green: #123f2c;
  --green-dark: #0c3627;
  --grass: #1a5539;
  --yellow: #ffdb4c;
  --red: #b83326;
  --cream: #faf9f4;
  --line: #dfdfd2;
  --ink: #172b22;
  --muted: #516158;
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top-inner { position: relative; display: flex; justify-content: flex-end; align-items: center; min-height: 80px; }
.brand { position: absolute; inset: 0; margin: auto; width: 112px; height: 74px; display: block; overflow: hidden; }
.brand img { position: absolute; top: 50%; left: 50%; width: 105px; max-width: none; transform: translate(-50%, -52%) scale(1.7); }
.cart-toggle { display: flex; align-items: center; gap: 9px; color: var(--green); background: #fff; border: 1px solid #c6d3c7; border-radius: 10px; padding: 7px 8px 7px 12px; font-weight: 700; }
.cart-toggle:hover { background: #f0f6ef; }
.count { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: var(--yellow); padding: 0 5px; font-variant-numeric: tabular-nums; }

.catalog { margin: 30px 0 58px; }
.catalog h1 { margin: 0 0 16px; color: var(--green-dark); font: 800 clamp(2rem, 5vw, 3.15rem)/1.05 Arial, sans-serif; letter-spacing: -.055em; }
.catalog-tools { display: grid; grid-template-columns: minmax(0, 330px) auto; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.search-control, .size-control { position: relative; display: block; }
.search-control::before, .search-control::after { content: ""; position: absolute; pointer-events: none; }
.search-control::before { top: 14px; left: 13px; width: 11px; height: 11px; border: 2px solid var(--green); border-radius: 50%; }
.search-control::after { top: 26px; left: 25px; width: 7px; height: 2px; background: var(--green); transform: rotate(45deg); transform-origin: left center; }
input[type="search"], select { border: 1px solid #bdc6b8; border-radius: 9px; min-height: 44px; color: var(--ink); background: #fff; font: inherit; width: 100%; }
input[type="search"] { padding: 7px 10px 7px 37px; }
input[type="search"]::placeholder { color: var(--muted); opacity: 1; }
select { appearance: none; padding: 7px 34px 7px 12px; cursor: pointer; }
.size-control::after { content: ""; pointer-events: none; position: absolute; bottom: 19px; right: 13px; width: 7px; height: 7px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(45deg); }
select:disabled { opacity: .7; cursor: default; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button, .gallery-choices button { background: #fff; border: 1px solid var(--line); color: var(--green-dark); padding: 8px 17px; min-height: 43px; border-radius: 999px; font-weight: 700; }
.tabs button:hover, .gallery-choices button:hover { border-color: var(--green); }
.gallery-choices button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.tabs button[aria-pressed="true"] { background: var(--yellow); color: var(--green-dark); border-color: #d6b534; }
.price-notice { margin: 11px 0 14px; padding-left: 9px; border-left: 3px solid var(--red); color: var(--muted); font-size: .875rem; }
.results { color: var(--muted); margin: 0 0 10px; font-size: .875rem; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.product { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.product-photo { position: relative; display: block; width: 100%; border: 0; padding: 0; background: #242524; }
.product-photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.product-photo span { position: absolute; bottom: 10px; right: 10px; color: white; background: #102017eb; border: 1px solid #ffffff65; font-weight: 700; font-size: .875rem; border-radius: 999px; padding: 5px 10px; }
.product-photo:hover span { background: var(--green); }
.product-photo:focus-visible { outline-offset: -4px; }
.product-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-heading { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.product h3 { margin: 0; line-height: 1.23; font-size: clamp(1rem, 2vw, 1.2rem); letter-spacing: -.02em; }
.size-tag { white-space: nowrap; border-radius: 6px; font-size: .875rem; font-weight: 700; padding: 2px 8px; background: #eaf2e7; color: var(--green-dark); }
.product-ref { color: var(--muted); font-size: .875rem; margin: 6px 0 12px; flex: 1; }
.price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 12px; }
.price-row strong { color: var(--green-dark); font-size: 1.35rem; letter-spacing: -.04em; }
.price-row span { color: #843228; font-size: .875rem; font-weight: 700; }
.add { color: white; background: var(--green); padding: 9px 10px; min-height: 44px; border: 1px solid var(--green); border-radius: 9px; width: 100%; font-weight: 700; }
.add:hover { background: var(--grass); }
.empty { grid-column: 1 / -1; border: 1px dashed #afbbad; padding: 24px; border-radius: 12px; display: grid; gap: 5px; }
.empty p { margin: 0; }
.clear-filters { width: fit-content; margin-top: 9px; }

footer { background: var(--green-dark); color: white; padding: 19px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; }
.footer-inner a { color: var(--yellow); text-underline-offset: 3px; }
.toast { position: fixed; z-index: 4; bottom: 15px; right: 20px; max-width: min(360px, calc(100% - 40px)); color: white; background: var(--green-dark); border-radius: 12px; padding: 10px 15px; box-shadow: 0 5px 15px #0f291e33; }
.toast:empty { display: none; }

dialog { width: min(600px, calc(100% - 26px)); max-height: 90vh; max-height: 90dvh; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 0; overflow: auto; background: var(--cream); box-shadow: 0 15px 50px #0003; }
dialog::backdrop { background: #0b1b13bb; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; }
.dialog-head h2 { margin: 0; font-size: 1.3rem; line-height: 1.2; }
.close { color: var(--green-dark); background: #fff; border: 1px solid var(--line); border-radius: 50%; width: 44px; height: 44px; font-size: 1.6rem; padding: 0; flex: none; }
.gallery-image { width: 100%; height: min(62vh, 610px); height: min(62dvh, 610px); background: #262525; object-fit: contain; }
.gallery-choices { display: flex; justify-content: center; gap: 8px; padding: 12px; }
.gallery-choices:empty { display: none; }
.cart-body { padding: 0 15px 12px; }
.cart-row { display: flex; align-items: start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.cart-row img { border-radius: 8px; object-fit: cover; }
.cart-item { min-width: 0; }
.cart-item span { display: block; color: var(--muted); font-size: .875rem; }
.qty { margin-top: 6px; display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.qty button { width: 44px; height: 44px; padding: 0; font-size: 1.2rem; border: 0; border-radius: 8px; color: var(--green); background: transparent; }
.qty button:hover { background: #e9f3e8; }
.qty output { min-width: 30px; text-align: center; color: var(--green-dark); font-weight: 700; }
.cart-bottom { position: sticky; bottom: 0; background: var(--cream); padding: 10px 15px 15px; border-top: 1px solid var(--line); }
.cart-bottom p { margin: 0 0 9px; font-size: .875rem; color: var(--muted); }
.primary { background: var(--green); color: white; width: 100%; }
.primary:hover { background: var(--grass); }

@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 24px); }
  .top-inner { min-height: 66px; }
  .brand { width: 96px; height: 64px; }
  .brand img { width: 91px; }
  .catalog { margin-top: 20px; }
  .catalog h1 { margin-bottom: 12px; }
  .tabs { gap: 5px; }
  .tabs button { padding: 6px 10px; font-size: .875rem; }
  .catalog-tools { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-top: 10px; }
  input[type="search"] { text-overflow: ellipsis; }
  .size-control select { max-width: 137px; font-size: .875rem; text-overflow: ellipsis; padding-left: 8px; padding-right: 24px; }
  .size-control::after { right: 9px; }
  .product-body { padding: 10px 9px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-photo span { right: 5px; bottom: 5px; font-size: .8125rem; padding: 3px 6px; }
  .product-heading { flex-wrap: wrap; gap: 4px; }
  .add { font-size: .875rem; padding: 7px 4px; }
  .clear-filters { padding-inline: 12px; }
  .price-row strong { font-size: 1.15rem; }
}
@media (max-width: 370px) {
  .catalog-tools { grid-template-columns: minmax(0, 1fr); }
  .size-control select { max-width: none; }
}
