:root {
  --red: #c9151e;
  --red-dark: #8f0d14;
  --yellow: #f4c316;
  --ink: #241b18;
  --muted: #756864;
  --paper: #fffdf8;
  --cream: #f7efe3;
  --line: #e8dccc;
  --green: #1f6b43;
  --shadow: 0 14px 38px rgba(77, 34, 20, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.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; }

.app-header {
  height: 68px;
  padding: 7px 15px;
  padding-top: max(7px, env(safe-area-inset-top));
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 55px 1fr 44px;
  gap: 10px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand img { width: 55px; height: 48px; object-fit: contain; display: block; }
.header-copy { display: grid; line-height: 1.15; }
.header-copy strong { font: 900 1.05rem Georgia, serif; }
.header-copy span { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; }
.cart-shortcut { width: 42px; height: 42px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center; position: relative; text-decoration: none; }
.cart-shortcut b { min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: var(--red); color: #fff; display: grid; place-items: center; position: absolute; top: -3px; right: -3px; font-size: .64rem; }
.bag-icon { width: 17px; height: 15px; border: 2px solid currentColor; border-radius: 3px; display: block; position: relative; }
.bag-icon::before { content: ""; width: 7px; height: 5px; border: 2px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; position: absolute; left: 3px; top: -7px; }

.app-shell { min-height: calc(100vh - 68px); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.app-screen { animation: screen-in .2s ease-out; }
@keyframes screen-in { from { opacity: .4; transform: translateY(5px); } }

.hero {
  min-height: 310px;
  padding: 30px 20px 24px;
  background:
    radial-gradient(circle at 88% 20%, rgba(255,255,255,.38), transparent 24%),
    var(--yellow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px;
  gap: 12px;
  align-items: center;
  overflow: hidden;
}
.hero h1 { margin: 0; font: 900 clamp(2.5rem, 12vw, 4.4rem)/.91 Georgia, serif; letter-spacing: -.055em; }
.hero h1 em { color: var(--red); font-style: normal; }
.hero p:not(.kicker) { max-width: 430px; margin: 16px 0 20px; font-size: .9rem; }
.hero img { width: 145px; max-width: none; padding: 8px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); transform: rotate(3deg) translateX(5px); }
.kicker { margin: 0 0 7px; color: var(--red); font-size: .65rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.primary-action, .dark-action {
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 9px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 9px 22px rgba(143,13,20,.2);
}
.dark-action { background: var(--ink); box-shadow: none; }
.full-width { width: 100%; }
.service-strip { padding: 13px 16px; background: var(--red); color: #fff; display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; text-align: center; font-size: .63rem; }
.service-strip span { display: grid; }
.service-strip b { color: var(--yellow); font-size: .73rem; }

.catalog-section { padding: 28px 14px 40px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.section-title h2 { margin: 0; font: 900 1.8rem/1 Georgia, serif; }
.section-title > p { max-width: 115px; margin: 0; color: var(--muted); font-size: .6rem; text-align: right; }
.search-box { height: 47px; margin: 19px 0 12px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center; gap: 9px; box-shadow: 0 7px 22px rgba(70,35,20,.05); }
.search-box span:first-child { font-size: 1.35rem; transform: rotate(-20deg); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.category-filters { margin: 0 -14px; padding: 2px 14px 12px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.category-filters::-webkit-scrollbar { display: none; }
.category-filters button { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: .72rem; font-weight: 800; }
.category-filters button.active { border-color: var(--red); background: var(--red); color: #fff; }
.preview-notice { margin: 4px 0 16px; padding: 9px 11px; border-radius: 8px; background: #fff5c9; color: #645000; font-size: .68rem; }
.preview-notice.error { background: #fdeaea; color: #7b2020; }
.catalogue { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.product { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.product-image { height: 132px; background: linear-gradient(145deg,#ffe36b,#fff2b5); display: grid; place-items: center; overflow: hidden; color: var(--red-dark); font: 900 2.7rem Georgia, serif; }
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { min-width: 0; padding: 11px; display: flex; flex: 1; flex-direction: column; gap: 6px; }
.product p, .product h3 { margin: 0; }
.product .code { color: var(--muted); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product h3 { min-height: 2.25em; font: 800 .94rem/1.12 Georgia, serif; }
.product .price { margin-top: auto; color: var(--red); font-size: 1.08rem; font-weight: 900; }
.product .stock { color: var(--muted); font-size: .61rem; }
.product button { width: 100%; min-height: 39px; margin-top: 3px; border: 0; border-radius: 7px; background: var(--ink); color: #fff; cursor: pointer; font-size: .72rem; font-weight: 900; }
.product button:disabled { background: #b9b0a9; }
.empty-state { grid-column: 1/-1; color: var(--muted); text-align: center; }

.screen-heading { min-height: 112px; padding: 24px 16px 18px; background: var(--yellow); display: flex; align-items: center; gap: 13px; }
.screen-heading h1 { margin: 0; font: 900 2rem/1 Georgia, serif; }
.back-button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; font-size: 2rem; line-height: 1; }
.cart-layout { padding: 16px 14px 36px; display: grid; gap: 15px; }
.cart-panel, .checkout-panel, .tracking-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(70,35,20,.06); }
.cart-summary { padding-bottom: 11px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.cart-summary button { border: 0; background: none; color: var(--red); cursor: pointer; font-weight: 900; }
.cart-line { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 64px 1fr auto; gap: 11px; align-items: center; }
.cart-thumb { width: 64px; height: 64px; border-radius: 9px; background: var(--yellow); display: grid; place-items: center; overflow: hidden; color: var(--red-dark); font: 900 1.5rem Georgia,serif; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line p { margin: 0; }
.cart-line .muted { color: var(--muted); font-size: .72rem; }
.cart-line button { border: 0; background: none; color: var(--red); cursor: pointer; font-size: .7rem; font-weight: 900; }
.cart-total { padding: 18px 0 4px; display: flex; justify-content: space-between; font-size: 1.15rem; }
.charge-summary { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.charge-summary > p { display: flex; justify-content: space-between; gap: 16px; margin: 8px 0; }
.checkout-panel { background: var(--cream); }
.checkout-panel h2 { margin: 0; font: 900 1.45rem Georgia,serif; }
.checkout-panel label, .tracking-card label { display: block; margin: 13px 0; font-size: .72rem; font-weight: 900; }
.checkout-panel input, .checkout-panel textarea, .checkout-panel select, .tracking-card input { width: 100%; min-height: 44px; margin-top: 5px; padding: 10px; border: 1px solid #d8caba; border-radius: 8px; background: #fff; }
.checkout-panel textarea { min-height: 78px; resize: vertical; }
.payment-options { display: grid; gap: 10px; margin: 10px 0; padding: 0; border: 0; }
.payment-options legend { margin-bottom: 8px; font-weight: 900; }
.payment-choice { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fffaf0; cursor: pointer; }
.payment-choice input { width: auto; min-height: auto; margin: 3px 0 0; accent-color: var(--red); }
.payment-choice span { display: grid; gap: 3px; }
.verification-panel { padding: 14px; border: 1px solid #f1c768; border-radius: 14px; background: #fff8dc; }
.verification-panel > p { margin: 0 0 12px; }
.verification-actions { display: grid; gap: 10px; }
.secondary-action { min-height: 44px; padding: 10px 14px; border: 1px solid var(--red); border-radius: 12px; background: white; color: var(--red); font-weight: 900; }
.checkout-note { color: var(--muted); font-size: .66rem; text-align: center; }
.tracking-card { margin: 18px 14px; }
.tracking-card > p { margin-top: 0; color: var(--muted); font-size: .82rem; }
.tracking-card .dark-action { width: 100%; }
.success, .error { margin-top: 14px; padding: 12px; border-radius: 9px; font-size: .8rem; }
.success { background: #e8f4ec; color: #174c31; }
.error { background: #fdeaea; color: #7b2020; }

.bottom-nav { height: calc(64px + env(safe-area-inset-bottom)); padding: 7px 20px max(7px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3,1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; box-shadow: 0 -8px 25px rgba(55,25,15,.08); }
.bottom-nav a { color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; position: relative; text-decoration: none; font-size: .61rem; }
.bottom-nav a.active { color: var(--red); }
.bottom-nav b { font-weight: 900; }
.nav-icon { width: 19px; height: 19px; display: block; position: relative; }
.home-icon::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-top: 0; position: absolute; left: 2px; bottom: 0; }
.home-icon::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right: 0; border-bottom: 0; transform: rotate(45deg); position: absolute; left: 3px; top: 0; }
.track-icon { border: 2px solid currentColor; border-radius: 50%; }
.track-icon::before { content: ""; width: 2px; height: 6px; background: currentColor; position: absolute; left: 7px; top: 3px; }
.track-icon::after { content: ""; width: 5px; height: 2px; background: currentColor; position: absolute; left: 7px; top: 8px; transform: rotate(28deg); transform-origin: left; }
.bottom-nav i { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; display: grid; place-items: center; position: absolute; top: 0; left: calc(50% + 7px); font-size: .56rem; font-style: normal; }

@media (min-width: 720px) {
  .app-header { height: 82px; padding-left: max(24px,calc((100vw - 1120px)/2)); padding-right: max(24px,calc((100vw - 1120px)/2)); grid-template-columns: 70px 1fr 50px; }
  .brand img { width: 68px; height: 60px; }
  .header-copy strong { font-size: 1.3rem; }
  .hero { min-height: 430px; padding: 55px max(32px,calc((100vw - 1120px)/2)); grid-template-columns: 1fr 310px; }
  .hero h1 { font-size: 4.8rem; }
  .hero p:not(.kicker) { font-size: 1.05rem; }
  .hero img { width: 300px; justify-self: end; }
  .service-strip { padding: 17px; font-size: .78rem; }
  .service-strip span { display: block; }
  .service-strip b { margin-right: 4px; font-size: inherit; }
  .catalog-section, .cart-layout { max-width: 1120px; margin: auto; }
  .catalog-section { padding: 48px 24px 80px; }
  .section-title h2 { font-size: 2.5rem; }
  .catalogue { grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 16px; }
  .product-image { height: 170px; }
  .screen-heading { padding-left: max(24px,calc((100vw - 1120px)/2)); }
  .cart-layout { padding: 28px 24px 80px; grid-template-columns: 1fr 380px; align-items: start; }
  .tracking-card { max-width: 660px; margin: 32px auto; }
  .bottom-nav { width: 390px; left: 50%; right: auto; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; }
}
