:root {
  color-scheme: light;
  font-family: Manrope, Arial, sans-serif;
  background: #f7f1e7;
  color: #3b3b3c;
  line-height: 1.6;
  --paper: #f7f1e7;
  --grain: #eee2cb;
  --ink: #3b3b3c;
  --oven: #8b3a2b;
  --stone: #c6baa5;
}

body {
  margin: 0;
}

.public-header,
.public-footer {
  box-sizing: border-box;
  max-width: 76rem;
  margin-inline: auto;
  padding: 1.25rem min(6vw, 4rem);
  overflow-wrap: anywhere;
}

.public-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem 1rem;
  border-bottom: 1px solid var(--stone);
}

.public-header nav {
  justify-self: end;
}

.account-entry {
  display: contents;
}

.account-entry > button {
  grid-column: 3;
  justify-self: end;
  align-self: center;
}

.account-entry > p,
.account-entry > noscript {
  grid-column: 1 / -1;
  margin-block: 0.25rem;
}

.account-entry > .registration-dialog {
  grid-column: 1 / -1;
}


.public-wordmark {
  display: flex !important;
  align-items: center;
  gap: 0.85rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  text-decoration: none;
}

.public-header nav,
.public-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.public-header a,
.public-footer a {
  color: var(--ink);
  display: inline-block;
  padding-block: 0.5rem;
  min-height: 2.75rem;
  box-sizing: border-box;
  text-underline-offset: 0.2em;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-150%);
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.75rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 2;
}

.skip-link:focus {
  transform: none;
}

.public-header :focus-visible,
.public-footer :focus-visible,
.skip-link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

main {
  box-sizing: border-box;
  max-width: 76rem;
  margin-inline: auto;
  padding: 1.25rem min(6vw, 4rem) 4rem;
  overflow-wrap: anywhere;
}

main h1,
main h2,
.product-grid h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.025em;
}

main h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
}

main h2 {
  font-size: 1.75rem;
}

.product-grid h3 {
  font-size: 1.5rem;
  line-height: 1.2;
  margin-block: 1rem 0.5rem;
}

main nav {
  border-block: 1px solid var(--stone);
  padding-block: 0.5rem;
}

main nav a {
  text-decoration: none;
  padding: 0.5rem 0.25rem;
  min-height: 2.75rem;
  box-sizing: border-box;
}

main form {
  padding: 1rem;
  border: 1px solid #e5d9c8;
  border-radius: 14px;
  background: #fff;
  display: grid;
  gap: 0.75rem;
  margin-block: 1rem;
}

main form .field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
  min-width: 0;
}

main form .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  main form {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto;
    align-items: end;
  }
}

main form input#catalog-search {
  flex: 1 1 14rem;
}

[role='group'] button {
  border-radius: 999px;
  padding-inline: 1rem;
}

[role='group'] button[aria-pressed='true'] {
  background: var(--oven);
  border-color: var(--oven);
  color: #fff;
}

main nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-block: 1rem;
}

main input:not([type="checkbox"]):not([type="radio"]),
main textarea,
main select,
main button,
.account-entry input:not([type="checkbox"]),
.account-entry button {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 2.75rem;
  font: inherit;
  border: 1px solid var(--stone);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: #fff;
  color: var(--ink);
}

main button,
.account-entry button {
  cursor: pointer;
  overflow-wrap: anywhere;
  white-space: normal;
}

main button[type="submit"],
main button[aria-pressed="true"],
.account-entry button[type="submit"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

[aria-label="Вигляд каталогу"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

main a,
.account-entry a {
  color: var(--ink);
  text-underline-offset: 0.2em;
}

main :focus-visible,
.account-entry :focus-visible {
  outline: 2px solid var(--oven);
  outline-offset: 0;
}

/* Public forms share the catalogue's tokens, but not its horizontal toolbar. */
.account-entry {
  display: contents;
}

.account-entry > button {
  justify-self: end;
}

.account-entry p:empty {
  display: none;
}

.registration-dialog {
  box-sizing: border-box;
  justify-self: center;
  width: min(100%, 36rem);
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--stone);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(59, 59, 60, 0.16);
}

.registration-dialog h2 {
  margin-top: 0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
}

.registration-dialog form,
.public-form,
.cake-order-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  max-width: 36rem;
  margin-block: 1rem;
}

.public-form-section > p {
  max-width: 65ch;
}

.public-form > input,
.public-form > textarea,
.cake-order-fields > input,
.registration-dialog input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  margin-bottom: 0.75rem;
}

.registration-dialog .consent-choice,
.cake-order-section > label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding-block: 0.5rem;
  box-sizing: border-box;
}

.consent-choice input,
.cake-order-section input[type="radio"] {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.2rem 0 0;
  accent-color: var(--oven);
}

.rights-section > label,
.rights-section > textarea {
  display: block;
  width: min(100%, 36rem);
  margin-bottom: 0.75rem;
}

main textarea {
  resize: vertical;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.product-overview {
  display: grid;
  gap: 2rem;
}

@media (max-width: 640px) {
  .product-overview {
    gap: 0.75rem;
  }

  .product-detail figure {
    margin-bottom: 0.5rem;
  }
}

.product-gallery,
.product-facts {
  min-width: 0;
}

.product-facts {
  max-width: 65ch;
}

.product-facts > :first-child {
  margin-top: 0;
}

.product-facts > a {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
}

.product-detail figure {
  margin: 0 0 1rem;
  max-width: 50rem;
}

@media (min-width: 960px) {
  .product-overview:not(.no-photo) {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}

.product-grid img,
.product-detail img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.product-primary-action {
  margin-block: 1rem 0.5rem;
}

.product-primary-action a {
  display: inline-block;
  min-height: 2.75rem;
  box-sizing: border-box;
  padding: 0.7rem 1.25rem;
  background: var(--oven);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
}

.home-introduction {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: stretch;
  gap: 1.5rem;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  margin-bottom: 2rem;
  background: #f5e3cc;
  border-radius: 20px;
}

.home-introduction h1 { max-width: 20ch; font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin: 0.2rem 0 0.75rem; }
.home-introduction > img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; border-radius: 14px; }
main > img.page-decoration { display: block; width: min(240px, 60%); height: auto; margin-block: 1.25rem; }
.home-lede { max-width: 52ch; }
.home-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1rem; }
.home-actions a { min-height: 44px; box-sizing: border-box; padding-block: 0.75rem; }
.home-actions .primary-link { background: var(--oven); color: #fff; padding-inline: 1.25rem; border-radius: 8px; text-decoration: none; }

.home-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding: clamp(1rem, 3vw, 2rem);
  background: #f5e3cc;
  border-radius: 20px;
}

.home-facts h2 { font-size: 1.35rem; margin: 0 0 0.5rem; }
.home-facts p { margin-block: 0.35rem; }

@media (max-width: 640px) {
  .home-introduction { grid-template-columns: minmax(0, 1fr); }
  .home-introduction > img { min-height: 0; max-height: 220px; }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 2.5rem 1.5rem;
  list-style: none;
  padding: 0;
}

.catalog-list .product-grid {
  grid-template-columns: 1fr;
}

.product-grid article {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #e5d9c8;
  border-radius: 16px;
  background: #fffcf7;
}

.public-wordmark img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.public-header nav a {
  text-decoration: none;
  border-radius: 6px;
  padding-inline: 0.65rem;
}

.public-header nav a:hover {
  background: var(--grain);
}

.public-form-section {
  margin-block: 2rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #e5d9c8;
  border-radius: 16px;
  background: #fffcf7;
}

.public-form-section h2:first-child {
  margin-top: 0;
}

.public-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.5rem 2rem;
  margin-top: 2rem;
  padding-block: 2.5rem;
  border-top: 1px solid var(--stone);
}

.public-footer p { margin-block: 0.35rem; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-family: 'Source Serif 4', Georgia, serif; font-size: 1.25rem; }
.footer-brand img { width: 44px; height: auto; }
.footer-heading { font-weight: 700; }
.public-footer ul { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.25rem; }

@media (max-width: 480px) {
  .public-wordmark img { width: 56px; height: 56px; }
  .public-header { gap: 0.5rem; }
  .public-header nav { gap: 0.25rem; }
}

.product-grid img {
  aspect-ratio: 4 / 3;
  background: #f5eddf;
  border-radius: 10px;
}

.photo-pending {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: #f5eddf;
  border-radius: 10px;
  color: #8a8175;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.1rem;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 1rem;
}

.category-chips button {
  min-height: 2.75rem;
  padding-inline: 1rem;
  border-radius: 999px;
  background: #fff;
}

.category-chips button[aria-pressed='true'] {
  background: var(--oven);
  border-color: var(--oven);
  color: #fff;
}

.product-grid p {
  margin-block: 0.5rem;
}

.product-grid article > a,
.product-grid p a {
  display: inline-block;
  min-height: 2.75rem;
  padding-block: 0.5rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .catalog-list article {
    display: grid;
    grid-template-columns: minmax(10rem, 16rem) 1fr;
    column-gap: 1.5rem;
    border-bottom: 1px solid var(--stone);
    padding-bottom: 1.5rem;
  }

  .catalog-list article > img {
    grid-row: span 6;
  }
}

.site-shell {
  box-sizing: border-box;
  display: grid;
  min-height: 100vh;
  padding: clamp(2rem, 7vw, 6rem);
  gap: 3rem;
}

.hero,
.promise {
  max-width: 56rem;
}

.eyebrow {
  color: #8c4f25;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 0.98;
  margin: 0.3rem 0 1.25rem;
}

.lede,
.promise p {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.6;
}

footer {
  align-self: end;
  border-top: 1px solid #c9ad90;
  padding-top: 1rem;
}

/* Narrow screens: brand and login share one row, menu scrolls sideways. */
@media (max-width: 560px) {
  .public-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .public-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .public-header nav a {
    padding-inline: 0.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .public-wordmark {
    min-width: 0;
    flex-wrap: wrap;
  }

  .public-wordmark span {
    min-width: 0;
    white-space: normal;
    font-size: 1.15rem;
  }

  .public-wordmark img {
    width: 44px;
    height: 44px;
  }

  .account-entry > button {
    grid-column: 2;
    grid-row: 1;
  }
}

.pickup-map {
  position: relative;
  min-height: 14rem;
  max-width: 42rem;
  margin-block: 1rem;
  border: 1px solid var(--border-color, #b8b8b8);
  border-radius: 0.75rem;
  background: linear-gradient(145deg, #eef4e8, #f8f3e8);
  overflow: hidden;
}

.pickup-map::before {
  content: "Оглядова схема України — точні адреси наведені списком нижче";
  position: absolute;
  inset: 0.75rem auto auto 0.75rem;
  max-width: 75%;
  color: #3f4b3a;
  font-size: 0.875rem;
}

.pickup-map-point {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #9b2c2c;
  font-size: 1.5rem;
  line-height: 1;
}
