:root {
  --ink: #151922;
  --muted: #637083;
  --line: #dfe5ec;
  --paper: #fbfcfe;
  --panel: #ffffff;
  --brand: #b8202b;
  --brand-dark: #821923;
  --blue: #174d8f;
  --leaf: #167761;
  --gold: #f2c94c;
  --focus: #2563eb;
  --shadow: 0 18px 48px rgba(21, 25, 34, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, #fbfcfe 260px),
    var(--paper);
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.order-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark img {
  width: 112px;
  height: 64px;
  object-fit: contain;
}

.brand-mark strong,
.brand-mark span {
  display: block;
}

.brand-mark strong {
  font-size: 22px;
  line-height: 1.1;
}

.brand-mark span {
  color: var(--muted);
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.cart-pill,
.text-btn,
.qty-btn,
.primary-btn,
.product-add,
.modal-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.icon-btn {
  width: 52px;
  height: 46px;
  font-weight: 800;
}

.icon-btn.is-active {
  border-color: var(--brand);
  color: var(--brand);
}

.cart-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  font-weight: 900;
}

.cart-pill span:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
}

.site-main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(540px, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(184, 32, 43, 0.08), rgba(23, 77, 143, 0.08)),
    #fff;
}

.hero-copy {
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.hero-copy img {
  width: 168px;
  height: 96px;
  flex: 0 0 auto;
  object-fit: contain;
}

.kicker {
  margin: 0 0 5px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-media {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 8px;
  overflow: hidden;
  border: 1px dashed #cbd6df;
  border-radius: 8px;
  background: #fff;
}

.hero-media-placeholder {
  width: 100%;
  height: 100%;
  min-height: 210px;
}

.hero-media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.hero-media-placeholder {
  background:
    linear-gradient(135deg, rgba(184, 32, 43, 0.08), rgba(255, 201, 63, 0.12)),
    #fff;
}

.promo-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-top: 12px;
  padding: 12px 16px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand), var(--blue));
}

.promo-strip span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--gold);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.promo-strip strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-promos {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title span {
  color: var(--brand);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.section-title strong {
  color: var(--muted);
  font-size: 13px;
}

.promo-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.promo-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  flex: 0 1 calc((100% - 30px) / 4);
  gap: 10px;
  align-items: center;
  min-width: min(100%, 260px);
  min-height: 86px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.promo-card img {
  grid-row: span 2;
  display: block;
  width: 72px;
  height: 70px;
  padding: 4px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: #fff;
}

.promo-card span,
.promo-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.promo-card span {
  font-weight: 850;
}

.promo-card strong {
  color: var(--brand);
}

.order-controls {
  position: sticky;
  top: 92px;
  z-index: 24;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 16px -18px 0;
  padding: 12px 18px;
  background: rgba(251, 252, 254, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  width: min(100%, 420px);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segment button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
}

.segment button.is-active {
  color: #fff;
  background: var(--brand);
}

.search-box {
  display: grid;
  gap: 4px;
  width: min(100%, 420px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-box input,
.checkout-fields input,
.checkout-fields select,
.checkout-fields textarea,
.item-note textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.search-box input:focus,
.checkout-fields input:focus,
.checkout-fields select:focus,
.checkout-fields textarea:focus,
.item-note textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--focus) 25%, transparent);
  border-color: var(--focus);
}

.order-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 360px;
  gap: 18px;
  padding-top: 18px;
}

.category-rail {
  position: sticky;
  top: 184px;
  align-self: start;
  display: grid;
  gap: 8px;
}

.category-rail button {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  color: var(--ink);
  font-weight: 800;
}

.category-rail button.is-active {
  border-color: var(--brand);
  background: #fff4f5;
  color: var(--brand-dark);
}

.menu-pane {
  min-width: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-rows: 168px auto;
  overflow: hidden;
  min-height: 338px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 168px;
  min-height: 168px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}

.product-image.has-image {
  background: #fff !important;
}

.product-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  padding: 0;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.product-image span {
  color: #fff;
  font-size: 34px;
  font-weight: 950;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.product-title {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.product-title strong {
  font-size: 18px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.product-badge {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--brand-dark);
  background: #ffe8d2;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.product-desc {
  min-height: 44px;
  color: var(--muted);
  font-size: 14px;
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price {
  font-weight: 950;
}

.price-stack {
  display: grid;
  gap: 2px;
  line-height: 1.05;
}

.price-old {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.price-promo {
  color: var(--brand);
}

.product-add {
  width: 46px;
  height: 42px;
  color: #fff;
  border-color: var(--leaf);
  background: var(--leaf);
  font-size: 27px;
  line-height: 1;
}

.cart-pane {
  position: sticky;
  top: 184px;
  align-self: start;
  display: grid;
  max-height: calc(100vh - 202px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-header,
.cart-footer {
  padding: 14px;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.cart-header strong {
  font-size: 20px;
}

.text-btn {
  min-height: 38px;
  padding: 0 12px;
  color: var(--brand);
  background: #fff7f7;
}

.cart-items,
.checkout-items {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.cart-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.cart-item-top,
.cart-item-actions,
.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-item strong {
  overflow-wrap: anywhere;
}

.cart-options,
.cart-note {
  color: var(--muted);
  font-size: 13px;
}

.qty-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
  font-weight: 900;
}

.remove-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 900;
}

.cart-footer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.totals {
  display: grid;
  gap: 6px;
}

.total-row strong {
  font-size: 20px;
}

.discount-row strong {
  color: var(--leaf);
}

.total-row.is-grand {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.total-row.is-grand strong {
  color: var(--brand);
  font-size: 23px;
}

.primary-btn {
  min-height: 54px;
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  font-weight: 950;
}

.primary-btn:disabled,
.product-add:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.empty-state,
.error-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.error-state {
  color: var(--brand);
}

.modal-host,
.checkout-host {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(21, 25, 34, 0.48);
}

.modal-card,
.checkout-card {
  display: grid;
  gap: 14px;
  width: min(680px, 100%);
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.checkout-card {
  width: min(980px, 100%);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 26px;
}

.modal-close {
  width: 44px;
  height: 42px;
  flex: 0 0 auto;
  font-size: 24px;
}

.modal-product-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  height: 260px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.modal-product-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  padding: 0;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.modal-desc {
  margin: 0;
  color: var(--muted);
}

.option-group {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.option-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.option-title small {
  color: var(--muted);
  font-weight: 800;
}

.option-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.option-choice span {
  overflow-wrap: anywhere;
}

.item-note {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-actions {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
}

.modal-actions .qty-group {
  justify-content: center;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1fr);
  gap: 18px;
}

.checkout-layout h3 {
  margin: 0 0 10px;
}

.checkout-fields {
  display: grid;
  gap: 12px;
}

.checkout-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.phone-row {
  display: grid;
  grid-template-columns: minmax(126px, 150px) minmax(0, 1fr);
  gap: 8px;
}

.place-combo {
  position: relative;
}

.place-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.place-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-panel {
  position: absolute;
  z-index: 90;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: min(360px, 44vh);
  max-height: min(360px, 44vh);
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.place-panel input {
  min-height: 46px;
}

.place-options {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.place-options button {
  min-height: 42px;
  justify-content: start;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.place-options button:hover,
.place-options button.is-active {
  background: #eef2f7;
}

.delivery-fields {
  display: grid;
  gap: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--leaf);
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .hero-band {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-width: 0;
  }

  .order-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .cart-pane {
    position: static;
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 15px;
  }

  .site-header {
    min-height: 76px;
    padding: 8px 10px;
  }

  .brand-mark {
    gap: 8px;
  }

  .brand-mark img {
    width: 82px;
    height: 48px;
  }

  .brand-mark strong {
    font-size: 18px;
  }

  .brand-mark span {
    font-size: 12px;
  }

  .icon-btn {
    width: 44px;
    height: 42px;
  }

  .cart-pill {
    min-height: 42px;
    padding: 0 10px;
  }

  .site-main {
    padding: 12px;
  }

  .hero-band {
    padding: 16px;
  }

  .hero-copy {
    align-items: start;
  }

  .hero-copy img {
    width: 104px;
    height: 70px;
  }

  .hero-copy h1 {
    font-size: 29px;
  }

  .hero-copy p:last-child {
    font-size: 15px;
  }

  .hero-media,
  .hero-media-placeholder {
    min-height: 170px;
  }

  .promo-cards {
    justify-content: stretch;
  }

  .promo-card {
    flex-basis: 100%;
  }

  .order-controls {
    top: 76px;
    align-items: stretch;
    flex-direction: column;
    margin: 12px -12px 0;
    padding: 10px 12px;
  }

  .segment,
  .search-box {
    width: 100%;
  }

  .order-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 12px;
  }

  .category-rail {
    position: sticky;
    top: 196px;
    z-index: 20;
    display: flex;
    overflow-x: auto;
    padding: 4px 0;
    background: rgba(251, 252, 254, 0.94);
  }

  .category-rail button {
    flex: 0 0 auto;
    min-width: 130px;
  }

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

  .product-card {
    grid-template-columns: 116px minmax(0, 1fr);
    grid-template-rows: auto;
    min-height: 166px;
  }

  .product-image {
    height: 166px;
    min-height: 166px;
  }

  .product-body {
    padding: 12px;
  }

  .product-desc {
    min-height: 0;
  }

  .cart-pane {
    position: sticky;
    bottom: 0;
    z-index: 28;
    max-height: 58vh;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -12px 32px rgba(21, 25, 34, 0.14);
  }

  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .modal-host,
  .checkout-host {
    align-items: end;
    padding: 0;
  }

  .modal-card,
  .checkout-card {
    width: 100%;
    max-height: 94vh;
    border-radius: 8px 8px 0 0;
  }

  .modal-product-image {
    height: 210px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .top-actions {
    gap: 5px;
  }

  .icon-btn {
    width: 40px;
  }

  .cart-pill {
    gap: 6px;
  }

  .cart-pill span:last-child {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-mark div {
    display: none;
  }
}

/* Hard image reset for product photos: always show the complete original image. */
.product-card {
  grid-template-rows: 220px auto;
  min-height: 390px;
}

.product-image {
  position: relative;
  display: block;
  height: 220px;
  min-height: 220px;
  padding: 0 !important;
  background: #fff !important;
}

.product-image img {
  position: absolute !important;
  inset: 10px !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: calc(100% - 20px) !important;
  max-height: calc(100% - 20px) !important;
  margin: auto !important;
  object-fit: contain !important;
  object-position: center !important;
}

.promo-card img,
.modal-product-image img,
.hero-media img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

@media (max-width: 760px) {
  .product-card {
    grid-template-columns: 116px minmax(0, 1fr);
    grid-template-rows: auto;
    min-height: 166px;
  }

  .product-image {
    height: 166px;
    min-height: 166px;
  }
}
