:root {
  color-scheme: light;
  --brand: #d34a16;
  --action: #a9340d;
  --ink: #26221f;
  --muted: #6b5a51;
  --border: #e8e0da;
  --surface: #fbf8f5;
  --cream: #fff3e6;
  --title: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: white; color: var(--ink); font: 1rem/1.5 var(--body); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { font-family: var(--title); line-height: 1.12; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 4px; }
.wrap { width: min(1170px, calc(100% - 64px)); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 10px; left: 10px; z-index: 3; padding: 8px 12px; background: white; }

.header { border-top: 3px solid var(--brand); border-bottom: 1px solid var(--border); }
.header-inner { display: grid; grid-template-columns: auto minmax(180px, 500px) auto; align-items: center; justify-content: space-between; min-height: 76px; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--brand); font: 800 1.5rem/1 var(--title); white-space: nowrap; }
.header nav { display: flex; align-items: center; gap: 24px; font-size: .95rem; font-weight: 700; }
.header nav a:hover { color: var(--action); text-decoration: underline; text-underline-offset: 4px; }
.search { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 44px; padding: 0 13px; border: 1px solid #d6cbc3; border-radius: 8px; background: var(--surface); }
.search:focus-within { outline: 2px solid var(--action); outline-offset: 2px; }
.search input { width: 100%; min-width: 0; padding: 9px 0; border: 0; background: transparent; outline: 0; }
.search input::placeholder { color: var(--muted); opacity: 1; }

.intro { padding-block: 34px 25px; border-bottom: 1px solid var(--border); scroll-margin-top: 20px; }
.intro h1 { font-size: clamp(2.2rem, 5vw, 3.45rem); letter-spacing: -.045em; }
.intro p { color: var(--muted); margin-top: 5px; }
.catalog-layout { display: grid; grid-template-columns: 185px minmax(0, 1fr); gap: 34px; margin-block: 24px 68px; }
.catalog-sidebar h2 { font-size: 1.12rem; margin: 4px 0 8px; }
.catalog-sidebar section + section { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 18px; }
.filters, .collection-list { display: grid; gap: 2px; }
.filter {
  min-height: 42px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  padding: 7px 10px; text-align: left; font-size: .93rem; color: var(--muted);
}
.filter:hover { background: var(--surface); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--cream); color: var(--action); font-weight: 700; }

.results-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 9px; }
.results-header h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); letter-spacing: -.025em; }
.catalog-status { font-size: .88rem; color: var(--muted); }
.preview { margin-bottom: 15px; padding: 7px 10px; border-left: 2px solid #d3a185; background: var(--surface); color: var(--muted); font-size: .88rem; }
.empty { padding: 28px 0; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product {
  display: flex; flex-direction: column; gap: 11px; min-width: 0;
  padding: 9px 9px 5px; border: 1px solid var(--border); border-radius: 9px; background: white;
}
.product:focus-within, .product:hover { border-color: #cbbbaf; }
.product-photo { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 1.22; border-radius: 5px; background: var(--surface); }
.product-photo:empty { background: var(--surface) url("/assets/marca.svg") no-repeat center / 42px auto; }
.photo {
  position: absolute; top: 50%; left: 50%; width: 100%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: url("/assets/achadinhos.png") no-repeat; background-size: 300% 200%;
}
.photo-lamp { background-position: 0 0; }
.photo-headphones { background-position: 50% 0; }
.photo-tumbler { background-position: 100% 0; }
.photo-trays { background-position: 0 100%; }
.photo-keyboard { background-position: 50% 100%; }
.photo-tote { background-position: 100% 100%; }
.actual-photo { width: 100%; height: 100%; object-fit: cover; }
.product-copy { flex: 1; padding-inline: 5px; }
.product-category, .muted { color: var(--muted); font-size: .88rem; }
.product h3 { margin-block: 3px 2px; font-size: 1.14rem; font-weight: 700; overflow-wrap: anywhere; }
.product .price { margin-top: 6px; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.price strong { color: var(--action); font: 800 1.65rem/1.15 var(--title); }
.price s { color: var(--muted); font-size: .86rem; }
.discount { position: absolute; top: 9px; left: 9px; padding: 3px 8px; background: var(--cream); color: var(--action); border-radius: 5px; font-size: .85rem; font-weight: 700; }
.button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 44px;
  padding: 8px 13px; border: 1px solid transparent; border-radius: 7px;
  background: var(--action); color: white; font-size: 1rem; font-weight: 700; line-height: 1.2; text-align: center;
}
.button:hover { background: #852807; }
.secondary { background: white; border-color: #d6cbc3; color: var(--action); }
.secondary:hover { background: var(--surface); border-color: var(--action); }
.product .button { margin: 0 5px 5px; }
.card-link {
  align-self: start; min-height: 44px; background: transparent; color: var(--action);
  padding: 8px 5px; border: 0; font-size: .9rem; font-weight: 700; text-align: left;
}
.card-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.more { display: flex; margin: 20px auto 0; }

footer { background: var(--surface); border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: start; justify-content: space-between; gap: 22px; padding-block: 24px; }
.footer-inner p { max-width: 58ch; color: var(--muted); font-size: .9rem; }
dialog { position: fixed; width: min(500px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: white; color: var(--ink); }
dialog::backdrop { background: #26221f88; }
dialog form { position: absolute; z-index: 1; top: 23px; right: 23px; }
.close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: white; font-size: 1.5rem; }
#detail-body { display: grid; gap: 8px; }
#detail-body .product-photo { aspect-ratio: 1.35; }
#detail-body h2 { font-size: 1.8rem; }
.eyebrow { color: var(--muted); font-size: .9rem; font-weight: 700; }
.detail-offer { display: grid; gap: 7px; border-top: 1px solid var(--border); padding-top: 10px; }

@media (max-width: 950px) {
  .wrap { width: calc(100% - 40px); }
  .header-inner { gap: 20px; }
  .catalog-layout { grid-template-columns: 155px minmax(0, 1fr); gap: 20px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .header-inner { grid-template-columns: auto 1fr; gap: 7px 10px; padding-block: 11px; }
  .header nav { justify-self: end; gap: 12px; font-size: .85rem; }
  .header .brand { font-size: 1.18rem; gap: 5px; }
  .header .brand img { width: 34px; height: auto; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .intro { padding-block: 18px 13px; }
  .intro h1 { font-size: 2.25rem; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 15px; margin-block: 12px 34px; }
  .catalog-sidebar h2 { font-size: .94rem; margin: 0 0 5px; }
  .catalog-sidebar section + section { padding-top: 0; margin-top: 9px; border: 0; }
  .filters, .collection-list { display: flex; flex-wrap: wrap; gap: 4px; }
  .filter { min-height: 40px; padding: 4px 8px; border-color: var(--border); font-size: .85rem; }
  .grid { gap: 8px; }
  .product { padding: 6px 6px 2px; }
  .product-copy { padding-inline: 2px; }
  .product h3 { font-size: 1rem; }
  .card-link { padding-inline: 2px; }
  .footer-inner { flex-direction: column; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
