:root {
  --ink: #183b2d;
  --ink-soft: #496457;
  --cream: #f5f0e4;
  --paper: #fffdf7;
  --green: #1f6a45;
  --green-dark: #174f36;
  --lime: #d8e7a7;
  --gold: #d49c45;
  --line: rgba(24, 59, 45, .13);
  --danger: #a83e32;
  --shadow: 0 18px 50px rgba(29, 67, 47, .14);
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% 0, rgba(216, 231, 167, .55), transparent 32rem),
    var(--cream);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 112px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) 20px 20px;
  border-radius: 0 0 34px 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(244, 239, 221, .95)),
    var(--paper);
  box-shadow: 0 12px 38px rgba(43, 79, 58, .09);
}

.hero::after {
  position: absolute;
  top: -88px;
  right: -98px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(31, 106, 69, .12);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(31, 106, 69, .035),
    0 0 0 68px rgba(31, 106, 69, .025);
  content: "";
}

.hero__eyebrow,
.section-title__kicker {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.hero__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.hero h1 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(43px, 12vw, 66px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .84;
}

.hero h1 em {
  color: var(--green);
  font-weight: 400;
}

.hero p {
  max-width: 390px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.hero__mark {
  display: grid;
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid rgba(31, 106, 69, .17);
  border-radius: 22px 22px 22px 6px;
  background: rgba(216, 231, 167, .52);
  font-size: 30px;
  transform: rotate(4deg);
}

.delivery-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
  padding: 13px;
  border: 1px solid rgba(31, 106, 69, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .68);
  backdrop-filter: blur(10px);
}

.delivery-card__icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--ink);
  font-size: 20px;
}

.delivery-card strong,
.delivery-card small {
  display: block;
}

.delivery-card strong {
  font-size: 13px;
}

.delivery-card small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.delivery-card__badge {
  margin-left: auto;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

main {
  padding: 18px 16px 0;
}

.toolbar {
  position: sticky;
  z-index: 5;
  top: 0;
  margin: 0 -16px;
  padding: 10px 16px 8px;
  background: linear-gradient(var(--cream) 78%, rgba(245, 240, 228, 0));
}

.search {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, .9);
  box-shadow: 0 8px 24px rgba(30, 65, 47, .06);
  backdrop-filter: blur(12px);
}

.search > span {
  margin-right: 9px;
  color: var(--green);
  font-family: Georgia, serif;
  font-size: 25px;
  transform: rotate(-18deg);
}

.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search input::placeholder {
  color: #849188;
}

.search button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
}

.categories {
  display: flex;
  gap: 7px;
  margin: 9px -16px 0;
  padding: 0 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, .85);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}

.category-chip:active {
  transform: scale(.96);
}

.category-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.catalog-section {
  padding-top: 12px;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 2px 14px;
}

.section-title h2,
.sheet__head h2,
.success-screen h2 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.035em;
}

.section-title__count {
  padding-bottom: 4px;
  color: var(--ink-soft);
  font-size: 11px;
}

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

.product-card {
  position: relative;
  display: flex;
  min-height: 172px;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(24, 59, 45, .1);
  border-radius: 21px;
  background: var(--paper);
  box-shadow: 0 7px 22px rgba(29, 66, 47, .055);
  animation: card-in .3s both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.product-card::after {
  position: absolute;
  top: -24px;
  right: -24px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--accent, #eef0d7);
  content: "";
  opacity: .72;
}

.product-card__emoji {
  position: relative;
  z-index: 1;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: var(--accent, #eef0d7);
  font-size: 20px;
}

.product-card__category {
  margin-top: 13px;
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.product-card h3 {
  display: -webkit-box;
  min-height: 35px;
  margin: 5px 0 12px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 670;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
}

.product-card__price strong,
.product-card__price small {
  display: block;
}

.product-card__price strong {
  font-size: 15px;
}

.product-card__price small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
}

.add-button {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: var(--green);
  color: white;
  font-size: 23px;
  box-shadow: 0 7px 15px rgba(31, 106, 69, .2);
  transition: transform .12s ease;
}

.add-button:active {
  transform: scale(.91);
}

.add-button.has-item {
  background: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.show-more,
.secondary-button {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 247, .72);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.empty-state {
  padding: 46px 20px;
  text-align: center;
}

.empty-state > span {
  font-size: 42px;
}

.empty-state h3 {
  margin: 12px 0 5px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 500;
}

.empty-state p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.cart-bar {
  position: fixed;
  z-index: 20;
  right: max(14px, calc((100vw - 732px) / 2));
  bottom: var(--safe-bottom);
  left: max(14px, calc((100vw - 732px) / 2));
  display: grid;
  min-height: 58px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 10px;
  border: 0;
  border-radius: 19px;
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 34px rgba(20, 55, 40, .32);
  font-size: 14px;
  text-align: left;
}

.cart-bar.is-empty {
  display: none;
}

.cart-bar__count {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: var(--lime);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.cart-bar strong {
  font-size: 15px;
}

.sheet-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(12, 38, 27, .38);
  backdrop-filter: blur(4px);
}

.sheet {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 760px);
  max-height: min(88vh, 820px);
  margin: auto;
  padding: 10px 18px calc(var(--safe-bottom) + 4px);
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateY(105%);
  transition: transform .25s cubic-bezier(.22, .7, .24, 1);
}

.sheet.is-open {
  transform: translateY(0);
}

.sheet__handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 4px;
  background: rgba(24, 59, 45, .18);
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 24px;
}

.cart-items {
  display: grid;
  gap: 8px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.cart-item h3 {
  margin: 0 0 5px;
  font-size: 12px;
}

.cart-item__price {
  color: var(--ink-soft);
  font-size: 11px;
}

.quantity {
  display: grid;
  grid-template-columns: 30px minmax(40px, auto) 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.quantity button {
  height: 32px;
  border: 0;
  background: var(--cream);
  color: var(--green);
  font-size: 18px;
}

.quantity span {
  padding: 0 7px;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.cart-summary,
.checkout-total {
  display: grid;
  gap: 8px;
  margin: 15px 0;
  padding: 14px;
  border-radius: 16px;
  background: var(--cream);
  font-size: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
}

.summary-row--total {
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 800;
}

.summary-note {
  color: var(--green);
  font-size: 11px;
  line-height: 1.4;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 17px;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(31, 106, 69, .22);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: .48;
  box-shadow: none;
}

.sheet--checkout {
  max-height: 94vh;
}

.field {
  display: block;
  margin-bottom: 13px;
}

.field > span,
.payment-field legend {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.field small {
  color: var(--ink-soft);
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

.field input {
  height: 48px;
  padding: 0 13px;
}

.field textarea {
  min-height: 66px;
  padding: 12px 13px;
  resize: none;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 106, 69, .08);
}

.payment-field {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 13px;
  padding: 0;
  border: 0;
}

.payment-field legend {
  grid-column: 1 / -1;
}

.payment-field label {
  position: relative;
}

.payment-field input {
  position: absolute;
  opacity: 0;
}

.payment-field span {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.payment-field input:checked + span {
  border-color: var(--green);
  background: rgba(216, 231, 167, .45);
  color: var(--green-dark);
}

.consent {
  margin: 0 8px 12px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

.success-screen {
  position: fixed;
  z-index: 80;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 32%, rgba(216, 231, 167, .9), transparent 17rem),
    var(--cream);
  text-align: center;
}

.success-screen:not([hidden]) {
  display: flex;
}

.success-screen__icon {
  display: grid;
  width: 82px;
  height: 82px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 28px 28px 28px 8px;
  background: var(--green);
  color: white;
  font-family: Georgia, serif;
  font-size: 42px;
  box-shadow: 0 16px 35px rgba(31, 106, 69, .25);
  transform: rotate(-4deg);
}

.success-screen h2 {
  margin-top: 8px;
  font-size: 38px;
}

.success-screen p {
  max-width: 330px;
  margin: 10px 0 28px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.success-screen .primary-button {
  max-width: 330px;
}

.toast {
  position: fixed;
  z-index: 100;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  max-width: calc(100vw - 30px);
  padding: 11px 15px;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: var(--danger);
}

.loader {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 12px;
  transition: opacity .25s ease;
}

.loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loader__leaf {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 22px 22px 22px 6px;
  background: var(--lime);
  font-size: 29px;
  animation: breathe 1.2s ease-in-out infinite alternate;
}

@keyframes breathe {
  to {
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 12px 26px rgba(31, 106, 69, .15);
  }
}

@media (min-width: 620px) {
  .hero,
  main {
    padding-right: 28px;
    padding-left: 28px;
  }

  .toolbar {
    margin-right: -28px;
    margin-left: -28px;
    padding-right: 28px;
    padding-left: 28px;
  }

  .categories {
    margin-right: -28px;
    margin-left: -28px;
    padding-right: 28px;
    padding-left: 28px;
  }

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

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