:root {
  --ink: #153d31;
  --ink-deep: #0e3026;
  --cream: #f5f3ea;
  --paper: #fbfaf5;
  --sage: #dfe8dc;
  --lime: #c8ee58;
  --line: rgba(21, 61, 49, .16);
  --muted: #607269;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", Arial, sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }
.collection-demo { overflow: clip; }
.collection-shell { width: min(100% - 48px, 1400px); margin-inline: auto; }

.collection-hero {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 12%, rgba(200,238,88,.34), transparent 28%),
    linear-gradient(135deg, #173f32 0%, #0f3026 74%);
  color: #f7f6ef;
}
.collection-hero::after {
  content: "";
  position: absolute;
  inset: auto -5% -58% 38%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
}
.collection-hero-inner { position: relative; z-index: 1; width: min(100% - 48px, 1400px); padding: 60px 0 56px; }
.collection-breadcrumb { margin: 0 0 28px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
.collection-hero h1 { max-width: 820px; margin: 0; font-size: clamp(42px, 5.6vw, 82px); font-weight: 400; line-height: .96; letter-spacing: -.055em; }
.collection-hero-copy { max-width: 560px; margin: 24px 0 0; color: rgba(247,246,239,.78); font-size: 17px; line-height: 1.55; }

.discovery-section { padding: 72px 0 80px; background: var(--cream); }
.discovery-heading { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 48px; align-items: end; }
.discovery-heading h2 { margin: 0; max-width: 690px; font-size: clamp(38px, 4.4vw, 64px); font-weight: 400; line-height: .98; letter-spacing: -.05em; }
.discovery-heading p { margin: 0; max-width: 500px; justify-self: end; color: var(--muted); font-size: 16px; line-height: 1.55; }

.discovery-tabs { display: inline-flex; gap: 5px; margin: 38px 0 24px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.46); }
.discovery-tab { min-width: 156px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-weight: 600; transition: background .25s ease, color .25s ease, transform .25s ease; }
.discovery-tab:hover { transform: translateY(-1px); }
.discovery-tab[aria-selected="true"] { color: #fff; background: var(--ink); }

.category-panel[hidden] { display: none; }
.category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.category-card {
  position: relative;
  min-height: 330px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #d9dfd2;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
}
.category-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 34%, rgba(6,25,19,.82) 100%); }
.category-card img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.2,.75,.2,1); }
.category-card:hover img, .category-card:focus-visible img { transform: scale(1.035); }
.category-card:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.category-card-copy { position: absolute; inset: auto 18px 18px; color: #fff; }
.category-card-copy small { display: block; margin-bottom: 7px; color: rgba(255,255,255,.65); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.category-card-copy strong { display: block; font-size: clamp(18px, 1.45vw, 24px); line-height: 1.08; letter-spacing: -.025em; }
.category-card-copy span { display: block; max-height: 0; overflow: hidden; opacity: 0; margin-top: 0; font-size: 12px; line-height: 1.4; transition: max-height .3s ease, opacity .3s ease, margin .3s ease; }
.category-card:hover .category-card-copy span, .category-card:focus-visible .category-card-copy span { max-height: 50px; margin-top: 8px; opacity: .76; }
.category-card.is-selected { box-shadow: inset 0 0 0 3px var(--lime); }
.category-card.is-selected .category-card-copy small::after { content: "  ·  Selected"; color: var(--lime); }

.products-section { padding: 66px 0 100px; background: var(--paper); }
.products-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 24px; }
.products-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 54px); font-weight: 400; letter-spacing: -.045em; }
.products-heading p { margin: 10px 0 0; color: var(--muted); }
.result-count { flex: none; color: var(--muted); font-size: 13px; }

.filter-toolbar { position: relative; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 15px 0; border-block: 1px solid var(--line); }
.filter-menu { position: relative; }
.filter-menu summary, .clear-filters, .sort-select {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  list-style: none;
}
.filter-menu summary::-webkit-details-marker { display: none; }
.filter-menu summary::after { content: "+"; font-size: 18px; font-weight: 400; line-height: 1; }
.filter-menu[open] summary { color: #fff; background: var(--ink); }
.filter-menu[open] summary::after { content: "−"; }
.filter-popover { position: absolute; top: calc(100% + 9px); left: 0; min-width: 250px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 18px 50px rgba(15,48,38,.14); }
.filter-popover label { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; cursor: pointer; }
.filter-popover label:hover { background: var(--cream); }
.filter-popover input { accent-color: var(--ink); }
.clear-filters { border: 0; background: transparent; color: var(--muted); }
.clear-filters[hidden] { display: none; }
.sort-wrap { margin-left: auto; }
.sort-select { appearance: none; padding-right: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3.5 5 3.5 3.5L10.5 5' fill='none' stroke='%23153d31' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
.active-filters { display: flex; flex-wrap: wrap; gap: 7px; min-height: 0; }
.active-filters:not(:empty) { padding-top: 15px; }
.active-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--sage); cursor: pointer; }
.active-chip span { font-size: 16px; line-height: 1; }

.demo-product-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 28px; }
.demo-product-card { min-width: 0; }
.demo-product-card[hidden] { display: none; }
.demo-product-media { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.08; overflow: hidden; border-radius: 20px; background: #e8eadf; }
.demo-product-media img { width: 82%; height: 82%; object-fit: contain; transition: transform .35s ease; }
.demo-product-card:hover .demo-product-media img { transform: translateY(-4px) scale(1.02); }
.demo-product-badge { position: absolute; top: 14px; left: 14px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.demo-product-copy { padding: 16px 3px 4px; }
.demo-stars { color: #527a31; font-size: 12px; letter-spacing: .08em; }
.demo-product-copy h3 { margin: 8px 0 5px; font-size: 18px; font-weight: 500; line-height: 1.2; }
.demo-product-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.demo-product-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.demo-price { font-size: 15px; font-weight: 600; }
.demo-add { min-height: 38px; padding: 8px 15px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; cursor: pointer; transition: color .2s ease, background .2s ease; }
.demo-add:hover { color: #fff; background: var(--ink); }
.empty-state { margin-top: 28px; padding: 70px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--cream); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state h3 { margin: 0 0 8px; font-size: 28px; font-weight: 400; }
.empty-state p { margin: 0; color: var(--muted); }

.collection-demo-footer { padding: 56px 0; background: var(--ink-deep); color: #f5f3ea; }
.collection-demo-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.collection-demo-footer img { width: 176px; height: auto; filter: brightness(0) invert(1); }
.collection-demo-footer p { max-width: 540px; margin: 0; color: rgba(245,243,234,.66); font-size: 13px; line-height: 1.5; text-align: right; }

@media (max-width: 990px) {
  .category-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .category-card { min-height: 300px; }
  .demo-product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 749px) {
  .collection-shell, .collection-hero-inner { width: min(100% - 28px, 1400px); }
  .collection-hero { min-height: 270px; }
  .collection-hero-inner { padding: 46px 0 42px; }
  .collection-breadcrumb { margin-bottom: 22px; }
  .collection-hero h1 { font-size: clamp(40px, 12vw, 58px); }
  .collection-hero-copy { margin-top: 18px; font-size: 15px; }
  .discovery-section { padding: 52px 0 58px; }
  .discovery-heading { display: block; }
  .discovery-heading h2 { font-size: 40px; }
  .discovery-heading p { margin-top: 16px; font-size: 15px; }
  .discovery-tabs { width: 100%; margin: 28px 0 18px; }
  .discovery-tab { flex: 1; min-width: 0; min-height: 42px; padding-inline: 10px; font-size: 13px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .category-card { min-height: 224px; border-radius: 15px; }
  .category-card:last-child { grid-column: 1 / -1; min-height: 176px; }
  .category-card-copy { inset: auto 14px 14px; }
  .category-card-copy strong { font-size: 17px; }
  .category-card-copy span { display: none; }
  .products-section { padding: 48px 0 72px; }
  .products-heading { align-items: start; }
  .products-heading h2 { font-size: 38px; }
  .products-heading p { font-size: 14px; }
  .result-count { padding-top: 10px; }
  .filter-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; }
  .filter-toolbar::-webkit-scrollbar { display: none; }
  .filter-menu { flex: none; }
  .filter-popover { position: fixed; z-index: 90; inset: auto 14px 18px; max-height: 62vh; overflow: auto; border-radius: 20px; box-shadow: 0 24px 80px rgba(15,48,38,.25); }
  .sort-wrap { flex: none; margin-left: 0; }
  .clear-filters { flex: none; }
  .demo-product-grid { gap: 10px; margin-top: 22px; }
  .demo-product-media { border-radius: 15px; }
  .demo-product-media img { width: 88%; height: 88%; }
  .demo-product-copy h3 { font-size: 15px; }
  .demo-product-copy p { min-height: 35px; font-size: 12px; }
  .demo-add { min-height: 34px; padding: 6px 11px; font-size: 12px; }
  .collection-demo-footer-inner { display: block; }
  .collection-demo-footer p { margin-top: 22px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
