:root {
  --bg: #fff7e8;
  --bg-soft: #fffdf8;
  --panel: #ffffff;
  --text: #4d3026;
  --muted: #84675d;
  --primary: #5c3b31;
  --primary-strong: #45291f;
  --accent: #efb31e;
  --accent-soft: #fff0c7;
  --line: rgba(92, 59, 49, 0.12);
  --line-strong: rgba(92, 59, 49, 0.2);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shell: 1180px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 179, 30, 0.12), transparent 22%),
    linear-gradient(180deg, #fff8ea 0%, #fff6e5 100%);
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(calc(100% - 1rem), var(--shell));
  margin: 0 auto;
}

.hero {
  background: var(--primary);
  color: #fff;
  border-bottom: 6px solid var(--accent);
}

.hero__inner {
  width: min(calc(100% - 1rem), 940px);
  margin: 0 auto;
  padding: 1.5rem 0.25rem 1.85rem;
  text-align: center;
}

.hero__logo {
  width: 144px;
  margin: 0 auto 0.85rem;
}

.hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 3.15rem);
  line-height: 1.08;
}

.hero__text {
  margin: 0.85rem auto 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  line-height: 1.65;
}

.search-panel {
  width: min(100%, 920px);
  margin: 1.4rem auto 0;
}

.search-field {
  display: block;
}

.search-field input {
  width: 100%;
  min-height: 72px;
  border: 1px solid rgba(92, 59, 49, 0.16);
  border-radius: 24px;
  padding: 1rem 1.25rem;
  background: #fff;
  color: var(--text);
  font-size: 1.05rem;
  transition: border-color var(--transition), transform var(--transition);
}

.search-field input:focus {
  outline: none;
  border-color: rgba(239, 179, 30, 0.9);
}

.filter-row {
  margin-top: 1rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.filter-button,
.product-card__button,
.product-modal__close {
  border: none;
  cursor: pointer;
}

.filter-button {
  padding: 0.88rem 1.15rem;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  border: 1px solid rgba(92, 59, 49, 0.14);
  font-weight: 800;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}

.filter-button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.catalog {
  margin-top: 1.65rem;
}

.section-heading {
  display: grid;
  gap: 0.32rem;
}

.section-label,
.modal-category {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
}

.section-heading h2,
.info-card h3,
.empty-state h3,
.modal-head h2 {
  margin: 0;
}

.section-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.section-heading p,
.results-text,
.footer p,
.modal-date,
.table-note,
.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.results-text {
  margin-top: 1.35rem;
}

.product-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.9rem;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-soft);
  padding: 1.05rem;
  display: grid;
  gap: 0.85rem;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-1px);
  border-color: rgba(92, 59, 49, 0.28);
  background: #fffefb;
}

.product-card:focus-visible {
  outline: 2px solid rgba(239, 179, 30, 0.7);
  outline-offset: 2px;
}

.product-card__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.product-card__category {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.product-card__name {
  margin: 0;
  color: var(--primary);
  font-size: 1.22rem;
  line-height: 1.2;
}

.product-card__button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.78rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--primary-strong);
  font-weight: 800;
  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition);
}

.product-card__button::after {
  content: ">";
  font-size: 0.95rem;
}

.product-card:hover .product-card__button,
.product-card:focus-within .product-card__button {
  background: var(--primary);
  color: #fff;
}

.empty-state {
  margin-top: 1rem;
  padding: 1.35rem;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.6);
}

.footer {
  margin-top: 2rem;
  background: var(--primary);
  border-top: 6px solid var(--accent);
}

.footer__inner {
  padding: 1.4rem 0 1.8rem;
  display: grid;
  gap: 1rem;
}

.footer p {
  color: rgba(255, 255, 255, 0.86);
}

.footer__title {
  margin: 0 0 0.35rem;
  font-weight: 800;
  color: #fff;
}

.footer__link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.footer__link:hover,
.footer__link:focus-visible {
  text-decoration: underline;
}

.footer__credit {
  align-self: end;
}

.footer__credit-link,
.footer__credit-link:visited,
.footer__credit-link:link,
.footer__credit-link:active {
  display: inline-block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.83rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer__credit-link:hover,
.footer__credit-link:focus-visible {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: underline;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
}

.product-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 22, 18, 0.5);
}

.product-modal__panel {
  position: relative;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  padding: 1rem;
}

.product-modal__close {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--primary);
  font-weight: 800;
}

.modal-head {
  margin-top: 1rem;
  display: grid;
  gap: 0.3rem;
}

.modal-head h2 {
  font-size: 2rem;
  line-height: 1.1;
}

.modal-layout {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
}

.info-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.15rem;
}

.info-card__head {
  margin-bottom: 0.85rem;
}

.ingredients-text {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  text-align: justify;
  text-justify: inter-word;
}

.info-card--alert {
  background: #fff9f0;
}

.alert-text {
  padding: 1rem;
  border-radius: 16px;
  background: #fff0de;
  border: 1px solid rgba(239, 134, 55, 0.25);
  color: #c45f00;
  font-weight: 800;
}

.table-header {
  margin-bottom: 0.85rem;
}

.table-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: 0.3rem;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
}

.nutrition-table {
  width: 100%;
  border-collapse: collapse;
}

.nutrition-table th,
.nutrition-table td {
  padding: 0.95rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(92, 59, 49, 0.1);
}

.nutrition-table th {
  background: var(--primary);
  color: #fff;
  font-size: 0.92rem;
}

.nutrition-table thead th:first-child {
  width: 46%;
}

.nutrition-table tbody tr:nth-child(even) {
  background: #fff8ea;
}

.nutrition-table tbody tr:last-child td {
  border-bottom: none;
}

.table-note {
  margin-top: 0.85rem;
  font-size: 0.94rem;
}

#modalServingsPerPackage,
#modalServing {
  display: inline-flex;
  color: var(--text);
  font-weight: 700;
}

#modalServingsPerPackage:empty,
#modalServing:empty {
  display: none;
}

.hidden {
  display: none !important;
}

.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;
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 760px) {
  .shell {
    width: min(calc(100% - 2rem), var(--shell));
  }

  .hero__inner {
    padding-top: 2rem;
    padding-bottom: 2.2rem;
  }

  .hero__logo {
    width: 156px;
  }

  .catalog {
    margin-top: 2rem;
  }

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

  .footer__inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .product-modal__panel {
    width: min(100%, 1040px);
    min-height: auto;
    margin: 1rem auto;
    border-radius: 30px;
    padding: 1.25rem;
  }

  .modal-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-card--full {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
