:root {
  --heritage-ink: #202a2d;
  --heritage-cream: #f4e9d5;
  --heritage-paper: #efe1c8;
  --heritage-terra: #c97852;
  --heritage-teal: #146e78;
  --heritage-line: rgba(32, 42, 45, .72);
}

html { background: var(--heritage-ink); }
body {
  background: #d9cbb5;
  color: var(--heritage-ink);
}
button, input { font-family: Manrope, Arial, sans-serif; }
button { -webkit-tap-highlight-color: transparent; }

body.home-active .app-shell {
  padding: 0;
  background: var(--heritage-cream);
}
body.home-active .bottom-nav { display: none; }

.heritage-home {
  position: relative;
  width: 100%;
  min-height: max(100dvh, 780px);
  overflow: hidden;
  isolation: isolate;
  background-color: var(--heritage-cream);
  background-image: url("assets/sant-avenue-hero-art.png");
  background-position: center calc(50% - 10px);
  background-repeat: no-repeat;
  background-size: cover;
}

.heritage-home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border: 10px solid rgba(244, 233, 213, .33);
}

.heritage-header {
  position: absolute;
  z-index: 3;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  height: 59px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  border: 1px solid var(--heritage-ink);
  box-shadow: inset 0 0 0 3px var(--heritage-cream), inset 0 0 0 4px var(--heritage-ink);
  background: rgba(244, 233, 213, .86);
}

.heritage-wordmark {
  color: var(--heritage-ink);
  font: 400 18px/1 Prata, "Playfair Display", Georgia, serif;
  letter-spacing: .11em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.heritage-icon-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--heritage-ink);
  cursor: pointer;
  font-size: 25px;
}

.heritage-cart-button { position: relative; }
.heritage-cart-button b {
  position: absolute;
  top: 7px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 1px solid var(--heritage-ink);
  border-radius: 50%;
  background: var(--heritage-terra);
  color: var(--heritage-ink);
  font: 700 8px/1 Manrope, sans-serif;
}
.heritage-cart-button b[hidden] { display: none; }

.heritage-copy {
  position: absolute;
  z-index: 2;
  top: 29%;
  left: 29px;
  width: calc(100% - 58px);
}

.heritage-kicker,
.menu-kicker {
  margin: 0 0 28px;
  color: var(--heritage-ink);
  font: 600 8px/1.35 "DM Mono", monospace;
  letter-spacing: .18em;
}

.heritage-kicker {
  width: 216px;
  line-height: 1.65;
}
.heritage-kicker::after {
  content: "";
  display: block;
  width: 37px;
  margin-top: 16px;
  border-bottom: 2px solid var(--heritage-terra);
}

.heritage-copy h1 {
  max-width: 350px;
  margin: 0;
  color: var(--heritage-ink);
  font: 400 clamp(32px, 9.2vw, 40px)/1.12 Prata, "Playfair Display", Georgia, serif;
  letter-spacing: -.035em;
}

.heritage-intro {
  max-width: 255px;
  margin: 18px 0 0;
  color: var(--heritage-ink);
  font: 500 13px/1.55 Manrope, sans-serif;
}

.heritage-actions {
  width: min(257px, 84%);
  margin-top: 28px;
  display: grid;
  gap: 11px;
}

.heritage-primary,
.heritage-secondary,
.menu-install {
  width: 100%;
  min-height: 47px;
  border: 1px solid var(--heritage-ink);
  border-radius: 0;
  padding: 12px 15px;
  font: 600 10px/1.25 Manrope, sans-serif;
  letter-spacing: .28em;
  cursor: pointer;
}

.heritage-primary {
  background: var(--heritage-ink);
  color: var(--heritage-cream);
}
.heritage-secondary {
  background: rgba(244, 233, 213, .8);
  color: var(--heritage-ink);
}

.heritage-footer-nav {
  position: absolute;
  z-index: 3;
  left: 15px;
  right: 15px;
  bottom: max(14px, env(safe-area-inset-bottom));
  height: 43px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--heritage-ink);
  border-bottom: 1px solid var(--heritage-ink);
  background: rgba(244, 233, 213, .66);
}

.heritage-footer-nav button {
  border: 0;
  border-right: 1px solid var(--heritage-ink);
  border-radius: 0;
  background: transparent;
  color: var(--heritage-ink);
  font: 600 8px/1 "DM Mono", monospace;
  letter-spacing: .18em;
  cursor: pointer;
}
.heritage-footer-nav button:last-child { border-right: 0; }

/* The remaining store screens keep their working structure in the new brand system. */
body:not(.home-active) .app-shell {
  background: var(--heritage-cream);
}
body:not(.home-active) .topbar {
  border-bottom: 1px solid var(--heritage-line);
}
body:not(.home-active) .wordmark {
  color: var(--heritage-ink);
  font-family: Prata, "Playfair Display", serif;
  font-style: normal;
  letter-spacing: .09em;
}
body:not(.home-active) .wordmark i { color: var(--heritage-ink); font-style: normal; }
body:not(.home-active) .profile-dot {
  border: 1px solid var(--heritage-ink);
  border-radius: 0;
  background: transparent;
  color: var(--heritage-ink);
}
body:not(.home-active) .eyebrow { color: var(--heritage-teal); }
body:not(.home-active) .section-heading h2,
body:not(.home-active) .reward-list h3,
body:not(.home-active) .reminder-list h3,
body:not(.home-active) .profile-header h2,
body:not(.home-active) .subscription h3 {
  color: var(--heritage-ink);
  font-family: Prata, "Playfair Display", serif;
  letter-spacing: -.04em;
}
body:not(.home-active) .section-heading em,
body:not(.home-active) .subscription h3 em { color: var(--heritage-terra); }
body:not(.home-active) .filters { gap: 0; }
body:not(.home-active) .filter {
  border-color: var(--heritage-ink);
  border-radius: 0;
  background: transparent;
  color: var(--heritage-ink);
}
body:not(.home-active) .filter + .filter { border-left: 0; }
body:not(.home-active) .filter.active {
  background: var(--heritage-ink);
  color: var(--heritage-cream);
}
body:not(.home-active) .product-card .add-to-bag,
body:not(.home-active) .checkout-button,
body:not(.home-active) .outline-button {
  border: 1px solid var(--heritage-ink);
  border-radius: 0;
  background: var(--heritage-ink);
  color: var(--heritage-cream);
}
body:not(.home-active) .stock { color: var(--heritage-teal); }
body:not(.home-active) .stock.out { color: var(--heritage-terra); }
body:not(.home-active) .bonus-card {
  border: 1px solid var(--heritage-ink);
  border-radius: 0;
  background: var(--heritage-teal);
}
body:not(.home-active) .reminder-feature,
body:not(.home-active) .subscription { background: #eadbc2; }
body:not(.home-active) .profile-header > div {
  border-radius: 0;
  background: var(--heritage-terra);
}
body:not(.home-active) .toggle-row input:checked + i { background: var(--heritage-teal); }

.bottom-nav {
  border-top-color: var(--heritage-ink);
  background: rgba(244, 233, 213, .97);
  backdrop-filter: none;
}
.nav-link {
  color: rgba(32, 42, 45, .62);
  font-size: 8px;
}
.nav-link i { font-size: 20px; line-height: 1; }
.nav-link.active { color: var(--heritage-teal); }

.menu-dialog,
.info-dialog {
  width: min(480px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  padding: max(22px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: var(--heritage-cream);
  color: var(--heritage-ink);
}
.menu-dialog::backdrop,
.info-dialog::backdrop,
.assistant-dialog::backdrop,
.cart-dialog::backdrop { background: rgba(18, 28, 30, .78); }
.menu-dialog[open], .info-dialog[open] { animation: menuIn .24s ease both; }
@keyframes menuIn { from { opacity: 0; transform: translateX(-20px); } }
.menu-head,
.info-head {
  height: 68px;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  border: 1px solid var(--heritage-ink);
  box-shadow: inset 0 0 0 3px var(--heritage-cream), inset 0 0 0 4px var(--heritage-ink);
}
.menu-head .heritage-wordmark,
.info-head .heritage-wordmark { grid-column: 2; margin: 0; }
.menu-head .heritage-icon-button,
.info-head .heritage-icon-button { grid-column: 3; }
.menu-kicker { margin: 36px 0 18px; color: var(--heritage-terra); }
.menu-links { border-top: 1px solid var(--heritage-ink); }
.menu-links button,
.menu-links a {
  width: 100%;
  min-height: 57px;
  display: grid;
  grid-template-columns: 37px 1fr;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--heritage-ink);
  border-radius: 0;
  background: transparent;
  color: var(--heritage-ink);
  text-align: left;
  text-decoration: none;
  font: 400 21px/1 Prata, "Playfair Display", serif;
  cursor: pointer;
}
.menu-links span { color: var(--heritage-teal); font: 500 8px/1 "DM Mono", monospace; }
.menu-install {
  margin-top: 25px;
  background: var(--heritage-ink);
  color: var(--heritage-cream);
}
.menu-install i { margin-right: 8px; font-size: 17px; vertical-align: -3px; }

.info-dialog h2 {
  margin: 38px 0 20px;
  color: var(--heritage-ink);
  font: 400 40px/1.04 Prata, "Playfair Display", serif;
  letter-spacing: -.04em;
}
.info-dialog #infoText {
  margin: 0 0 34px;
  color: rgba(32, 42, 45, .8);
  font: 500 13px/1.75 Manrope, sans-serif;
}

.assistant-dialog,
.cart-dialog {
  background: var(--heritage-cream);
  color: var(--heritage-ink);
}
.assistant-head,
.cart-head,
.assistant-form { border-color: var(--heritage-ink); }
.assistant-head h2,
.cart-head h2,
.cart-items b,
.cart-total b { font-family: Prata, "Playfair Display", serif; }
.assistant-head > span {
  border-radius: 0;
  background: var(--heritage-terra);
  color: var(--heritage-ink);
}
.close-dialog { color: var(--heritage-ink); }
.assistant-answer { border-radius: 0; background: #eadbc2; }
.client-question { border-radius: 0; background: var(--heritage-teal); }
.assistant-form input {
  border-color: var(--heritage-ink);
  border-radius: 0;
  background: rgba(255, 255, 255, .38);
}
.assistant-form button,
.quantity button {
  border-radius: 0;
  background: var(--heritage-ink);
  color: var(--heritage-cream);
}
.cart-items article,
.cart-total { border-color: var(--heritage-ink); }

.product-photo-placeholder {
  display: grid;
  place-items: center;
  background: #e7d7bc;
}
.product-photo-placeholder img {
  width: 66%;
  height: 66%;
  object-fit: contain;
}

.toast {
  border: 1px solid var(--heritage-cream);
  border-radius: 0;
  background: var(--heritage-ink);
  color: var(--heritage-cream);
}

@media (max-height: 720px) {
  .heritage-copy { top: 20%; }
  .heritage-actions { margin-top: 18px; }
  .heritage-footer-nav { bottom: 12px; }
}

@media (min-width: 560px) {
  body { padding: 18px; }
  body.home-active .app-shell { min-height: calc(100dvh - 36px); border-radius: 0; }
  .heritage-home { min-height: calc(100dvh - 36px); }
  .menu-dialog,
  .info-dialog { height: calc(100dvh - 36px); margin: 18px auto; }
}

@media (min-width: 560px) and (max-height: 720px) {
  body { padding: 12px; }
  body.home-active .app-shell { min-height: calc(100dvh - 24px); }
  .heritage-home {
    min-height: calc(100dvh - 24px);
    background-color: #f4e5cc;
    background-image: url("assets/sant-avenue-hero-art.png"), url("assets/sant-avenue-paper-v2.png");
    background-size: auto 100%, 520px 520px;
    background-position: right center, center;
    background-repeat: no-repeat, repeat;
  }
  .heritage-copy {
    top: 18.5%;
    left: 28px;
    width: 66%;
  }
  .heritage-kicker {
    width: 210px;
    margin-bottom: 17px;
    font-size: 7px;
  }
  .heritage-kicker::after { margin-top: 10px; }
  .heritage-copy h1 { font-size: 34px; line-height: 1.08; }
  .heritage-intro { width: 220px; margin-top: 12px; font-size: 11px; }
  .heritage-actions { width: 228px; gap: 8px; margin-top: 16px; }
  .heritage-primary,
  .heritage-secondary { min-height: 40px; padding: 9px 12px; font-size: 8px; }
  .heritage-footer-nav { bottom: 8px; height: 38px; }
}

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