body { background: var(--bg); overflow-x: hidden; line-height: 1.5; }
body.has-cart main { padding-bottom: 110px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

.top { display: flex; align-items: center; gap: 14px; padding: 22px 0 18px; animation: rise 0.45s var(--ease) both; }
.logo { width: 58px; height: 58px; border-radius: 18px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.title { flex: 1; min-width: 0; }
.title h1 { font-size: clamp(22px, 5.4vw, 30px); font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .icon { width: 14px; height: 14px; color: var(--red); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.cover {
  position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 380px; width: 100%;
  background: var(--surface-2); animation: rise 0.5s 0.06s var(--ease) both;
}
.cover > img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.cover > img.is-loaded { opacity: 1; }
.cover-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: var(--yellow); color: var(--red); font-weight: 800; font-size: 20px;
}
.cover-fallback img { width: 96px; height: 96px; border-radius: 50%; }

.search { position: relative; display: block; margin-top: 18px; }
.search input {
  width: 100%; height: 52px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; font-size: 15px; padding: 0 48px; outline: none; transition: border-color 0.2s;
}
.search input:focus { border-color: var(--red); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 16px; color: var(--muted); display: grid; }
.search-icon .icon { width: 20px; height: 20px; }

.offline-note { margin-top: 12px; padding: 8px 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; }

.cats { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: 18px -18px 0; padding: 12px 18px; }
.cats-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.cats-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 6px 6px 6px 18px;
  border-radius: 40px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 15px; white-space: nowrap; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip-photo { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--yellow); display: grid; place-items: center; flex-shrink: 0; }
.chip-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chip-photo.has-photo img { width: 100%; height: 100%; object-fit: cover; }
.chip[aria-current='true'] { background: var(--red); border-color: var(--red); color: #fff; }
.chip[aria-current='true'] .chip-photo { background: #fff; }

.menu-section { padding-top: 22px; scroll-margin-top: 84px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-title { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; }
.block-title::before { content: ''; width: 10px; height: 26px; border-radius: 6px; background: var(--red); }
.block-count { color: var(--muted); font-weight: 700; font-size: 14px; }

.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 980px) { .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card-grid > li { display: flex; }
.card {
  width: 100%; display: flex; flex-direction: column; text-align: start; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 22px; overflow: hidden; transition: transform 0.18s, border-color 0.18s;
}
.card:active { transform: scale(0.98); }
@media (hover: hover) { .card:hover { border-color: var(--red); } }
.card.is-selected { border-color: var(--red); }
.card.is-unavailable { opacity: 0.55; }
.thumb { position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.tag { position: absolute; top: 10px; inset-inline-end: 10px; padding: 3px 10px; border-radius: 20px; background: #fff; color: var(--muted); font-size: 11.5px; font-weight: 800; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 1; }
.card-name { font-weight: 800; font-size: 16px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.price-pill {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 14px; border-radius: 30px;
  background: var(--yellow); color: var(--red); font-weight: 800; font-size: 17px; font-family: var(--numeric-font);
}
.price-pill small { font-family: Cairo, 'Alan Sans', sans-serif; font-size: 12px; font-weight: 700; opacity: 0.75; }
.price-alt { color: var(--muted); font-size: 13px; font-weight: 700; font-family: var(--numeric-font); }

.media { position: relative; overflow: hidden; display: grid; place-items: center; background: var(--yellow); }
.media img { opacity: 0; transition: opacity 0.4s var(--ease); }
.media img.is-loaded { opacity: 1; }
.media-photo { width: 100%; height: 100%; object-fit: cover; }
.media-logo { width: 50%; height: 50%; object-fit: cover; border-radius: 50%; box-shadow: 0 10px 24px -10px rgba(161, 0, 0, 0.6); }
.card-media { position: absolute; inset: 0; }

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease) var(--delay, 0ms), transform 0.5s var(--ease) var(--delay, 0ms); }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } }

.no-results { padding: 60px 0; text-align: center; color: var(--muted); font-weight: 700; }

.fly-ghost { position: fixed; z-index: 100; pointer-events: none; margin: 0; object-fit: cover; border-radius: 22px; }
.fly-ghost.media-logo { border-radius: 50%; }

.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  transform: translateY(130%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cartbar.is-visible { transform: none; }
.cartbar button {
  max-width: 560px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 12px; height: 58px;
  border-radius: 20px; background: var(--red); color: #fff; padding: 0 18px 0 10px; font-weight: 800; font-size: 16px;
}
.cartbar .count {
  min-width: 36px; height: 36px; border-radius: 12px; background: #fff; color: var(--red);
  display: grid; place-items: center; font-family: var(--numeric-font);
}
.cartbar .count.is-bumped { animation: bump 0.4s var(--spring); }
@keyframes bump { 40% { transform: scale(1.3); } }
.cartbar .sum { margin-inline-start: auto; font-family: var(--numeric-font); }

.sheet {
  position: fixed; inset: auto 0 0; width: 100%; max-width: 560px; max-height: 92vh; margin: 0 auto; padding: 0;
  border: 0; border-radius: 28px 28px 0 0; background: var(--surface); color: var(--text); overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet[open] { animation: sheet-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet::backdrop { background: rgba(10, 12, 16, 0.55); animation: fade 0.25s; }
@keyframes sheet-up { from { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 720px) {
  .sheet { inset: 0; margin: auto; border-radius: 28px; height: fit-content; }
  .sheet[open] { animation: sheet-pop 0.28s var(--ease); }
  @keyframes sheet-pop { from { transform: translateY(10%) scale(0.96); opacity: 0; } }
}
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 16px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.stepper button:active { background: var(--surface-3); }
.stepper span { min-width: 28px; text-align: center; font-weight: 800; font-family: var(--numeric-font); font-size: 18px; }

.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 6px; }
.cart-head h3 { font-size: 22px; font-weight: 800; }
#cart-body { padding-top: 0; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { display: block; font-weight: 800; font-size: 15px; }
.cart-line-price { display: block; color: var(--muted); font-weight: 800; font-size: 12.5px; font-family: var(--numeric-font); }
.cart-line .stepper button { width: 32px; height: 32px; font-size: 18px; }
.cart-line .stepper span { min-width: 22px; font-size: 15px; }
.totals {
  display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 14px 16px;
  border-radius: 16px; background: var(--yellow); color: var(--red); font-weight: 800; font-size: 17px;
}
.totals-values { text-align: end; }
.totals-primary { font-family: var(--numeric-font); font-size: 20px; }
.totals-secondary { font-family: var(--numeric-font); font-size: 13px; opacity: 0.75; }

.order-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.order-form .field { gap: 6px; }
.order-form .field-label { font-weight: 700; font-size: 14px; color: var(--text); }
.order-form .input {
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 15px; padding: 12px 14px;
}
.order-form .input:focus { border-color: var(--red); box-shadow: none; }
.order-types { display: flex; gap: 8px; border: 0; margin: 0; padding: 0; }
.order-type { flex: 1; position: relative; }
.order-type input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.order-type span {
  display: grid; place-items: center; min-height: 48px; border-radius: 14px; background: var(--surface-2);
  border: 1.5px solid transparent; font-weight: 700; font-size: 14.5px; transition: 0.15s;
}
.order-type input:checked + span { border-color: var(--red); background: var(--yellow); color: var(--red); }
.order-type input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

#cart-footer { display: flex; flex-direction: column; gap: 10px; padding: 18px 22px calc(18px + env(safe-area-inset-bottom)); }
#cart-footer .btn { width: 100%; height: 52px; border-radius: 16px; font-weight: 800; font-size: 16px; }
#cart-footer .btn-primary { background: var(--red); color: #fff; }
.sheet .btn-whatsapp { background: var(--green); color: #fff; }
.sheet .btn-soft { background: var(--surface-2); color: var(--text); }
#cart-footer .btn-primary { background: var(--red); color: #fff; }
.form-hint { color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; }

.sent-state { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 24px 0; }
.sent-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: #e7f9ee; color: var(--green); animation: pop 0.45s var(--spring); }
.sent-icon .icon { width: 34px; height: 34px; }
.sheet-title { font-size: 22px; font-weight: 800; }

.toast {
  left: 50%; right: auto; bottom: 96px; max-width: none; width: auto; margin: 0;
  transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.toast.is-visible { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

.card-control { position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 1; }
.add-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--red); box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--spring), background 0.2s, color 0.2s;
}
.add-btn .icon { width: 24px; height: 24px; transition: transform 0.3s var(--spring); }
.add-btn:active { transform: scale(0.82); }
.add-btn:active .icon { transform: rotate(90deg); }
@media (hover: hover) { .add-btn:hover { background: var(--red); color: #fff; } }
.add-btn.is-entering { animation: pop 0.35s var(--spring); }

.qty-pill {
  display: flex; align-items: center; height: 44px; padding: 0 2px; border-radius: 22px;
  background: var(--red); color: #fff; box-shadow: 0 8px 18px -6px rgba(161, 0, 0, 0.75);
}
.qty-pill.is-entering { animation: pill-open-from-right 0.42s var(--spring); }
[dir='rtl'] .qty-pill.is-entering { animation-name: pill-open-from-left; }
@keyframes pill-open-from-right { from { clip-path: inset(0 0 0 calc(100% - 44px) round 22px); } to { clip-path: inset(0 0 0 0 round 22px); } }
@keyframes pill-open-from-left { from { clip-path: inset(0 calc(100% - 44px) 0 0 round 22px); } to { clip-path: inset(0 0 0 0 round 22px); } }
.qty-pill button { width: 38px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: #fff; }
.qty-pill button:active { transform: scale(0.8); }
.qty-pill .icon { width: 20px; height: 20px; }
.qty-value { min-width: 20px; text-align: center; font-family: var(--numeric-font); font-weight: 800; font-size: 17px; animation: tick 0.28s var(--spring); }
@keyframes tick { from { transform: translateY(-40%); opacity: 0; } }

.card.just-added { animation: ring 0.6s var(--ease); }
.card.just-added .media-photo, .card.just-added .media-logo { animation: nudge 0.5s var(--spring); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(161, 0, 0, 0.45); } 100% { box-shadow: 0 0 0 12px rgba(161, 0, 0, 0); } }
@keyframes nudge { 40% { transform: scale(1.06) rotate(-2deg); } }
