:root {
  --red: #b91c1c;
  --red-dark: #7f1d1d;
  --red-light: #fee2e2;
  --cream: #faf7f2;
  --white: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --green: #059669;
  --green-light: #d1fae5;
  --gold: #d97706;
  --gold-light: #fef3c7;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
  --radius: 16px;
  --sidebar-width: 260px;
  --bottom-nav-height: 78px;
  --mobile-toolbar-height: 112px;
  --content-max: 1440px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--cream);
  color: var(--text);
}

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

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

.loading-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 20px;
  background: var(--red-light);
  display: grid;
  place-items: center;
  font-size: 34px;
}

/* ── Shell layout ── */

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.mobile-toolbar,
.bottom-nav {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.brand p {
  margin: 2px 0 0;
  color: var(--text-light);
  font-size: 0.82rem;
}

.locality-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.locality-card label,
.mobile-locality-row label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.locality-card select,
.mobile-locality-row select,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--white);
}

.sync-status {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-status.compact {
  margin-top: 8px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.sync-dot.syncing {
  background: var(--gold);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { opacity: 0.4; }
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item,
.bottom-nav-item {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  width: 100%;
}

.nav-item.active,
.bottom-nav-item.active {
  background: var(--red-light);
  color: var(--red-dark);
  font-weight: 600;
}

.nav-item .badge,
.bottom-nav-item .badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  padding: 0 6px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
}

.topbar {
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 18px clamp(16px, 3vw, 28px);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  flex: 1 1 280px;
  max-width: 420px;
  min-width: 0;
  position: relative;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 16px 11px 42px;
  background: var(--white);
}

.search-box span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.content {
  padding: clamp(16px, 3vw, 28px);
  padding-bottom: clamp(24px, 4vw, 40px);
  width: 100%;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, opacity 0.15s ease;
  min-height: 44px;
}

.btn-icon {
  min-width: 44px;
  padding: 10px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--red);
  color: white;
}

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red-light);
}

.btn-success {
  background: var(--green);
  color: white;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 18px 0;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.section-title {
  margin: 28px 0 14px;
  font-size: clamp(1rem, 2.2vw, 1.1rem);
}

.featured-grid,
.restaurant-grid,
.promo-grid,
.menu-grid {
  display: grid;
  gap: clamp(14px, 2vw, 18px);
}

.featured-carousel {
  overflow: hidden;
  width: 100%;
  margin-bottom: 4px;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 28px,
    #000 calc(100% - 28px),
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 28px,
    #000 calc(100% - 28px),
    transparent
  );
}

.featured-carousel__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: clamp(14px, 2vw, 18px);
  width: max-content;
  animation: featured-carousel-scroll var(--featured-duration, 32s) linear infinite;
  will-change: transform;
}

.featured-carousel__track:hover {
  animation-play-state: paused;
}

.featured-carousel__track .card {
  flex: 0 0 min(260px, 78vw);
  width: min(260px, 78vw);
  max-width: 260px;
}

@keyframes featured-carousel-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.restaurant-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.promo-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.menu-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-clickable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(31, 41, 55, 0.12);
}

.card-image {
  aspect-ratio: 16 / 10;
  background: #f3f4f6;
  object-fit: cover;
  width: 100%;
}

.card-body {
  padding: 16px;
}

.card-title-row {
  display: flex;
  align-items: start;
  gap: 10px;
}

.card-title-row h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.card-meta {
  color: var(--text-light);
  font-size: 0.86rem;
  margin-top: 6px;
  line-height: 1.45;
}

.badge-open,
.badge-closed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-open {
  background: var(--green-light);
  color: var(--green);
}

.badge-closed {
  background: #f3f4f6;
  color: var(--text-light);
}

.empty-state {
  text-align: center;
  padding: clamp(40px, 8vw, 60px) 20px;
  color: var(--text-light);
}

.empty-state h3 {
  color: var(--text);
}

.menu-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.menu-categories {
  position: sticky;
  top: 92px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.menu-categories button {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
}

.menu-categories button.active {
  background: var(--red-light);
  color: var(--red-dark);
  font-weight: 600;
}

.menu-categories button.menu-category-promo {
  background: var(--gold-light);
  color: var(--red-dark);
  font-weight: 700;
}

.menu-categories button.menu-category-promo.active {
  background: var(--red);
  color: #fff;
}

.menu-item-card--promo .card-body h3:empty,
.menu-item-card--promo .card-body h3 {
  font-size: 0.95rem;
}

.menu-item-card--promo img,
.menu-item-card--promo .card-image {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.menu-view--refreshing .menu-grid {
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.restaurant-cover {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--cream);
  line-height: 0;
}

.restaurant-cover__closed-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 12px 36px;
  border-radius: 999px;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  z-index: 2;
  pointer-events: none;
}

.restaurant-cover__favorite {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

.restaurant-card__media {
  position: relative;
}

.restaurant-card__favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.favorite-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(31, 41, 55, 0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.restaurant-cover__favorite.favorite-btn {
  background: rgba(0, 0, 0, 0.28);
  box-shadow: none;
}

.favorite-btn .favorite-icon {
  font-size: 1.15rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
}

.restaurant-card__favorite.favorite-btn .favorite-icon,
.favorite-btn:not(.restaurant-cover__favorite) .favorite-icon {
  color: var(--text-light);
}

.favorite-btn.is-favorite .favorite-icon {
  color: var(--red);
}

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

.half-price-badge {
  font-size: 0.82rem;
  color: var(--text-light);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.pizza-portion-modal {
  max-width: 420px;
}

.pizza-portion-name {
  margin: 0 0 14px;
  font-weight: 600;
}

.pizza-portion-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pizza-portion-option {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.pizza-portion-option.selected {
  background: var(--red-light);
  border-color: rgba(185, 28, 28, 0.25);
}

.pizza-portion-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.pizza-portion-actions .btn {
  flex: 1;
}

.favorites-empty__icon {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.restaurant-cover__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(380px, 52vh);
  object-fit: contain;
  object-position: center center;
  background: var(--cream);
}

.restaurant-cover__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px clamp(16px, 3vw, 28px);
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.42) 42%,
    rgba(0, 0, 0, 0.08) 100%
  );
  color: #fff;
  pointer-events: none;
}

.restaurant-cover__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.restaurant-cover__badge {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.restaurant-cover__meta {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.menu-view__content {
  padding-top: 20px;
}

.menu-tab-bar {
  display: flex;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.menu-tab-bar__item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 10px;
  cursor: pointer;
  color: var(--text-light);
  font-weight: 500;
  position: relative;
}

.menu-tab-bar__item.active {
  color: var(--red-dark);
  font-weight: 700;
}

.menu-tab-bar__item.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 2px;
  transform: translateX(-50%);
  background: var(--red);
  border-radius: 999px;
}

.menu-info-panel,
.menu-reviews-panel {
  padding-bottom: 8px;
}

.menu-info-card {
  padding: 20px;
}

.menu-info-card h3 {
  margin: 0 0 12px;
}

.menu-info-name {
  margin: 0 0 16px;
  font-weight: 600;
  font-size: 1.05rem;
}

.menu-info-list {
  margin: 0;
}

.menu-info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.menu-info-row:last-child {
  border-bottom: none;
}

.menu-info-row dt {
  margin: 0;
  color: var(--text-light);
  font-size: 0.85rem;
}

.menu-info-row dd {
  margin: 0;
}

.menu-info-open {
  color: var(--green);
  font-weight: 600;
}

.menu-info-closed {
  color: var(--text-light);
  font-weight: 600;
}

.menu-info-subtitle {
  margin: 18px 0 8px;
  font-size: 0.95rem;
}

.menu-info-row--location a {
  color: var(--red);
  font-weight: 600;
}

.menu-info-wa {
  display: block;
  width: 100%;
  margin-top: 18px;
  text-align: center;
  text-decoration: none;
}

.menu-reviews-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu-reviews-empty {
  padding: 24px 0;
}

.review-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.review-item__stars {
  color: var(--gold);
  letter-spacing: 1px;
}

.review-dialog {
  max-width: 420px;
}

.review-star-picker {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
}

.review-star {
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--border);
  padding: 0;
}

.review-star.selected {
  color: var(--gold);
}

.review-dialog textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 96px;
  font: inherit;
}

.restaurant-about {
  margin: 0;
  padding: 16px clamp(16px, 3vw, 28px) 0;
  color: var(--text-light);
  line-height: 1.5;
  font-size: 0.92rem;
}

.restaurant-location-link {
  display: inline-block;
  margin: 8px clamp(16px, 3vw, 28px) 0;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.restaurant-location-link:hover {
  text-decoration: underline;
}

.menu-view .menu-categories {
  top: 16px;
}

.menu-item-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.menu-item-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.menu-item-card .price {
  font-weight: 700;
  color: var(--red);
  margin-top: auto;
  padding-top: 10px;
}

.menu-item-card .actions {
  margin-top: 12px;
}

.menu-item-card .actions .btn {
  width: 100%;
}

.restaurant-header {
  display: grid;
  grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
  gap: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}

.restaurant-header img,
.restaurant-header .card-image {
  width: 100%;
  max-width: 120px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  align-items: start;
}

.cart-group {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

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

.qty-controls button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
}

.checkout-panel {
  position: sticky;
  top: 92px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.profile-card {
  width: 100%;
  max-width: 520px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 24px);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: max(20px, var(--safe-top)) 20px max(20px, var(--safe-bottom));
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--white);
  border-radius: 18px;
  padding: clamp(18px, 4vw, 24px);
  box-shadow: var(--shadow);
}

.modal h3 {
  margin-top: 0;
}

.progress-bar {
  height: 10px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.25s ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, calc(20px + var(--safe-bottom)));
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  z-index: 200;
  animation: fadeIn 0.2s ease;
  max-width: min(92vw, 420px);
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.accent-red { border-left: 4px solid var(--red); }
.accent-gold { border-left: 4px solid var(--gold); }
.accent-green { border-left: 4px solid var(--green); }
.accent-purple { border-left: 4px solid var(--purple); }

.reviews {
  margin-top: 24px;
}

.review-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.welcome-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, var(--safe-top)) 24px max(24px, var(--safe-bottom));
}

.welcome-card {
  width: min(560px, 100%);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(24px, 5vw, 32px);
  box-shadow: var(--shadow);
  text-align: center;
}

.welcome-card h1 {
  margin-top: 0;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
}

.wa-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.wa-links .btn {
  width: 100%;
}

/* ── Large desktop ── */
@media (min-width: 1400px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .main-column {
    align-items: center;
  }

  .mobile-toolbar,
  .bottom-nav {
    width: 100%;
    max-width: calc(var(--content-max) + 56px);
  }
}

/* ── Tablet landscape / small laptop ── */
@media (max-width: 1100px) {
  :root {
    --sidebar-width: 220px;
  }

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

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

  .checkout-panel {
    position: static;
  }
}

/* ── Tablet portrait / large phone ── */
@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-desktop {
    display: none;
  }

  .mobile-toolbar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: max(10px, var(--safe-top)) 16px 12px;
  }

  .mobile-toolbar-actions {
    display: flex;
    gap: 8px;
  }

  .mobile-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    align-items: center;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mobile-brand .brand-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .mobile-brand strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .mobile-brand small {
    display: block;
    color: var(--text-light);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-locality-row {
    grid-column: 1 / -1;
  }

  .mobile-locality-row select {
    width: 100%;
  }

  .bottom-nav {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 10px 8px calc(8px + var(--safe-bottom));
    box-shadow: 0 -8px 24px rgba(31, 41, 55, 0.06);
    border-radius: 20px 20px 0 0;
  }

  .bottom-nav__group {
    display: flex;
    flex: 1;
    min-width: 0;
  }

  .bottom-nav__group--left,
  .bottom-nav__group--right {
    justify-content: space-around;
  }

  .bottom-nav__group--center {
    flex: 0 0 72px;
    justify-content: center;
    align-items: flex-end;
  }

  .bottom-nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 12px;
    min-height: 56px;
    position: relative;
    flex: 1;
    min-width: 0;
  }

  .bottom-nav-item.nav-home-btn {
    width: 56px;
    height: 56px;
    min-height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(185, 28, 28, 0.35);
    margin-bottom: 10px;
    flex: 0 0 56px;
    padding: 0;
  }

  .bottom-nav-item.nav-home-btn .nav-icon,
  .bottom-nav-item.nav-home-btn .nav-label {
    color: #fff;
  }

  .bottom-nav-item.nav-home-btn.active {
    background: linear-gradient(135deg, var(--red-dark), #5c1212);
    color: #fff;
  }

  .bottom-nav-item .nav-icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  .bottom-nav-item .nav-label {
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .bottom-nav-item .badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 24px);
    margin: 0;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  .main-area {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    max-width: none;
  }

  .topbar {
    top: 0;
  }

  .menu-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .menu-categories {
    position: sticky;
    top: calc(var(--mobile-toolbar-height) - 12px);
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    max-height: none;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .menu-categories::-webkit-scrollbar {
    display: none;
  }

  .menu-categories button {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 14px;
  }

  .search-box {
    flex: 1 1 100%;
    max-width: none;
    order: 3;
  }

  .topbar-actions {
    margin-left: 0;
    width: 100%;
    order: 2;
  }

  .topbar-actions .btn {
    flex: 1;
  }

  .toast {
    bottom: calc(var(--bottom-nav-height) + 16px + var(--safe-bottom));
  }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  :root {
    --mobile-toolbar-height: 128px;
  }

  .content {
    padding: 14px;
    padding-bottom: 24px;
  }

  .topbar {
    padding: 14px;
    gap: 10px;
  }

  .featured-grid,
  .restaurant-grid,
  .promo-grid,
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .featured-carousel__track .card {
    flex-basis: min(240px, 82vw);
    width: min(240px, 82vw);
  }

  .restaurant-header {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .restaurant-header img,
  .restaurant-header .card-image {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .qty-controls {
    justify-content: flex-start;
  }

  .card-clickable:hover {
    transform: none;
  }
}

/* ── Very small screens ── */
@media (max-width: 380px) {
  .bottom-nav-item .nav-label {
    font-size: 0.62rem;
  }

  .topbar h2 {
    font-size: 1rem;
  }
}

/* ── Dark mode ── */
[data-theme="dark"],
:root:not([data-theme="light"]):not([data-theme="dark"]) {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
  --cream: #0f1115;
  --white: #1a1d24;
  --text: #f3f4f6;
  --text-light: #9ca3af;
  --border: #374151;
  --red-light: #3f1d1d;
  --green-light: #064e3b;
  --gold-light: #78350f;
  --purple-light: #4c1d95;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme-mode="system"]:not([data-theme="light"]) {
    color-scheme: dark;
    --cream: #0f1115;
    --white: #1a1d24;
    --text: #f3f4f6;
    --text-light: #9ca3af;
    --border: #374151;
    --red-light: #3f1d1d;
    --green-light: #064e3b;
    --gold-light: #78350f;
    --purple-light: #4c1d95;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

.profile-divider {
  margin: 24px 0;
  border: none;
  border-top: 1px solid var(--border);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.theme-option {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  font-size: 0.82rem;
}

.theme-option.active {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red-dark);
  font-weight: 600;
}

[data-theme="dark"] .theme-option.active {
  color: var(--text);
}

/* ── Search autocomplete ── */
.search-box {
  position: relative;
}

.search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 40;
  max-height: 280px;
  overflow-y: auto;
}

.search-box.open .search-suggestions {
  display: block;
}

.search-suggestion {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.search-suggestion:hover,
.search-suggestion:focus {
  background: var(--cream);
}

.search-suggestion small {
  color: var(--text-light);
  font-size: 0.75rem;
}

.search-suggestion.muted {
  justify-content: center;
  color: var(--text-light);
  font-size: 0.82rem;
}

/* ── Filter panel ── */
.filter-panel {
  width: min(480px, 100%);
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.filter-group {
  margin: 18px 0;
}

.filter-label {
  margin: 0 0 10px;
  color: var(--text-light);
  font-size: 0.85rem;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}

.filter-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

.filter-chips {
  margin: 0;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

/* ── Skeleton loaders ── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.35) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 10px;
}

[data-theme="dark"] .skeleton,
:root[data-theme-mode="system"] .skeleton {
  background: linear-gradient(90deg, #2a3140 25%, #3a4354 37%, #2a3140 63%);
  background-size: 400% 100%;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton-card {
  overflow: hidden;
}

.skeleton-image {
  aspect-ratio: 16 / 10;
  border-radius: 0;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-line.wide { width: 85%; }
.skeleton-line.short { width: 45%; }

.skeleton-button {
  height: 44px;
  margin-top: 12px;
}

.closed-notice {
  padding: 14px;
  margin-bottom: 16px;
  background: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
}

/* ── Cart animations ── */
.cart-bounce {
  animation: cartBounce 0.55s ease;
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.12); }
  65% { transform: scale(0.96); }
}

.added-pulse {
  animation: addedPulse 0.45s ease;
}

@keyframes addedPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.94); background: var(--green); }
  100% { transform: scale(1); }
}

.cart-fly {
  position: fixed;
  z-index: 300;
  transform: translate(-50%, -50%) scale(1);
  background: var(--red);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  pointer-events: none;
  transition: transform 0.65s cubic-bezier(.2,.8,.2,1), opacity 0.65s ease;
}

.cart-fly-active {
  transform: translate(calc(-50% + 120px), calc(-50% + 220px)) scale(0.4);
  opacity: 0;
}

.toast.success {
  background: var(--green);
}

.toast.error {
  background: var(--red-dark);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn:active,
  .card-clickable:hover {
    transform: none;
  }

  .sync-dot.syncing {
    animation: none;
  }

  .featured-carousel {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .featured-carousel__track {
    animation: none;
  }

  .skeleton {
    animation: none;
  }

  .cart-fly,
  .cart-bounce,
  .added-pulse {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Promos stories (Instagram-style) ── */

.view-promos {
  background: #000;
}

.view-promos .main-column {
  background: #000;
}

.view-promos .main-area {
  max-width: none;
  padding: 0;
  flex: 1;
  min-height: 0;
}

.view-promos .mobile-toolbar {
  display: none;
}

.promos-stories-screen {
  position: relative;
  flex: 1;
  min-height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom));
  background: #000;
  color: #fff;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

@media (min-width: 961px) {
  .promos-stories-screen {
    min-height: 100dvh;
  }
}

.promo-story-stage {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.promo-story-media,
.promo-story-image,
.promo-story-fallback {
  width: 100%;
  height: 100%;
}

.promo-story-media {
  display: grid;
  place-items: center;
  background: #111;
}

.promo-story-image {
  object-fit: cover;
  object-position: center;
}

.promo-story-fallback {
  display: grid;
  place-items: center;
  font-size: clamp(3rem, 12vw, 4.5rem);
  background: #111;
}

.promo-story-gradient {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.promo-story-gradient-top {
  top: 0;
  height: 140px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.2), transparent);
}

.promo-story-gradient-bottom {
  bottom: 0;
  height: 180px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.25), transparent);
}

.promo-story-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: max(8px, var(--safe-top)) 10px 0;
}

.promo-story-progress {
  display: flex;
  gap: 4px;
  padding: 8px 2px;
}

.promo-story-progress-track {
  flex: 1;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.promo-story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: inherit;
  transition: width 80ms linear;
}

.promo-story-meta-row {
  display: flex;
  align-items: center;
  padding: 0 2px 8px;
}

.promo-story-restaurant {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.promo-story-restaurant.disabled {
  cursor: default;
}

.promo-story-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.promo-story-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-story-avatar-emoji {
  font-size: 1rem;
}

.promo-story-restaurant-text {
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.promo-story-tag {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  font-weight: 500;
}

.promo-story-add-btn {
  position: absolute;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 4;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.promo-story-refresh-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 5;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: promo-story-refresh 1.1s ease-in-out infinite;
}

@keyframes promo-story-refresh {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.promo-story-loading,
.promo-story-empty {
  min-height: inherit;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 12px;
  padding: 32px;
}

.promo-story-empty h2 {
  margin: 0;
  font-size: 1.35rem;
}

.promo-story-empty p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  max-width: 320px;
}

.promo-story-empty-icon {
  font-size: 3rem;
  opacity: 0.75;
}

.promo-story-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: promo-story-spin 0.8s linear infinite;
}

@keyframes promo-story-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 960px) {
  .view-promos .main-area {
    padding-bottom: 0;
  }

  .promos-stories-screen {
    min-height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom));
  }
}
