/* Public storefront layout. Brand colors and typography come from themes.css. */
:root {
  --radius: 14px;
  --radius-large: 24px;
  --page-gutter: 24px;
  --catalog-card-min: 200px;
  --catalog-card-gap: 14px;
  --catalog-list-thumb: 84px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button { color: inherit; cursor: pointer; background: none; border: 0; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-heading); }
button, input, select, a { outline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.page-width, .header-inner {
  width: calc(100% - var(--page-gutter) * 2);
  margin-inline: auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--on-brand, white);
}
.skip-link:focus { top: 12px; }
.mobile-only { display: none; }

/* Language-specific system fonts keep CJK text legible without extra downloads. */
html:lang(zh-CN) { --font-body: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; --font-heading: var(--font-body); }
html:lang(ko) { --font-body: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; --font-heading: var(--font-body); }
html:is(:lang(zh-CN), :lang(ko)) :is(.wordmark-caption, .eyebrow, .product-brand, .product-name) { letter-spacing: normal; }
html:lang(ko) :is(.product-name, .detail-copy h2) { word-break: keep-all; overflow-wrap: anywhere; }

/* Company identity and catalog selection. */
.site-header {
  min-height: 94px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 700;
}
.company-wordmark { max-width: 45%; }
.company-wordmark-text {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.6px;
  overflow-wrap: anywhere;
}
.wordmark-caption {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font: 500 10px/1.2 var(--font-body);
  letter-spacing: 2.1px;
}
.brand-mark {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 27px;
  line-height: 1;
}
.company-logo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  max-width: 150px;
  min-width: 46px;
  min-height: 46px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--ink) 12%, var(--paper));
}
.company-logo {
  display: block;
  width: auto;
  max-width: 134px;
  max-height: 46px;
  object-fit: contain;
}
.header-divider { height: 30px; width: 1px; background: var(--line); }
.header-label {
  max-width: 240px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.catalog-switcher {
  min-width: 200px;
  max-width: 370px;
  margin-left: auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.catalog-switcher label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.catalog-switcher select {
  width: 100%;
  padding: 0 22px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-overflow: ellipsis;
}

/* Keep the catalog and language selectors together on narrow screens. */
.header-selectors { display: flex; align-items: stretch; flex: 0 1 540px; gap: 10px; min-width: 0; margin-left: auto; }
.header-selectors .catalog-switcher { flex: 1 1 auto; min-width: 0; max-width: none; margin-left: 0; }
.language-switcher { flex: 0 0 122px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.language-switcher label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .5px; }
.language-switcher select { width: 100%; padding: 0 15px 0 0; border: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.header-selectors label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* A quiet summary keeps products close to the top of the page. */
.catalog-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-block: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.catalog-summary-copy { min-width: 0; }
.catalog-summary h1 { margin: 0; color: var(--ink); font-size: 23px; font-weight: 600; line-height: 1.3; letter-spacing: -.6px; overflow-wrap: anywhere; }
.catalog-summary-copy p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.catalog-summary-meta { display: flex; flex-shrink: 0; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.catalog-total { white-space: nowrap; }
.catalog-total strong { color: var(--ink); font-weight: 600; }
.catalog-summary.has-background { position: relative; isolation: isolate; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f4f8f7; }
.catalog-summary-background { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center var(--background-position, 50%); pointer-events: none; }
.catalog-summary.has-background::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #fff; opacity: var(--background-transparency, .8); pointer-events: none; }
.catalog-summary.has-background h1, .catalog-summary.has-background .catalog-total strong { color: #123b3c; }
.catalog-summary.has-background .catalog-summary-copy p, .catalog-summary.has-background .catalog-summary-meta { color: #345354; }
.catalog-summary.has-background .demo-badge { color: #345354; background: rgb(255 255 255 / 85%); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.demo-badge {
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  color: var(--ink);
  font-size: 11px;
}

/* Sidebar and configurable facet controls. */
.catalog-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: 26px; }
.catalog-content { min-width: 0; }
.no-filters.catalog-layout { grid-template-columns: minmax(0, 1fr); }
.no-filters .filters-panel { display: none; }
.filters-panel {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  padding: 18px 15px;
  overflow: auto;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.filter-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.filter-heading h2 { font-size: 16px; font-weight: 600; letter-spacing: -.3px; }
.category-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.category-section-label { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.category-collapse { flex-shrink: 0; padding: 4px 0 4px 6px; color: var(--muted); font-size: 10px; }
.category-collapse:hover { color: var(--brand); }
.category-search { display: flex; align-items: center; gap: 7px; min-height: 39px; margin-bottom: 12px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas); }
.category-search > svg { width: 15px; height: 15px; color: var(--muted); }
.category-search input { width: 100%; min-width: 0; height: 37px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
.category-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.category-search button { display: grid; place-items: center; width: 26px; height: 32px; margin-right: -5px; padding: 0; }
.category-search button svg { width: 15px; height: 15px; }
.category-menu { max-height: min(390px, 43vh); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-right: 3px; }
.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  transition: background .15s;
}
.category-button > span:first-child { display: flex; align-items: center; gap: 9px; min-width: 0; overflow-wrap: anywhere; }
.category-button svg { width: 16px; height: 16px; }
.category-button:hover { background: var(--canvas); }
.category-button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.all-products { margin-bottom: 7px; }
.category-count { flex-shrink: 0; padding-left: 3px; color: var(--muted); font-size: 10px; font-weight: 400; font-variant-numeric: tabular-nums; }
.category-button.active .category-count { color: var(--brand); }
.category-group { margin-block: 2px; }
.category-main { display: flex; align-items: center; border-radius: 7px; }
.category-group.selected > .category-main { background: var(--brand-soft); }
.category-main .category-button { min-width: 0; padding-right: 5px; }
.category-expand { display: grid; place-items: center; width: 28px; height: 38px; flex: 0 0 28px; border-radius: 6px; }
.category-expand:hover { background: var(--brand-soft); }
.category-expand svg { width: 13px; height: 13px; transition: transform .15s; }
.category-expand[aria-expanded=true] svg { transform: rotate(90deg); }
.subcategory-list { margin: 2px 0 7px 11px; padding: 1px 0 1px 8px; border-left: 1px solid var(--line); }
.subcategory-list .category-button { min-height: 34px; padding: 7px; font-size: 11px; }
.filter-section { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.filter-section summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; }
.filter-section summary::-webkit-details-marker { display: none; }
.filter-section summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.filter-section summary > span { display: flex; align-items: center; gap: 7px; }
.filter-section summary svg { width: 13px; height: 13px; transition: transform .15s; }
.filter-section[open] summary svg { transform: rotate(90deg); }
.facet-selected-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 10px; }
.check-options { display: flex; flex-direction: column; gap: 2px; max-height: 220px; margin-top: 9px; overflow: auto; scrollbar-width: thin; }
.check-option { display: flex; align-items: center; gap: 9px; min-height: 36px; font-size: 13px; cursor: pointer; }
.check-option input { width: 16px; height: 16px; flex-shrink: 0; margin: 0; accent-color: var(--brand); }
.check-option .option-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.check-option .category-count { margin-left: auto; }
.clear-filters { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 46px; margin-top: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--brand); font-size: 12px; text-align: left; }
.clear-filters span { font-size: 18px; }
.filter-loading { padding: 10px; color: var(--muted); font-size: 12px; }
.filter-backdrop { display: none; }

/* Search, active filters, and view preferences. */
.search-form { display: flex; align-items: center; gap: 13px; height: 56px; padding: 6px 6px 6px 19px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.search-form > svg { color: var(--muted); }
.search-form input { height: 100%; min-width: 0; flex: 1; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 14px; }
.search-form input::placeholder { color: var(--muted); opacity: .85; }
.search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-form button { display: flex; align-items: center; gap: 18px; height: 42px; padding: 0 19px; border-radius: 7px; background: var(--brand); color: var(--on-brand, white); font-size: 13px; font-weight: 500; }
.search-form button:hover { background: var(--brand-hover); }
/* AI requests require an explicit search or cuisine preset selection. */
.search-mode-switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; width: fit-content; max-width: 100%; margin-bottom: 8px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.search-mode-switcher button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 5px 12px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.search-mode-switcher button.selected { background: var(--brand-soft); color: var(--brand); }
.cuisine-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.cuisine-presets button { min-height: 30px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); color: var(--ink); font-size: 11px; }
.cuisine-presets button:hover, .cuisine-presets button.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.cuisine-presets button:disabled { opacity: .6; cursor: progress; }
.cuisine-presets > span { color: var(--muted); font-size: 10px; }
.ai-label { padding: 1px 5px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: 4px; color: var(--brand); font-size: 9px; font-weight: 700; }
.dish-search-help { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 14px; margin: 7px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.dish-search-status { margin: 9px 0 0; color: var(--brand); font-size: 12px; }
.dish-search-status.error { padding: 9px 12px; border: 1px solid #edc5bb; border-radius: 7px; background: #fff5f1; color: #8e3a24; }
.search-form[aria-busy="true"] { border-color: var(--brand); }
.search-form[aria-busy="true"] button { cursor: progress; }
.dish-results { margin-top: 13px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: 10px; background: var(--paper); }
.dish-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dish-results-heading > div { min-width: 0; }
.dish-results-heading h3 { margin-top: 3px; color: var(--ink); font-size: 18px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.dish-clear { flex-shrink: 0; white-space: nowrap; min-height: 32px; padding: 5px 8px; border-radius: 6px; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.dish-clear:hover { background: var(--brand-soft); color: var(--brand); }
.dish-match-summary { margin-top: 7px; color: var(--muted); font-size: 12px; }
.ingredient-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.ingredient-chip { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; min-height: 33px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 12px; text-align: left; }
.ingredient-chip > span:first-child { overflow-wrap: anywhere; }
.ingredient-chip.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.ingredient-chip:not(.selected):hover { border-color: var(--brand); }
.ingredient-count { flex-shrink: 0; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.ingredient-chip.selected .ingredient-count { color: var(--brand); }
.ingredient-chip.no-matches { border-style: dashed; }
.dish-count-note { margin-top: 9px; color: var(--muted); font-size: 10px; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 16px; }
.results-heading { min-width: 0; overflow-wrap: anywhere; }
.search-form[hidden] + .results-toolbar { margin-top: 0; }
.eyebrow.small { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 1.2px; }
.results-heading h2 { font-size: 25px; font-weight: 700; line-height: 1.3; letter-spacing: -.6px; }
.results-heading h2 span { display: inline-block; margin-left: 4px; color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; vertical-align: middle; }
.toolbar-controls { display: flex; flex-shrink: 0; align-items: center; gap: 13px; }
.sort-control { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sort-control label { color: var(--muted); white-space: nowrap; }
.sort-control select { max-width: 160px; min-height: 40px; padding: 4px 18px 4px 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 500; cursor: pointer; }
.view-controls { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.icon-button { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 5px; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.selected { background: var(--brand-soft); color: var(--brand); }
.icon-button:hover { background: var(--canvas); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.active-filters:not(:empty) { margin: 0 0 19px; }
.filter-chip { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--line)); border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 12px; }
.filter-chip svg { width: 11px; height: 11px; }
.filter-chip:hover { border-color: var(--brand); }

/* Cards use as many columns as the available catalog width can accommodate. */
.product-grid { --catalog-row-height: 270px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--catalog-card-min)), 1fr)); gap: var(--catalog-card-gap); }
.product-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); transition: transform .2s, box-shadow .2s, border-color .2s; }
.product-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); box-shadow: var(--shadow); }
.product-open { display: block; width: 100%; height: 100%; min-width: 0; padding: 0; text-align: left; }
.product-open:focus-visible { outline-offset: -4px; }
.product-image-wrap { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; aspect-ratio: 1; overflow: hidden; background: var(--brand-soft); }
.product-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.product-storage { position: absolute; top: 13px; left: 13px; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); border-radius: 5px; background: color-mix(in srgb, var(--paper) 95%, transparent); color: var(--ink); font-size: 10px; font-weight: 500; }
.product-arrow { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--paper); color: var(--brand); box-shadow: var(--shadow); }
.product-arrow svg { width: 16px; height: 16px; }
.product-body { min-width: 0; padding: 13px; }
.product-brand { min-height: 14px; margin-bottom: 4px; overflow: hidden; color: var(--brand); font-size: 9px; font-weight: 600; letter-spacing: .8px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.product-name { display: -webkit-box; min-height: 39px; overflow: hidden; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: -.2px; }
.product-category { margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink); font-size: 11px; }
.product-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-code { max-width: 50%; flex-shrink: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.no-image { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; width: 100%; height: 100%; background: linear-gradient(130deg, var(--canvas), var(--brand-soft)); color: var(--muted); font-size: 12px; }
.no-image svg { width: 48px; height: 48px; color: var(--brand); stroke-width: 1; }
.product-grid.text-catalog { --catalog-row-height: 180px; }
.text-catalog .product-card { border-top: 3px solid var(--accent); }
.text-catalog .product-body { padding: 16px; }
.text-catalog .product-name { min-height: 42px; font-size: 15px; }
.text-catalog .product-brand { margin-bottom: 6px; }
.text-catalog .product-meta { margin-top: 12px; }
.product-excerpt { display: -webkit-box; margin-top: 8px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* List thumbnails have their own fixed slot, independent of grid image ratios. */
.product-grid.list-view { --catalog-row-height: 110px; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.product-grid.list-view .product-card:hover { transform: none; }
.product-grid.list-view .product-open { display: grid; grid-template-columns: var(--catalog-list-thumb) minmax(0, 1fr); align-items: center; gap: 14px; min-height: calc(var(--catalog-list-thumb) + 24px); padding: 12px; }
.product-grid.list-view .product-image-wrap { width: var(--catalog-list-thumb); height: var(--catalog-list-thumb); min-width: 0; min-height: 0; max-width: var(--catalog-list-thumb); max-height: var(--catalog-list-thumb); aspect-ratio: auto; contain: layout paint; border-radius: 7px; }
.product-grid.list-view .product-image { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.product-grid.list-view .product-storage, .product-grid.list-view .product-arrow { display: none; }
.product-grid.list-view .product-body { min-width: 0; padding: 0; }
.product-grid.list-view .product-brand { min-height: 0; margin-bottom: 3px; font-size: 9px; }
.product-grid.list-view .product-name { min-height: 0; font-size: 14px; line-height: 1.35; }
.product-grid.list-view .product-category { margin-top: 4px; font-size: 11px; }
.product-grid.list-view .product-meta { justify-content: flex-start; flex-wrap: wrap; column-gap: 18px; row-gap: 3px; margin-top: 6px; padding-top: 0; border-top: 0; font-size: 11px; }
.product-grid.list-view .product-code { max-width: 100%; font-size: 10px; }
.product-grid.list-view .no-image { gap: 5px; font-size: 8px; text-align: center; }
.product-grid.list-view .no-image svg { width: 25px; height: 25px; }
.product-grid.list-view .product-excerpt { margin-top: 5px; font-size: 11px; }
.product-grid.text-catalog.list-view .product-open { display: block; min-height: 0; }

/* Pagination, loading, and recoverable empty/error states. */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 60px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.page-buttons { display: flex; align-items: center; gap: 5px; }
.page-button { min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); font-size: 12px; }
.page-button.current { border-color: var(--brand); background: var(--brand); color: var(--on-brand, white); }
.page-button:not(.current):hover { background: var(--brand-soft); }
.page-button svg { width: 13px; height: 13px; vertical-align: middle; }
.page-ellipsis { padding: 0 3px; }
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 330px; padding: 42px 24px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--paper); color: var(--muted); text-align: center; }
.empty-state svg { width: 42px; height: 42px; margin-bottom: 18px; color: var(--brand); stroke-width: 1.3; }
.empty-state h3, .empty-state h2 { margin-bottom: 10px; color: var(--ink); font-size: 23px; font-weight: 600; }
.empty-state p { max-width: 400px; font-size: 14px; }
.primary-button { min-height: 44px; margin-top: 22px; padding: 11px 20px; border-radius: 7px; background: var(--brand); color: var(--on-brand, white); font-size: 14px; }
.primary-button:hover { background: var(--brand-hover); }
.skeleton-card { overflow: hidden; padding-bottom: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); animation: pulse 1.5s infinite ease-in-out; }
.skeleton-card div { aspect-ratio: 1; background: var(--brand-soft); }
.skeleton-card span { display: block; width: 70%; height: 12px; margin: 20px 18px 0; border-radius: 3px; background: var(--line); }
.skeleton-card span:last-child { width: 45%; }
.text-catalog .skeleton-card div { display: none; }
.list-view .skeleton-card { min-height: calc(var(--catalog-list-thumb) + 24px); padding: 12px; }
.list-view .skeleton-card div { float: left; width: var(--catalog-list-thumb); height: var(--catalog-list-thumb); margin-right: 14px; border-radius: 7px; }
.list-view .skeleton-card span { width: 45%; margin: 17px 0 0; }
.list-view .skeleton-card span:last-child { width: 30%; }
@keyframes pulse { 50% { opacity: .5; } }

/* Powered-by footer. */
.site-footer { display: flex; align-items: center; gap: 30px; margin-top: 62px; padding-block: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-brand { color: var(--ink); font-family: var(--font-heading); font-size: 19px; font-weight: 700; letter-spacing: -.6px; }
.footer-brand > span:not(.powered-by) { margin-left: 7px; font-size: 11px; font-weight: 400; letter-spacing: .2px; }
.footer-brand .powered-by { display: block; margin-bottom: 3px; color: var(--muted); font: 400 9px/1.3 var(--font-body); letter-spacing: 1.2px; text-transform: uppercase; }
.site-footer > p { font-size: 11px; }
.footer-right { display: flex; align-items: center; gap: 25px; margin-left: auto; font-size: 11px; }
.footer-right a:hover { color: var(--brand); text-decoration: underline; }

/* Product profile and image gallery. */
.product-dialog { width: calc(100% - 48px); max-width: 1050px; max-height: 90vh; overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.product-dialog::backdrop { background: color-mix(in srgb, var(--ink) 52%, transparent); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); }
.product-details-layout { display: grid; grid-template-columns: 1fr 1.1fr; min-height: 460px; }
.detail-gallery { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 32px 26px; background: var(--canvas); }
.detail-main-image { display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; }
.detail-gallery .no-image { min-height: 300px; aspect-ratio: 1; border-radius: 12px; }
.detail-thumbnails { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.detail-thumb { width: 62px; height: 62px; overflow: hidden; padding: 3px; border: 2px solid transparent; border-radius: 7px; }
.detail-thumb.selected { border-color: var(--brand); }
.detail-thumb img { width: 100%; height: 100%; border-radius: 3px; object-fit: cover; }
.detail-copy { padding: 50px 36px 36px; }
.detail-copy h2 { margin: 12px 0 16px; font-size: 31px; font-weight: 700; line-height: 1.15; letter-spacing: -.7px; }
.detail-description { color: var(--muted); font-size: 14px; line-height: 1.8; }
.detail-specs { margin: 24px 0 0; border-top: 1px solid var(--line); }
.detail-specs:empty { display: none; }
.detail-spec-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.detail-spec-row dt { color: var(--muted); }
.detail-spec-row dd { margin: 0; color: var(--ink); }
.detail-spec-row.detail-description-row { grid-template-columns: 1fr; gap: 5px; padding-block: 15px; white-space: pre-line; }
.detail-description-row dd { font-size: 14px; line-height: 1.8; }
.detail-discovery-note { margin-top: 23px; color: var(--muted); font-size: 12px; }
.detail-loading { padding: 65px 30px; color: var(--muted); text-align: center; }
.product-details-layout.no-gallery { display: block; min-height: 0; }
.no-gallery .detail-copy { padding: 50px 44px 36px; }

/* The fluid grid responds to the catalog column rather than fixed screen sizes. */
@media (max-width: 1240px) {
  .catalog-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
  .filters-panel { padding-inline: 14px; }
  .header-label, .header-divider { display: none; }
  .sort-control label { display: none; }
}
@media (max-width: 1000px) {
  :root { --page-gutter: 20px; }
  .catalog-layout { grid-template-columns: 215px minmax(0, 1fr); gap: 22px; }
  .company-wordmark { max-width: 50%; }
  .company-wordmark-text { font-size: 20px; }
  .company-logo-frame { max-width: 110px; }
  .company-logo { max-width: 94px; max-height: 42px; }
  .results-toolbar { flex-wrap: wrap; }
  .toolbar-controls { flex-wrap: wrap; gap: 9px; }
  .results-heading h2 { font-size: 22px; }
  .site-footer > p { display: none; }
  .footer-right { gap: 16px; }
}

/* On phones, the left navigation becomes a focus-trapped filter drawer. */
@media (max-width: 720px) {
  :root { --page-gutter: 16px; --catalog-card-min: 145px; --catalog-card-gap: 10px; --catalog-list-thumb: 72px; }
  .site-header, .header-inner { min-height: 84px; }
  .header-inner { flex-wrap: wrap; gap: 10px; padding-block: 12px; }
  .header-selectors { flex-basis: 100%; width: 100%; gap: 8px; }
  .header-selectors .catalog-switcher { max-width: none; }
  .language-switcher { flex-basis: 112px; padding: 8px 10px; border-radius: 8px; }
  .language-switcher label { font-size: 9px; }
  .language-switcher select { font-size: 12px; }
  .company-wordmark { max-width: 100%; gap: 9px; }
  .company-wordmark-text { font-size: 15px; line-height: 1.2; letter-spacing: -.2px; }
  .wordmark-caption { margin-top: 5px; font-size: 8px; letter-spacing: 1.2px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 22px; }
  .company-logo-frame { max-width: 78px; min-width: 34px; min-height: 36px; padding: 4px; }
  .company-logo { max-width: 68px; max-height: 34px; }
  .catalog-switcher { min-width: 0; max-width: 43%; padding: 8px 10px; border-radius: 8px; }
  .catalog-switcher label { font-size: 8px; letter-spacing: .8px; }
  .catalog-switcher select { padding-right: 13px; font-size: 11px; }
  .catalog-summary { align-items: flex-start; gap: 12px; margin-block: 17px; padding-bottom: 14px; }
  .catalog-summary h1 { font-size: 19px; letter-spacing: -.4px; }
  .catalog-summary-copy p { font-size: 11px; }
  .catalog-summary-meta { flex-direction: column; align-items: flex-end; gap: 7px; padding-top: 3px; font-size: 11px; }
  .eyebrow { font-size: 10px; letter-spacing: 1.1px; gap: 8px; }
  .demo-badge { font-size: 10px; }
  .catalog-layout { display: block; }
  .filters-panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 51;
    width: min(350px, calc(100vw - 40px));
    max-height: 100dvh;
    padding: 25px;
    visibility: hidden;
    transform: translateX(-105%);
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: var(--shadow);
    transition: transform .2s, visibility .2s;
  }
  .panel-open .filters-panel { visibility: visible; transform: translateX(0); }
  .panel-open { overflow: hidden; }
  .mobile-only { display: flex; }
  .filter-backdrop:not([hidden]) { position: fixed; inset: 0; z-index: 50; display: block; width: 100%; height: 100%; background: color-mix(in srgb, var(--ink) 40%, transparent); backdrop-filter: blur(2px); cursor: default; }
  .filter-heading { margin-bottom: 25px; }
  .filter-heading h2 { font-size: 21px; }
  .filter-heading .icon-button { display: grid; width: 42px; height: 42px; }
  .category-section-label { font-size: 11px; }
  .category-collapse { min-height: 40px; font-size: 11px; }
  .category-search { min-height: 44px; }
  .category-search input { height: 42px; font-size: 16px; }
  .category-search button { width: 32px; height: 40px; }
  .category-menu { max-height: 43dvh; }
  .category-button { min-height: 46px; padding-block: 12px; font-size: 14px; }
  .category-count { font-size: 12px; }
  .category-expand { width: 44px; height: 44px; flex-basis: 44px; }
  .subcategory-list .category-button { min-height: 42px; padding-block: 10px; font-size: 13px; }
  .check-option { min-height: 44px; gap: 11px; font-size: 14px; }
  .check-option input { width: 18px; height: 18px; }
  .filter-section summary { min-height: 42px; font-size: 14px; }
  .clear-filters { font-size: 13px; }
  .apply-filters { justify-content: center; width: 100%; margin-top: 21px; }
  .search-form { height: 54px; gap: 10px; padding-left: 15px; }
  .search-form input { font-size: 16px; }
  .search-form button { height: 40px; gap: 10px; padding-inline: 13px; font-size: 12px; }
  .search-form > svg { width: 18px; height: 18px; }
  .search-mode-switcher { width: 100%; }
  .search-mode-switcher button { flex: 1 1 auto; min-height: 36px; padding-inline: 8px; }
  .dish-results { padding: 12px; }
  .dish-results-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; }
  .dish-results-heading > div { flex: 1 1 150px; }
  .dish-results-heading h3 { font-size: 16px; }
  .dish-clear { max-width: none; margin-left: auto; text-align: right; }
  .ingredient-chip { min-height: 39px; padding: 7px 9px; font-size: 11px; }
  .dish-search-help { font-size: 10px; }
  .search-form.dish-mode button { gap: 6px; padding-inline: 10px; font-size: 11px; }
  .results-toolbar { align-items: center; flex-wrap: wrap; gap: 17px; margin-top: 23px; }
  .results-heading { flex: 1; }
  .results-heading h2 { font-size: 23px; }
  .eyebrow.small { font-size: 9px; }
  .toolbar-controls { justify-content: space-between; flex-wrap: wrap; gap: 8px; width: 100%; padding-top: 11px; border-top: 1px solid var(--line); }
  .filter-toggle { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 13px; }
  .filter-toggle svg { width: 16px; height: 16px; }
  .filter-toggle > span { align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; background: var(--brand); color: var(--on-brand, white); font-size: 10px; }
  .filter-toggle > span:not([hidden]) { display: flex; }
  .sort-control label { display: none; }
  .sort-control select { max-width: 125px; font-size: 11px; }
  .view-controls { display: flex; gap: 0; padding: 2px; }
  .view-controls .icon-button { width: 34px; height: 36px; }
  .product-grid { --catalog-row-height: 240px; }
  .product-body { padding: 11px; }
  .product-brand { margin-bottom: 4px; font-size: 8px; letter-spacing: .5px; }
  .product-name { min-height: 36px; font-size: 13px; line-height: 1.4; letter-spacing: -.2px; }
  .product-category { margin-top: 5px; font-size: 10px; }
  .product-meta { flex-wrap: wrap; gap: 4px; margin-top: 8px; padding-top: 7px; font-size: 10px; }
  .product-code { max-width: 100%; font-size: 9px; }
  .product-storage { top: 9px; left: 9px; padding: 4px 6px; font-size: 9px; }
  .product-arrow { right: 9px; bottom: 9px; width: 28px; height: 28px; }
  .product-arrow svg { width: 14px; height: 14px; }
  .text-catalog .product-body { padding: 13px; }
  .text-catalog .product-name { min-height: 36px; font-size: 13px; }
  .text-catalog .product-meta { margin-top: 9px; }
  .product-grid.list-view .product-open { gap: 11px; padding: 10px; }
  .product-grid.list-view .product-name { font-size: 13px; }
  .product-excerpt { font-size: 12px; }
  .pagination { flex-wrap: wrap; gap: 12px; margin-top: 24px; font-size: 11px; }
  .page-button { min-width: 35px; height: 35px; padding-inline: 8px; }
  .site-footer { align-items: flex-start; gap: 15px; margin-top: 40px; padding-block: 24px; }
  .footer-right { flex-direction: column; align-items: flex-end; gap: 6px; font-size: 10px; }
  .footer-brand { font-size: 17px; }
  .footer-brand > span:not(.powered-by) { margin-left: 5px; font-size: 10px; }
  .footer-brand .powered-by { font-size: 8px; letter-spacing: 1px; }
  .product-dialog { width: calc(100% - 24px); max-height: 92dvh; border-radius: 15px; }
  .product-details-layout { grid-template-columns: 1fr; }
  .detail-gallery { min-height: 250px; padding: 24px; }
  .detail-main-image { aspect-ratio: 1.4; max-height: 300px; }
  .detail-gallery .no-image { min-height: 220px; aspect-ratio: 1.4; }
  .detail-copy { padding: 27px 25px; }
  .detail-copy h2 { font-size: 28px; }
  .detail-description { font-size: 14px; }
  .detail-spec-row { font-size: 13px; }
  .detail-discovery-note { font-size: 11px; }
  .no-gallery .detail-copy { padding: 48px 25px 30px; }
  .dialog-close { top: 10px; right: 10px; }
}
@media (max-width: 380px) {
  :root { --page-gutter: 12px; --catalog-card-min: 136px; --catalog-card-gap: 8px; }
  .header-inner { gap: 9px; }
  .company-wordmark-text { font-size: 13px; }
  .brand-mark { width: 31px; height: 33px; font-size: 20px; }
  .wordmark-caption { font-size: 7px; letter-spacing: 1px; }
  .catalog-switcher { padding: 7px 8px; }
  .catalog-switcher select { font-size: 10px; }
  .catalog-summary h1 { font-size: 17px; }
  .sort-control select { max-width: 105px; }
  .product-body { padding: 10px; }
  .product-name { font-size: 13px; min-height: 36px; }
  .product-category { font-size: 10px; }
  .product-meta { display: block; }
  .product-code { display: block; margin-top: 4px; }
}
@media (min-width: 721px) {
  .mobile-only { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
