:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d8e0ea;
  --brand: #0f7a83;
  --accent: #e7792b;
  --bg: #f4f7fa;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #172033;
  color: white;
  min-height: 64px;
}

.topbar div {
  display: grid;
  gap: 2px;
}

.topbar span {
  color: #cbd5e1;
  font-size: 13px;
}

.topbar button,
button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  min-height: 40px;
}

main {
  width: min(1240px, calc(100% - 24px));
  margin: 16px auto 40px;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin-top: 0;
}

.catalog-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.catalog-header input {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.group-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

.group-tabs button {
  background: #e8eef5;
  color: var(--ink);
  white-space: nowrap;
  flex: 0 0 auto;
}

.group-tabs button.active {
  background: var(--brand);
  color: white;
}

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

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .06);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e8eef5;
}

.product-body {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  padding: 12px;
}

.product-body h2 {
  display: -webkit-box;
  min-height: 42px;
  margin-bottom: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-body p {
  display: -webkit-box;
  min-height: 40px;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  align-self: end;
  padding-top: 4px;
}

.product-footer button {
  flex: 0 0 auto;
  min-width: 96px;
  padding-inline: 12px;
}

.price {
  color: #075d66;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

dialog {
  width: min(680px, calc(100% - 8px));
  max-height: min(92vh, 760px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(15, 23, 42, .42);
}

.dialog-card {
  position: relative;
  display: grid;
  gap: 10px;
  max-height: min(92vh, 760px);
  overflow: auto;
  padding: 0 12px 12px;
  background: #f3f6fa;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: transparent;
  color: white;
  width: 34px;
  height: 34px;
  padding: 0;
}

.item-dialog-head {
  margin: 0 -12px;
  padding: 10px 44px 10px 16px;
  background: #172033;
  color: white;
}

.item-dialog-head h2 {
  margin: 0;
  font-size: 29px;
  line-height: 1;
}

.item-dialog-head p {
  margin: 3px 0 0;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  color: var(--ink);
  background: white;
}

.company-hero {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 78px;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .06);
}

.company-hero img {
  width: 220px;
  height: 220px;
  border-radius: 0;
  object-fit: cover;
  background: #e8eef5;
}

.company-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
  padding: 20px 0;
}

.company-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.company-hero h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
}

.company-hero p {
  color: var(--muted);
  margin: 0;
  font-size: 16px;
}

.company-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0;
}

.company-info span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #13182a;
  font-size: 16px;
}

.company-info span + span {
  border-left: 1px solid #6b7280;
  padding-left: 10px;
}

.company-info span:nth-child(1)::before {
  content: "◷";
  color: #6b6f8a;
}

.company-info span:nth-child(2)::before {
  content: "▣";
  color: #6b6f8a;
}

.company-info span:nth-child(3)::before {
  content: "▤";
  color: #6b6f8a;
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #111827;
  font-weight: 700;
}

.rating-pill::first-letter {
  color: #f4b32c;
  font-size: 28px;
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #e8eef5;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.status-pill {
  margin-bottom: 8px;
}

.status-pill.open {
  background: #dcfce7;
  color: #166534;
}

.status-pill.closed {
  background: #fee2e2;
  color: #991b1b;
}

.share-link-button {
  justify-self: center;
  align-self: end;
  margin: 0 16px 22px 0;
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1.5px solid #ff3131;
  border-radius: 18px;
  background: #fff;
  color: #ff3131;
  box-shadow: none;
}

.share-link-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.more-info-button {
  justify-self: start;
  min-height: auto;
  padding: 8px 0;
  background: transparent;
  color: #ff1d25;
  font-size: 16px;
  font-weight: 500;
}

.info-dialog-card {
  gap: 16px;
}

.info-dialog-card h2,
.info-dialog-card h3,
.info-dialog-card p {
  margin: 0;
}

.info-dialog-card .close-button {
  color: var(--ink);
  background: #e8eef5;
}

.info-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.info-status-row span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.hours-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.hours-line {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.hours-line span {
  color: var(--muted);
}

.option-grid,
.additional-list {
  display: grid;
  gap: 10px;
}

.choice-group {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.choice-group-head {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
}

.choice-step {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #18777f;
  color: white;
  font-size: 19px;
  font-weight: 900;
}

.choice-group-head strong {
  display: block;
  color: #172033;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
}

.choice-group-head small,
.choice-group-head span,
.choice-group-head em {
  color: #657286;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.choice-group-head small,
.choice-group-head span {
  text-transform: uppercase;
}

.choice-grid,
.additional-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
}

.choice-card > span {
  display: grid;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.choice-card strong {
  color: #111827;
  font-size: 14px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.choice-card small {
  justify-self: center;
  border-radius: 6px;
  padding: 5px 10px;
  background: #e9f2f3;
  color: #075d66;
  font-size: 13px;
  font-weight: 900;
}

.choice-card input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

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

.qty button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 0;
  background: #18777f;
  font-size: 20px;
}

.qty strong {
  min-width: 26px;
  text-align: center;
}

.prep-field {
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px 10px;
  background: white;
}

.prep-field span {
  color: #657286;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.prep-field textarea {
  min-height: 54px;
  resize: vertical;
}

.item-total-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #18777f;
  color: white;
}

.item-total-bar span {
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.item-total-bar strong {
  font-size: 24px;
}

.empty-additional {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  text-align: center;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  justify-content: end;
  align-items: center;
  gap: 12px;
}

#itemDialog footer {
  grid-template-columns: 1fr auto;
}

#itemDialog footer .item-total-bar {
  grid-column: 1 / -1;
}

#itemDialog #addItemButton {
  justify-self: end;
  background: #f2bf89;
  color: white;
}

.cart-items {
  display: grid;
  gap: 12px;
  max-height: min(70vh, 620px);
  overflow: auto;
}

.cart-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

#cartDialog {
  width: min(980px, calc(100% - 12px));
}

.cart-dialog-card {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 18px;
  padding: 18px;
  background: #f7f9fc;
}

.cart-dialog-card .close-button {
  color: var(--ink);
  background: #e8eef5;
}

.cart-main h2,
.order-summary-panel h3 {
  margin-bottom: 14px;
}

.cart-product-line {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #e5ebf3;
  padding: 10px 0 14px;
}

.cart-product-line img {
  width: 86px;
  height: 86px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8eef5;
}

.cart-product-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cart-product-body p,
.cart-product-body small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.remove-cart-button {
  justify-self: start;
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
}

.cart-product-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.cart-qty button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 0;
  padding: 0;
  background: white;
  color: var(--ink);
}

.cart-qty strong {
  min-width: 28px;
  text-align: center;
}

.cart-line-price {
  color: var(--accent);
}

.order-summary-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
  box-shadow: 0 10px 24px rgba(23, 32, 51, .06);
}

.summary-lines {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid #e5ebf3;
  padding-bottom: 10px;
}

.summary-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.summary-lines strong {
  color: var(--ink);
}

.summary-lines .discount-line,
.summary-lines .discount-line strong {
  color: #198754;
}

.summary-lines .summary-total {
  border-top: 1px solid #e5ebf3;
  margin-top: 4px;
  padding-top: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.summary-lines .summary-total strong {
  color: var(--accent);
  font-size: 18px;
}

.order-summary-panel footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.order-summary-panel footer > strong {
  display: none;
}

.order-summary-panel #submitOrderButton {
  width: 100%;
  background: var(--accent);
}

.continue-shopping-button {
  width: 100%;
  border: 1px solid var(--accent);
  background: white;
  color: var(--accent);
}

.delivery-fee-line {
  background: #eef9f7;
  border-color: #b9dedc;
}

.delivery-fee-line strong,
.delivery-fee-line small {
  color: #075d66;
}

.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 9999;
  width: max-content;
  max-width: calc(100% - 24px);
  background: #0f7a83;
  color: white;
  border-radius: 8px;
  padding: 13px 18px;
  box-shadow: 0 16px 34px rgba(23, 32, 51, .24);
  font-weight: 800;
  text-align: center;
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px;
  }

  main {
    width: min(100% - 16px, 640px);
    margin-top: 10px;
  }

  .catalog-header {
    display: grid;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .company-hero {
    grid-template-columns: 96px minmax(0, 1fr) 52px;
    gap: 12px;
    padding: 0;
    margin-bottom: 12px;
  }

  .company-hero img {
    width: 96px;
    height: 128px;
  }

  .company-copy {
    gap: 8px;
    padding: 12px 0;
  }

  .company-hero h1 {
    font-size: 22px;
  }

  .company-info {
    gap: 6px;
  }

  .company-info span {
    font-size: 12px;
  }

  .company-info span + span {
    padding-left: 6px;
  }

  .status-pill {
    max-width: 100%;
    border-radius: 8px;
    font-size: 12px;
  }

  .share-link-button {
    width: 44px;
    height: 38px;
    min-height: 38px;
    margin: 0 8px 12px 0;
    border-radius: 14px;
  }

  .more-info-button {
    font-size: 14px;
    padding: 4px 0;
  }

  .hours-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .product-card {
    grid-template-columns: 104px 1fr;
    grid-template-rows: auto;
    min-height: 132px;
  }

  .product-card img {
    width: 104px;
    height: 100%;
    min-height: 132px;
    aspect-ratio: auto;
  }

  .product-body {
    min-width: 0;
    padding: 10px;
  }

  .product-body h2 {
    min-height: auto;
    font-size: 15px;
  }

  .product-body p {
    min-height: auto;
    font-size: 13px;
  }

  .product-footer {
    align-items: end;
  }

  .product-footer button {
    min-width: 44px;
    padding: 9px 10px;
  }

  .choice-group-head {
    grid-template-columns: 32px 1fr;
  }

  .choice-group-head em {
    grid-column: 2;
  }

  .choice-grid,
  .additional-group-list {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    overflow-x: auto;
  }

  .choice-card {
    gap: 8px;
  }

  .qty {
    flex: 0 0 auto;
  }

  .cart-dialog-card {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .cart-product-line {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .cart-product-line img {
    width: 72px;
    height: 72px;
  }

  .cart-product-actions {
    grid-column: 2;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
  }

  .cart-line-price {
    justify-self: end;
  }

  .order-summary-panel {
    position: static;
  }
}

@media (max-width: 420px) {
  .topbar {
    gap: 10px;
  }

  .topbar button {
    padding-inline: 10px;
  }

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

  .product-card img {
    width: 92px;
    min-height: 124px;
  }

  .product-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .price {
    font-size: 14px;
  }

  dialog {
    width: calc(100% - 4px);
  }

  .choice-grid,
  .additional-group-list {
    grid-template-columns: 1fr;
  }

  .item-dialog-head h2 {
    font-size: 25px;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}
