/* Visual system adapted from the approved local warm-white demo.
   Production content, data and behaviour remain in the existing app files. */
:root {
  --ink: #2b2925;
  --ink-soft: #4f4d47;
  --muted: #75736b;
  --faint: #89877f;
  --canvas: #fcfbf8;
  --surface: #fff;
  --surface-warm: #f3e8dd;
  --surface-muted: #f3f2ed;
  --line: #e5e3dc;
  --line-strong: #d2cfc7;
  --berry: #ae492e;
  --berry-dark: #963b25;
  --berry-soft: #f2dfd7;
  --caramel: #ad6740;
  --caramel-soft: #f3e8dd;
  --tea: #4a6650;
  --tea-soft: #e8eee7;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 3px 16px rgb(43 41 37 / 5%);
  --shadow-md: 0 18px 48px rgb(43 41 37 / 13%);
  --topbar-height: 88px;
}

html {
  scroll-padding-top: calc(var(--topbar-height) + 20px);
}

body {
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.6;
}

.topbar {
  background: rgb(252 251 248 / 96%);
  border-color: var(--line);
}

.topbar__inner,
.app-main,
.site-footer__inner {
  width: min(100%, 1440px);
  padding-inline: 56px;
}

.topbar__inner {
  gap: 30px;
}

.brand-lockup {
  gap: 12px;
}

.brand-mark {
  width: 33px;
  height: 33px;
}

.brand-wordmark strong {
  font-size: 1.7rem;
  letter-spacing: -0.055em;
}

.brand-wordmark small {
  font-size: 0.58rem;
}

.global-search {
  max-width: 390px;
  height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.global-search > svg {
  margin-left: 3px;
}

.global-search:focus-within,
.mobile-search:focus-within {
  border-color: var(--berry);
}

.global-search input,
.mobile-search input {
  font-size: 0.8rem;
}

.search-place {
  color: var(--muted);
  font-size: 0.72rem;
}

.topnav button {
  min-width: 56px;
  color: var(--muted);
}

.topnav button.is-active,
.topnav button:hover {
  color: var(--berry);
}

.topnav span {
  font-size: 0.67rem;
  font-weight: 600;
}

.language-toggle {
  min-width: 44px;
  height: 36px;
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
}

.app-main {
  padding-top: 0;
  padding-bottom: 76px;
}

.site-footer {
  background: var(--canvas);
}

.eyebrow {
  color: var(--berry);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.primary-button,
.secondary-button,
.map-button {
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 650;
}

.primary-button {
  background: var(--berry);
  color: #fff;
}

.primary-button:hover {
  background: var(--berry-dark);
}

.secondary-button,
.map-button {
  border-color: var(--line-strong);
  background: var(--surface);
}

.text-button,
.section-heading > button,
.home-board__header > button {
  color: var(--berry);
  font-weight: 650;
}

.home-board {
  padding: 48px 0 22px;
}

.home-board__header {
  margin-bottom: 28px;
}

.home-board__header h1 {
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 550;
  letter-spacing: -0.055em;
  line-height: 1.25;
}

.home-board__header > button {
  align-self: end;
  font-size: 0.8rem;
}

.home-feature-grid,
.home-feature-grid--single,
.home-feature-grid--empty {
  display: grid;
  height: auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.home-feature {
  display: grid;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  color: var(--ink);
  grid-template-columns: 1fr;
  text-align: left;
}

.home-feature::after {
  content: none;
}

.home-feature__photo {
  display: block;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-muted);
}

.home-feature__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.home-feature:hover .home-feature__photo img {
  transform: scale(1.035);
}

.home-feature--lead {
  min-height: 430px;
  background: var(--surface-warm);
  grid-template-columns: 1.32fr 1fr;
}

.home-feature--lead .home-feature__photo {
  min-height: 430px;
}

.home-feature__copy,
.home-feature--lead .home-feature__copy {
  position: static;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 38px 44px;
  flex-direction: column;
  gap: 0;
}

.home-feature__copy > span:first-child {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.home-feature__copy strong,
.home-feature--lead .home-feature__copy strong {
  font-size: clamp(2rem, 3.1vw, 2.65rem);
  font-weight: 550;
  letter-spacing: -0.055em;
  line-height: 1.35;
}

.home-feature__copy small {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.65;
}

.home-feature__cta {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  margin-top: 26px;
  background: var(--berry);
  color: #fff;
  font-size: 0.77rem;
  font-weight: 650;
  gap: 20px;
}

.home-feature-stack {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto;
  gap: 24px;
}

.home-feature-stack--single {
  width: calc(50% - 12px);
  grid-template-columns: minmax(0, 1fr);
}

.home-feature-stack .home-feature {
  grid-template-rows: 240px 1fr;
}

.home-feature-stack .home-feature__copy {
  padding: 22px 24px;
}

.home-feature-stack .home-feature__copy strong {
  font-size: 1.4rem;
}

.home-feature-stack .home-feature__copy small {
  margin-top: 7px;
}

.home-feature-stack .home-feature__cta {
  min-height: 0;
  padding: 0;
  margin-top: 14px;
  background: transparent;
  color: var(--berry);
}

.home-catalogue-empty {
  min-height: 380px;
  padding: 60px 32px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.home-catalogue-empty h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 550;
}

.home-catalogue-empty p {
  color: var(--muted);
  font-size: 0.9rem;
}

.home-catalogue-empty button {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--berry);
  color: #fff;
  font-size: 0.8rem;
}

.home-catalogue-empty--loading {
  background: linear-gradient(110deg, var(--surface-muted) 15%, #fff 45%, var(--surface-muted) 75%);
  background-size: 220% 100%;
  animation: theme-shimmer 1.8s linear infinite;
}

.home-tools {
  margin-top: 22px;
  border: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-tools button {
  min-height: 102px;
  padding: 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.home-tools button:nth-child(2) {
  background: var(--surface-warm);
}

.home-tools button:last-child {
  border: 0;
}

.home-tools button:hover {
  background: var(--surface-warm);
}

.home-tools strong {
  font-size: 0.92rem;
  font-weight: 650;
}

.home-tools small {
  font-size: 0.72rem;
}

.home-section {
  padding: 42px 0 12px;
  border: 0;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 550;
  letter-spacing: -0.04em;
}

.section-heading > button {
  font-size: 0.78rem;
}

.category-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.category-cards button {
  min-height: 120px;
  padding: 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 5px;
}

.category-cards button:nth-child(even) {
  background: var(--surface-warm);
}

.category-cards button:hover {
  border: 0;
  background: #e8dfd6;
}

.category-cards strong,
.category-cards small {
  align-self: auto;
}

.category-cards strong {
  font-size: 1rem;
  font-weight: 600;
}

.category-cards small {
  font-size: 0.71rem;
  line-height: 1.45;
}

.collection-preview-grid {
  gap: 16px;
}

.collection-preview-card {
  min-height: 260px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  grid-template-rows: 156px 1fr;
}

.collection-preview-card:nth-child(2) {
  background: var(--surface-warm);
}

.collection-preview-card--no-image {
  min-height: 150px;
  grid-template-rows: minmax(0, 1fr);
}

.collection-preview-card > img {
  height: 156px;
}

.collection-preview-card__copy {
  padding: 18px 20px;
}

.collection-preview-card__copy strong {
  font-size: 1.15rem;
  font-weight: 550;
}

.collection-preview-card__copy em {
  color: var(--berry);
}

.collection-state {
  display: grid;
  min-height: 150px;
  align-content: center;
  justify-items: center;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
  gap: 10px;
}

.collection-state p {
  margin: 0;
}

.explore-page {
  padding-top: 48px;
}

.explore-header {
  margin-bottom: 24px;
}

.explore-header h1,
.page-title h1 {
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 550;
  letter-spacing: -0.05em;
}

.category-filter {
  padding: 0 0 28px;
  gap: 6px;
}

.category-filter button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.category-filter button:hover,
.category-filter button.is-selected {
  border: 0;
  background: var(--ink);
  color: #fff;
}

.search-workspace {
  display: grid;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
}

.filter-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
  align-self: start;
  max-height: calc(100dvh - var(--topbar-height) - 40px);
  padding: 20px;
  overflow-y: auto;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.filter-panel__heading h2 {
  font-size: 1rem;
  font-weight: 600;
}

.filter-panel fieldset {
  border-color: var(--line);
}

.filter-panel legend {
  font-size: 0.78rem;
  font-weight: 650;
}

.filter-panel label {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.filter-panel input:not([type="checkbox"]) {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}

.filter-panel .filter-price-row label {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.filter-panel .filter-price-row label > span {
  white-space: nowrap;
}

.filter-note {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--tea-soft);
}

.result-pane {
  min-height: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.result-toolbar {
  position: static;
  min-height: 0;
  padding: 0 0 20px;
  border: 0;
  background: transparent;
}

.result-toolbar h2 {
  font-size: 1.16rem;
  font-weight: 550;
}

.result-toolbar p {
  font-size: 0.73rem;
}

.result-toolbar select {
  width: auto;
  max-width: 180px;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.product-result-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 20px;
}

.product-result-card,
.product-result-card--compact {
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.product-result-card__button,
.product-result-card--compact .product-result-card__button {
  display: flex;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  flex-direction: column;
  gap: 0;
}

.product-result-card__button:hover,
.product-result-card__button:focus-visible {
  background: transparent;
}

.product-result-card__image,
.product-result-card--compact .product-result-card__image {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1.08;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  object-fit: cover;
  transition: transform 240ms ease;
}

.product-result-card__button:hover .product-result-card__image,
.product-result-card__button:focus-visible .product-result-card__image {
  transform: scale(1.02);
}

.product-result-card__body,
.product-result-card--compact .product-result-card__body {
  display: flex;
  width: 100%;
  min-width: 0;
  padding: 13px 0 0;
  flex-direction: column;
}

.product-result-card__shop {
  order: 1;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.product-result-card__name {
  order: 2;
  overflow: visible;
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: clip;
  white-space: normal;
}

.product-result-card__topline {
  order: 3;
  align-items: center;
  margin: 8px 0 0;
  gap: 6px;
}

.product-result-card__price {
  order: -1;
  font-family: var(--font-brand);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.15;
}

.product-status {
  flex: 0 1 auto;
  font-size: 0.64rem;
  font-weight: 600;
  text-align: right;
}

.product-result-card__facts,
.product-result-card__allergen,
.product-result-card__deadline {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.5;
}

.product-result-card__facts {
  order: 4;
  margin-top: 6px;
}

.product-result-card__allergen {
  order: 6;
  margin-top: 4px;
  color: var(--muted);
}

.product-result-card__deadline {
  order: 5;
  margin-top: 4px;
  padding: 0;
  color: var(--tea);
  font-weight: 600;
}

.collection-product-grid {
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 20px;
}

.collection-section__heading {
  border-color: var(--line);
}

.empty-results,
.results-state {
  min-height: 250px;
  padding: 48px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  color: var(--muted);
  text-align: center;
}

.empty-results h3,
.results-state h3 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 600;
}

.empty-results p,
.results-state p {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.6;
}

.empty-results button,
.results-state button {
  margin-top: 20px;
}

.results-state--loading {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
}

.results-state__mark {
  width: 42px;
  height: 42px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--berry);
  border-radius: 50%;
  animation: theme-spin 900ms linear infinite;
}

.collection-empty {
  padding: 30px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

@keyframes theme-spin {
  to { transform: rotate(360deg); }
}

@keyframes theme-shimmer {
  to { background-position-x: -220%; }
}

@media (max-width: 1240px) {
  .topbar__inner,
  .app-main,
  .site-footer__inner {
    padding-inline: 32px;
  }

  .home-feature--lead {
    min-height: 390px;
  }

  .home-feature--lead .home-feature__photo {
    min-height: 390px;
  }

  .product-result-list,
  .collection-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .global-search {
    max-width: none;
  }

  .search-workspace {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 22px;
  }

  .product-result-list,
  .collection-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-feature--lead {
    grid-template-columns: 1.1fr 1fr;
  }

  .home-feature--lead .home-feature__copy {
    padding: 26px;
  }
}

@media (max-width: 767px) {
  :root { --topbar-height: 72px; }

  body {
    padding-bottom: 74px;
    background: var(--canvas);
  }

  .topbar__inner,
  .app-main,
  .site-footer__inner {
    padding-inline: 20px;
  }

  .topbar {
    background: rgb(252 251 248 / 97%);
  }

  .topbar__inner {
    justify-content: center;
  }

  .brand-wordmark strong {
    font-size: 1.5rem;
  }

  .brand-wordmark small {
    display: none;
  }

  .app-main {
    padding-top: 0;
    padding-bottom: 36px;
  }

  .home-board {
    padding: 30px 0 14px;
  }

  .home-board__header {
    align-items: flex-end;
    margin-bottom: 20px;
    gap: 10px;
  }

  .home-board__header h1 {
    font-size: 2.1rem;
  }

  .home-board__header > button {
    flex: 0 0 auto;
    font-size: 0.72rem;
  }

  .home-feature-grid,
  .home-feature-grid--single,
  .home-feature-grid--empty {
    gap: 16px;
  }

  .home-feature--lead {
    min-height: 0;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .home-feature--lead .home-feature__photo {
    min-height: 0;
    aspect-ratio: 1.4;
  }

  .home-feature--lead .home-feature__copy {
    padding: 24px;
  }

  .home-feature--lead .home-feature__copy strong {
    font-size: 1.75rem;
  }

  .home-feature__copy small {
    margin-top: 12px;
  }

  .home-feature__cta {
    margin-top: 18px;
  }

  .home-feature-stack,
  .home-feature-stack--single {
    width: 100%;
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 12px;
  }

  .home-feature-stack--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-feature-stack .home-feature {
    grid-template-rows: 130px 1fr;
  }

  .home-feature-stack .home-feature__copy {
    padding: 14px;
  }

  .home-feature-stack .home-feature__copy strong {
    font-size: 1rem;
  }

  .home-feature-stack .home-feature__copy small {
    display: block;
    font-size: 0.66rem;
  }

  .home-catalogue-empty {
    min-height: 300px;
    padding: 42px 22px;
  }

  .home-tools {
    margin-top: 16px;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .home-tools button {
    min-height: 70px;
    padding: 14px 16px;
  }

  .home-section {
    padding: 36px 0 4px;
  }

  .section-heading {
    align-items: flex-end;
  }

  .section-heading h2 {
    font-size: 1.35rem;
  }

  .category-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .category-cards button {
    min-height: 110px;
    padding: 16px;
  }

  .category-cards strong {
    font-size: 0.92rem;
  }

  .category-cards small {
    font-size: 0.65rem;
  }

  .collection-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-preview-card {
    min-height: 0;
    grid-template-columns: 36% minmax(0, 1fr);
    grid-template-rows: minmax(150px, auto);
  }

  .collection-preview-card > img {
    height: 100%;
  }

  .explore-page {
    padding-top: 28px;
  }

  .mobile-search {
    height: 46px;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .map-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .map-button span {
    display: none;
  }

  .mobile-search > svg {
    margin-left: 0;
  }

  .category-filter {
    padding: 16px 0 20px;
    margin-right: -20px;
  }

  .category-filter button {
    min-height: 34px;
    padding-inline: 13px;
    font-size: 0.72rem;
  }

  .search-workspace {
    display: block;
    background: transparent;
  }

  .filter-panel {
    position: static;
    max-height: none;
    padding: 18px;
    border: 0;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: visible;
  }

  .mobile-filter-toggle {
    border: 0;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--ink);
  }

  .result-toolbar {
    min-height: 0;
    padding: 0 0 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .result-toolbar h2 {
    font-size: 1rem;
  }

  .result-toolbar p {
    font-size: 0.66rem;
  }

  .result-toolbar select {
    width: 124px;
    max-width: 124px;
    font-size: 0.72rem;
  }

  .product-result-list,
  .collection-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
  }

  .product-result-card__button,
  .product-result-card--compact .product-result-card__button {
    min-height: 0;
    padding: 0;
  }

  .product-result-card__image,
  .product-result-card--compact .product-result-card__image {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 0.95;
  }

  .product-result-card__body,
  .product-result-card--compact .product-result-card__body {
    padding: 11px 0 0;
  }

  .product-result-card__name {
    font-size: 0.87rem;
  }

  .product-result-card__price {
    font-size: 1.37rem;
  }

  .product-status {
    font-size: 0.6rem;
  }

  .product-result-card__facts,
  .product-result-card__deadline {
    font-size: 0.62rem;
  }

  .product-result-card__allergen {
    display: none;
  }

  .mobile-nav {
    background: rgb(252 251 248 / 97%);
    box-shadow: none;
  }
}

@media (max-width: 420px) {
  .topbar__inner,
  .app-main,
  .site-footer__inner {
    padding-inline: 16px;
  }

  .category-filter {
    margin-right: -16px;
  }

  .home-feature-stack .home-feature {
    grid-template-rows: 115px 1fr;
  }

  .home-feature-stack .home-feature__copy {
    padding: 12px;
  }

  .product-result-card__facts {
    display: block;
  }

  .product-result-card--compact .product-result-card__button {
    display: flex;
    grid-template-columns: none;
    grid-template-rows: none;
  }

  .product-result-card--compact .product-result-card__image {
    height: auto;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-catalogue-empty--loading,
  .results-state__mark {
    animation: none;
  }

  .home-feature__photo img,
  .product-result-card__image {
    transition: none;
  }
}
