/* Speisekarte + Warenkorb */

.menu-page .page-head {
  padding-bottom: clamp(20px, 3vw, 36px);
}

/* Toolbar */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  margin-top: clamp(28px, 4vw, 56px);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-top: 12px;
}
.toolbar__row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search {
  flex: 1;
  min-width: 0;
}
.search input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font-size: 16px;
}
.search input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.toggle {
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.toggle[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-dark);
}
.chips {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 14px;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.chip:hover {
  color: var(--ink);
}
.chip.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
@media (max-width: 480px) {
  .toggle {
    padding: 0 12px;
    font-size: 13px;
  }
}

/* Layout: list + cart */
.menu-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 clamp(32px, 4vw, 64px);
}
@media (min-width: 1100px) {
  .menu-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}

/* Categories */
.cat {
  padding-top: clamp(40px, 5vw, 72px);
  scroll-margin-top: calc(var(--header-h) + var(--toolbar-h, 110px) - 8px);
}
.cat__title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.cat__count {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  vertical-align: super;
  color: var(--muted);
}
.dishes {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-ink);
}
.dish {
  display: grid;
  grid-template-columns: 3em minmax(0, 1fr) auto 92px;
  align-items: center;
  gap: 0 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: calc(var(--header-h) + var(--toolbar-h, 110px) + 16px);
  transition: background 0.6s;
}
.dish.is-target {
  background: rgba(126, 157, 63, 0.14);
}
.dish__nr {
  font-size: 13px;
  color: var(--muted);
}
.dish__main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.dish__img {
  flex: none;
  width: 88px;
  height: 70px;
  object-fit: cover;
  border-radius: 2px;
}
.dish__body {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.dish__name {
  font-size: 17px;
  line-height: 1.35;
}
.dish__desc {
  font-size: 14px;
  color: var(--muted);
}
.dish__tags {
  display: flex;
  gap: 10px;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag--hot {
  color: var(--red);
}
.tag--hot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: 1px;
}
.dish__price {
  font-size: 17px;
  text-align: right;
  white-space: nowrap;
}
.dish__act {
  display: flex;
  justify-content: flex-end;
}

/* Add button + stepper */
.add {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.3s var(--ease);
}
.add:hover {
  background: var(--ink);
  color: var(--on-dark);
}
.add:active {
  transform: scale(0.92);
}
.qty {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-dark);
}
.qty button {
  width: 34px;
  height: 40px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}
.qty span {
  min-width: 18px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}
.dish .qty {
  margin-right: -2px;
}
.dish__act .qty {
  position: relative;
}
@media (max-width: 599px) {
  .dish {
    grid-template-columns: 2.3em minmax(0, 1fr) auto;
    grid-template-areas:
      "nr main price"
      "nr main act";
    row-gap: 8px;
    align-items: start;
  }
  .dish__nr {
    grid-area: nr;
    padding-top: 3px;
  }
  .dish__main {
    grid-area: main;
    align-items: flex-start;
  }
  .dish__price {
    grid-area: price;
  }
  .dish__act {
    grid-area: act;
  }
  .dish__img {
    width: 68px;
    height: 54px;
  }
  .dish__name,
  .dish__price {
    font-size: 16px;
  }
}

.empty {
  padding: 48px 0;
  font-size: 17px;
  color: var(--muted);
}
.empty .link {
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}
.menu-note {
  margin: clamp(40px, 5vw, 72px) 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}
.menu-note strong {
  color: var(--ink);
  margin-right: 6px;
}
[hidden] {
  display: none !important;
}

/* Cart */
.cart__panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 24px;
}
.cart__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cart__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.02em;
}
.cart__close {
  display: none;
  border: 0;
  background: none;
  padding: 8px 0;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}
.cart__status {
  margin: 6px 0 18px;
  font-size: 14px;
  color: var(--ink-2);
}
.cart__empty p {
  margin: 0;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--muted);
}
.plus-ico {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  vertical-align: -4px;
}
.cart__items {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.cart__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.cart__item-name {
  line-height: 1.35;
}
.cart__item-name small {
  color: var(--muted);
  font-size: 12px;
  margin-right: 4px;
}
.cart__item-price {
  text-align: right;
  white-space: nowrap;
}
.cart__item .qty {
  justify-self: start;
  transform: scale(0.88);
  transform-origin: left center;
}
.cart__total {
  display: flex;
  justify-content: space-between;
  padding: 16px 0 20px;
  font-size: 20px;
  font-weight: 600;
}
.cart__form {
  display: grid;
  gap: 14px;
}
.cart__form .field input,
.cart__form .field select,
.cart__form .field textarea {
  background: #fff;
}
.cart__sent {
  display: grid;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.cart__sent .h3 {
  margin: 0 0 4px;
}
.cart__sent p {
  margin: 0 0 10px;
  color: var(--ink-2);
}

@media (min-width: 1100px) {
  .cart {
    padding-top: clamp(40px, 5vw, 72px);
  }
  .cart__panel {
    position: sticky;
    top: calc(var(--header-h) + var(--toolbar-h, 110px) + 24px);
    max-height: calc(100vh - var(--header-h) - var(--toolbar-h, 110px) - 48px);
    overflow-y: auto;
  }
  .cart-bar,
  .scrim {
    display: none !important;
  }
}

/* Mobile/tablet: cart as bottom sheet + sticky bar */
@media (max-width: 1099px) {
  .cart {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    max-height: 92vh;
    max-height: 92dvh;
    transform: translateY(105%);
    transition: transform 0.45s var(--ease);
    visibility: hidden;
  }
  .cart.is-open {
    transform: none;
    visibility: visible;
  }
  .cart__panel {
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    padding: 20px var(--margin) calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -20px 60px rgba(26, 20, 16, 0.25);
  }
  .cart__close {
    display: block;
  }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(26, 20, 16, 0.45);
  }
  .cart-bar {
    position: fixed;
    left: var(--margin);
    right: var(--margin);
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 0 20px 0 10px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-dark);
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(63, 86, 24, 0.35);
    cursor: pointer;
  }
  .cart-bar > span:nth-child(2) {
    flex: 1;
    text-align: left;
  }
  .cart-bar__count {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--on-dark);
    color: var(--accent);
  }
  .menu-page {
    padding-bottom: 80px;
  }
}
body.cart-open {
  overflow: hidden;
}
