/**
 * ============================================================
 *  ZAPTOU — Marketplace Premium Redesign
 *  Reference: Wagba-style food delivery app
 *  Mobile-first + Desktop responsive
 *  Depende de: design-system.css (tokens CSS)
 * ============================================================
 */

/* ── 0. DESIGN TOKENS ───────────────────────────────────── */
/* Aliases locais apontam para o DS canônico (design-system.css).
   Valores próprios do marketplace (bg-soft, bg-page) são intencionais. */
:root {
  --mp-primary: var(--z-primary, #ff5c00);
  --mp-primary-dark: #e54f00;
  --mp-primary-light: var(--z-primary-glow, rgba(255, 92, 0, 0.08));
  --mp-primary-gradient: linear-gradient(135deg, var(--z-primary, #ff5c00) 0%, var(--z-primary-light, #ff8533) 100%);
  --mp-success: var(--z-accent-light, #10b981);
  --mp-error: var(--z-danger, #ef4444);
  --mp-text: var(--z-text, #1a1a2e);
  --mp-text-secondary: var(--z-text-secondary, #64748b);
  --mp-text-muted: var(--z-text-muted, #94a3b8);
  --mp-border: var(--z-border, #e2e8f0);
  --mp-bg: var(--z-surface, #ffffff);
  --mp-bg-soft: #faf5f2;
  --mp-bg-page: #fbf8f5;
  --mp-radius: var(--z-radius-xl, 20px);
  --mp-radius-sm: var(--z-radius-sm, 14px);
  --mp-radius-xs: 8px;
  --mp-radius-pill: var(--z-radius-pill, 999px);
  --mp-shadow-sm: var(--z-shadow-sm, 0 4px 16px rgba(26, 26, 46, 0.05));
  --mp-shadow-md: var(--z-shadow-md, 0 8px 24px rgba(26, 26, 46, 0.09));
  --mp-shadow-lg: var(--z-shadow-lg, 0 12px 32px rgba(26, 26, 46, 0.14));
  --mp-transition: var(--z-transition, all 0.25s cubic-bezier(0.16, 1, 0.3, 1));
}

/* ── 1. BASE (reset global já em design-system.css §2) ──── */
/* box-sizing reset herdado do DS; apenas overrides específicos aqui */
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* O DS não zera o margin UA do body (8px) — isso deslocava todo o app
   do marketplace p/ a direita no mobile, com corte à direita pelo
   overflow-x:hidden. Zerando aqui, vale para todas as telas /app/*. */
body { margin: 0; overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
.material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
  font-variation-settings: "wght" 420, "opsz" 24;
}

/* ── 2. MOBILE APP SHELL ────────────────────────────────── */
.mp-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--mp-bg);
  position: relative;
}

/* ── 3. DESKTOP HEADER ──────────────────────────────────── */
.mp-desktop-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--mp-bg);
  border-bottom: 1px solid var(--mp-border);
  width: 100%;
}

.mp-desktop-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
}

.mp-desktop-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--mp-text);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--mp-primary);
  flex-shrink: 0;
}

.mp-desktop-logo img {
  height: 150px;
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

.mp-desktop-search {
  flex: 1;
  max-width: 400px;
  height: 44px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-pill);
  background: var(--mp-bg-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  transition: var(--mp-transition);
}

.mp-location-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  flex-shrink: 0;
  height: 44px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-pill);
  background: var(--mp-bg-soft);
  padding: 0 14px;
  text-decoration: none;
  color: var(--mp-text);
  transition: var(--mp-transition);
}

.mp-location-pill:hover {
  border-color: var(--mp-primary);
  background: #ffffff;
}

.mp-location-pill span#desktopAddressText {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  display: inline-block;
}

.mp-desktop-search:focus-within {
  border-color: var(--mp-primary);
  box-shadow: 0 0 0 3px var(--mp-primary-light);
}

.mp-desktop-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.9rem;
  color: var(--mp-text);
}

.mp-desktop-search input::placeholder {
  color: var(--mp-text-muted);
}

.mp-desktop-search .material-symbols-outlined {
  color: var(--mp-text-muted);
  font-size: 20px;
}

/* ── Marketplace Main Layout & Footer ───────────────────── */
.mp-main-container,
.mp-search-results {
  max-width: 1200px;
  margin: 32px auto 48px auto;
  padding: 0 32px;
  min-height: calc(100vh - 320px);
}

.mp-desktop-footer {
  display: none;
  background: #ffffff;
  border-top: 1px solid var(--mp-border);
  padding: 48px 0 24px 0;
  margin-top: 48px;
  color: var(--mp-text-secondary);
  font-size: 0.88rem;
}

@media (min-width: 769px) {
  .mp-desktop-footer {
    display: block;
  }
}

.mp-desktop-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.mp-desktop-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.mp-desktop-footer-brand p {
  margin-top: 12px;
  line-height: 1.5;
  color: var(--mp-text-secondary);
  font-size: 0.88rem;
  max-width: 320px;
}

.mp-desktop-footer-col h4 {
  color: var(--mp-text);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.mp-desktop-footer-col a {
  display: block;
  color: var(--mp-text-secondary);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.mp-desktop-footer-col a:hover {
  color: var(--mp-primary);
}

.mp-desktop-footer-bottom {
  border-top: 1px solid var(--mp-border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--mp-text-muted);
}

.mp-desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.mp-desktop-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--mp-radius-xs);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mp-text-secondary);
  text-decoration: none;
  transition: var(--mp-transition);
  white-space: nowrap;
}

.mp-desktop-nav a:hover {
  color: var(--mp-primary);
  background: var(--mp-primary-light);
}

.mp-desktop-nav a.active {
  color: var(--mp-primary);
  background: var(--mp-primary-light);
}

.mp-desktop-nav .material-symbols-outlined {
  font-size: 20px;
}

/* ── 4. TOP BAR ─────────────────────────────────────────── */
.mp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  background: var(--mp-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Hide mobile topbar on desktop */
@media (min-width: 769px) {
  .mp-topbar {
    display: none !important;
  }
  .mp-desktop-header {
    display: flex !important;
  }
  .mp-demo-banner-mobile {
    display: none !important;
  }
}

/* Store page: show header on desktop */
@media (min-width: 769px) {
  .mp-desktop-header {
    display: flex !important;
  }
}

.mp-topbar-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--mp-text-secondary);
}

.mp-topbar-location .material-symbols-outlined {
  color: var(--mp-primary);
  font-size: 18px;
}

.mp-topbar-location strong {
  color: var(--mp-text);
  font-weight: 700;
}

.mp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mp-topbar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--mp-text);
  transition: var(--mp-transition);
}

.mp-topbar-btn:hover {
  background: var(--mp-primary-light);
  color: var(--mp-primary);
}

/* ── 4. SEARCH BAR ──────────────────────────────────────── */
.mp-search-bar {
  margin: 8px 20px 16px;
  position: relative;
}

/* Hide mobile search on desktop (header has its own) */
@media (min-width: 769px) {
  .mp-search-mobile {
    display: none !important;
  }
}

.mp-search-bar input {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--mp-radius);
  background: var(--mp-bg-soft);
  padding: 0 16px 0 48px;
  font-size: 0.9rem;
  color: var(--mp-text);
  transition: var(--mp-transition);
}

.mp-search-bar input:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px var(--mp-primary);
}

.mp-search-bar input::placeholder {
  color: var(--mp-text-muted);
}

.mp-search-bar .material-symbols-outlined {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mp-text-muted);
  font-size: 20px;
}

/* ── 5. PROMO BANNER ────────────────────────────────────── */
.mp-promo-banner {
  margin: 0 20px 24px;
  border-radius: var(--mp-radius);
  background: var(--mp-primary-gradient);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 120px;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.mp-promo-content {
  flex: 1;
  z-index: 2;
}

.mp-promo-content h2 {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  max-width: 180px;
}

.mp-promo-btn {
  display: inline-block;
  background: #fff;
  color: var(--mp-primary);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 8px 16px;
  border-radius: var(--mp-radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: var(--mp-transition);
}

.mp-promo-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--mp-shadow-md);
}

.mp-promo-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 2;
}

.mp-promo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── 6. CATEGORY PILLS ──────────────────────────────────── */
.mp-category-section {
  padding: 0 20px 24px;
}

.mp-category-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--mp-text);
}

.mp-category-pills {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.mp-category-pills:focus-visible {
  outline: 2px solid var(--mp-primary);
  outline-offset: 4px;
  border-radius: 8px;
}

.mp-category-pills::-webkit-scrollbar { display: none; }

.mp-category-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--mp-radius-pill);
  background: #fff;
  border: 1.5px solid var(--mp-border);
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mp-text);
  cursor: pointer;
  transition: var(--mp-transition);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.mp-category-pill:hover,
.mp-category-pill.active {
  border-color: var(--mp-primary);
  background: var(--mp-primary-light);
  color: var(--mp-primary);
  box-shadow: 0 4px 12px rgba(255, 92, 0, 0.15);
}

.mp-category-pill .material-symbols-outlined {
  font-size: 20px;
}

/* ── 7. PROMO BANNER CAROUSEL ──────────────────────────── */
.mp-banner-carousel {
  margin: 0 20px 24px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.mp-banner-track {
  display: flex;
  transition: transform 0.5s ease;
}

.mp-banner-slide {
  min-width: 100%;
  position: relative;
}

.mp-banner-slide img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 20px;
}

.mp-banner-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.mp-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: var(--mp-transition);
}

.mp-banner-dot.active {
  background: #fff;
  width: 24px;
  border-radius: 4px;
}

.mp-banner-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: var(--mp-transition);
  z-index: 10;
}

.mp-banner-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.mp-banner-nav.prev { left: 12px; }
.mp-banner-nav.next { right: 12px; }

@media (min-width: 769px) {
  .mp-banner-carousel {
    margin: 24px 32px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .mp-banner-slide img {
    height: 200px;
  }
}

.mp-category-pill:hover,
.mp-category-pill.active {
  border-color: var(--mp-primary);
  background: var(--mp-primary-light);
  color: var(--mp-primary);
}

.mp-category-pill .material-symbols-outlined {
  font-size: 18px;
}

/* ── 7. STORE CARDS (Horizontal scroll) ─────────────────── */
.mp-stores-section {
  padding: 0 0 24px;
}

.mp-stores-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 16px;
}

.mp-stores-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mp-text);
}

.mp-stores-see-all {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mp-primary);
  text-decoration: none;
}

.mp-stores-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 20px 8px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.mp-stores-scroll:focus-visible {
  outline: 2px solid var(--mp-primary);
  outline-offset: 4px;
  border-radius: 8px;
}

.mp-stores-scroll::-webkit-scrollbar { display: none; }

/* ── 8. MEAL CARD (Vertical) ────────────────────────────── */
.mp-meal-card {
  min-width: 160px;
  max-width: 180px;
  flex: 0 0 auto;
  border-radius: var(--mp-radius);
  background: var(--mp-bg);
  overflow: hidden;
  border: 1px solid #f1f5f9;
  box-shadow: var(--mp-shadow-sm);
  transition: var(--mp-transition);
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  position: relative;
}

.mp-meal-card:hover {
  box-shadow: var(--mp-shadow-md);
  transform: translateY(-4px);
  border-color: rgba(255, 92, 0, 0.25);
}

.mp-meal-card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: var(--mp-bg-soft);
}

.mp-meal-card-body {
  padding: 12px;
}

.mp-meal-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mp-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-meal-card-store {
  font-size: 0.72rem;
  color: var(--mp-text-muted);
  margin-bottom: 8px;
}

/* Dados de entrega calculados pelo marketplace (distÃ¢ncia e prazo da faixa). */
.mp-marketplace-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  min-height: 18px;
  margin: -2px 0 9px;
  color: var(--mp-text-muted);
  font-size: .69rem;
  line-height: 1.2;
}

.mp-marketplace-card-facts span,
.mp-store-distance {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.mp-marketplace-card-facts .material-symbols-outlined,
.mp-store-distance .material-symbols-outlined {
  font-size: 13px;
  color: var(--mp-primary);
}

.mp-marketplace-offer-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  padding: 4px 7px;
  background: #dc2626;
  color: #fff;
  box-shadow: 0 2px 8px rgba(127, 29, 29, .28);
  font-size: .65rem;
  font-weight: 800;
}

.mp-marketplace-offer-badge .material-symbols-outlined { font-size: 13px; }

.mp-meal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mp-meal-card-price {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--mp-primary);
}

.mp-meal-card-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  color: #f59e0b;
  font-weight: 600;
}

.mp-meal-card-add {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--mp-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 92, 0, 0.3);
  transition: var(--mp-transition);
  font-size: 18px;
}

.mp-meal-card-add:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 92, 0, 0.4);
}

/* ── 9. STORE CARD (List item) ──────────────────────────── */
.mp-store-list {
  padding: 0 20px;
}

.mp-store-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--mp-border);
  text-decoration: none;
  color: inherit;
  transition: var(--mp-transition);
}

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

.mp-store-item:hover { opacity: 0.85; }

.mp-store-item-logo {
  width: 72px;
  height: 72px;
  border-radius: var(--mp-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--mp-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
}

.mp-store-item-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-store-item-info {
  flex: 1;
  min-width: 0;
}

.mp-store-item-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mp-text);
  margin-bottom: 4px;
}

.mp-store-item-meta {
  font-size: 0.78rem;
  color: var(--mp-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.mp-store-item-meta .rating {
  color: #f59e0b;
  font-weight: 600;
}

.mp-store-item-delivery {
  font-size: 0.75rem;
  color: var(--mp-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mp-store-item-delivery .free {
  color: var(--mp-success);
  font-weight: 600;
}

/* Estado operacional das lojas no marketplace */
.mp-store-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}

.mp-store-status.is-open { background: #15803d; }
.mp-store-status.is-closed { background: #3f3f46; }

.mp-store-status-overlay {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  margin-left: 0;
}

.mp-store-open .mp-meal-card-img,
.mp-store-open .mp-store-item-logo {
  filter: grayscale(0) saturate(1.06);
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.mp-store-closed {
  background-color: #f4f4f5 !important;
}

.mp-store-closed .mp-meal-card-img,
.mp-store-closed .mp-store-item-logo {
  filter: grayscale(1) saturate(0) brightness(0.82);
  opacity: 0.72;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.mp-store-closed .mp-meal-card-body,
.mp-store-closed .mp-store-item-info {
  filter: grayscale(1);
  opacity: 0.78;
}

.mp-store-closed .mp-store-status {
  filter: none;
  opacity: 1;
}

/* Grade de lojas: cartões compactos no desktop e lista de leitura rápida no mobile. */
@media (min-width: 900px) {
  .mp-store-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 28px;
    padding: 4px 20px 24px;
  }

  .mp-store-item {
    min-width: 0;
    align-items: center;
    padding: 12px 0;
    border-bottom: 0;
    border-radius: 14px;
  }

  .mp-store-item:hover { background: #fff7f2; opacity: 1; }
  .mp-store-item-logo { width: 78px; height: 78px; border-radius: 16px; }
  .mp-store-item-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mp-store-item-meta { flex-wrap: wrap; gap: 4px; }
  .mp-store-status { margin: 6px 0 0; }
}

@media (max-width: 899px) {
  .mp-store-list { padding: 0 16px 20px; }
  .mp-store-item { gap: 12px; padding: 14px 0; align-items: center; }
  .mp-store-item-logo { width: 76px; height: 76px; border-radius: 50%; }
  .mp-store-item-name { line-height: 1.25; }
  .mp-store-item-meta { flex-wrap: wrap; row-gap: 2px; }
  .mp-store-item-delivery { flex-wrap: wrap; }
  .mp-category-pills { padding-inline: 16px; overflow-x: auto; scrollbar-width: none; }
  .mp-category-pill { flex: 0 0 auto; }
}

/* Desktop ocupa a largura útil da página, mantendo apenas margens de respiro. */
@media (min-width: 1200px) {
  .mp-app { max-width: none; margin: 0; }
  .mp-desktop-header-inner,
  .mp-desktop-footer-inner { max-width: none; padding-left: clamp(28px, 5vw, 96px); padding-right: clamp(28px, 5vw, 96px); }
  .mp-main-container,
  .mp-search-results { max-width: none; margin: 28px 0 56px; padding-left: clamp(28px, 5vw, 96px); padding-right: clamp(28px, 5vw, 96px); }
  .mp-banner-carousel { max-width: none; margin-left: clamp(28px, 5vw, 96px); margin-right: clamp(28px, 5vw, 96px); }
}

/* Shared desktop shell: prevents content from colliding with the header and
   keeps the correct footer at the bottom when a page has little content. */
@media (min-width: 769px) {
  .mp-app {
    max-width: none;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .mp-desktop-header {
    flex: 0 0 auto;
  }

  .mp-main-container,
  .mp-search-results,
  .mp-app > main,
  .mp-app > .mp-tab-content.active {
    flex: 1 0 auto;
  }

  .mp-main-container,
  .mp-search-results {
    width: min(100%, 1560px);
    margin: 32px auto 48px;
    padding-left: clamp(32px, 5vw, 112px);
    padding-right: clamp(32px, 5vw, 112px);
  }

  .mp-desktop-footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 28px 0 18px;
  }

  .mp-desktop-footer-grid {
    margin-bottom: 22px;
  }

  .mp-desktop-footer-col a {
    margin-bottom: 6px;
  }

  .mp-desktop-footer-bottom {
    padding-top: 16px;
  }

  .mp-orders-tabs {
    width: min(100%, 1560px);
    margin: 24px auto 0;
    padding: 0 clamp(32px, 5vw, 112px);
    border: 0;
  }

  .mp-orders-tab {
    min-height: 48px;
    border: 1px solid var(--mp-border);
  }

  .mp-app > .mp-tab-content.active {
    width: min(100%, 1560px);
    margin: 0 auto;
    padding: 28px clamp(32px, 5vw, 112px) 48px;
  }

  .mp-store-list {
    align-content: start;
  }
}

/* ── 10. BOTTOM NAV ─────────────────────────────────────── */
.mp-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 64px;
  background: var(--mp-bg);
  border-top: 1px solid var(--mp-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mp-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--mp-text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--mp-radius-xs);
  transition: var(--mp-transition);
  text-decoration: none;
  position: relative;
  min-width: 56px;
}

.mp-nav-item:hover,
.mp-nav-item.active {
  color: var(--mp-primary);
}

.mp-nav-item .material-symbols-outlined {
  font-size: 24px;
}

.mp-nav-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mp-primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Cart nav item highlight */
.mp-nav-item-cart {
  position: relative;
}

.mp-nav-item-cart .material-symbols-outlined {
  width: 44px;
  height: 44px;
  background: var(--mp-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(255, 92, 0, 0.3);
  margin-top: -12px;
}

/* ── 10b. FOOTER ────────────────────────────────────────── */
.mp-footer {
  background: #1a1a2e;
  color: #94a3b8;
  padding: 32px 20px 20px;
  margin-top: 40px;
  display: none;
}

.mp-footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.mp-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.mp-footer-brand img {
  height: 24px;
  width: auto;
}

.mp-footer-brand span {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.mp-footer h4 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.mp-footer a {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  text-decoration: none;
  padding: 2px 0;
  transition: color 0.2s;
}

.mp-footer a:hover {
  color: var(--mp-primary);
}

.mp-footer-bottom {
  max-width: 1200px;
  margin: 16px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
}

/* Store page footer (light theme) */
.footer {
  background: #fff;
  border-top: 1px solid var(--mp-border);
  padding: 32px 20px 20px;
  display: none;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.footer h3 {
  color: var(--mp-text);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer a, .footer p {
  color: var(--mp-text-secondary);
  font-size: 0.8rem;
  line-height: 1.6;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--mp-border);
  padding-top: 16px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--mp-text-muted);
}

@media (min-width: 769px) {
  .mp-footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .mp-footer {
    display: block;
  }
  .footer {
    display: block;
  }
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── 11. PAGE HEADER (Sub pages) ────────────────────────── */
.mp-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--mp-bg);
  border-bottom: 1px solid var(--mp-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.mp-page-header .back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--mp-text);
  transition: var(--mp-transition);
}

.mp-page-header .back-btn:hover {
  background: var(--mp-bg-soft);
}

.mp-page-header h1 {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mp-text);
}

/* ── 12. CART PAGE ──────────────────────────────────────── */
.mp-cart-items {
  padding: 0 20px;
}

.mp-cart-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--mp-border);
}

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

.mp-cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--mp-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--mp-bg-soft);
}

.mp-cart-item-info {
  flex: 1;
  min-width: 0;
}

.mp-cart-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mp-text);
  margin-bottom: 4px;
}

.mp-cart-item-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mp-primary);
  margin-bottom: 8px;
}

.mp-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--mp-border);
  border-radius: var(--mp-radius-pill);
  overflow: hidden;
}

.mp-cart-qty button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--mp-text);
  font-size: 16px;
  transition: var(--mp-transition);
}

.mp-cart-qty button:hover { background: var(--mp-bg-soft); }

.mp-cart-qty span {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.mp-cart-summary {
  padding: 20px;
  background: var(--mp-bg);
  border-top: 1px solid var(--mp-border);
}

.mp-cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--mp-text-secondary);
  padding: 6px 0;
}

.mp-cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--mp-text);
  padding-top: 12px;
  border-top: 1px solid var(--mp-border);
  margin-top: 8px;
}

.mp-cart-summary-total span:last-child { color: var(--mp-primary); }

/* ── 13. CHECKOUT PAGE ──────────────────────────────────── */
.mp-checkout-section {
  background: var(--mp-bg);
  border-radius: var(--mp-radius);
  padding: 20px;
  margin: 0 20px 16px;
  box-shadow: var(--mp-shadow-sm);
}

.mp-checkout-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mp-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-checkout-section-title .material-symbols-outlined {
  color: var(--mp-primary);
  font-size: 20px;
}

.mp-checkout-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid var(--mp-border);
  border-radius: var(--mp-radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--mp-transition);
}

.mp-checkout-option:hover,
.mp-checkout-option.selected {
  border-color: var(--mp-primary);
  background: var(--mp-primary-light);
}

.mp-checkout-option input[type="radio"] {
  accent-color: var(--mp-primary);
}

.mp-checkout-input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--mp-border);
  border-radius: var(--mp-radius-sm);
  padding: 0 14px;
  font-size: 0.9rem;
  background: var(--mp-bg);
  color: var(--mp-text);
  transition: var(--mp-transition);
}

.mp-checkout-input:focus {
  outline: none;
  border-color: var(--mp-primary);
  box-shadow: 0 0 0 3px var(--mp-primary-light);
}

/* ── 14. PRIMARY BUTTON ─────────────────────────────────── */
.mp-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--mp-radius);
  background: var(--mp-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--mp-transition);
  text-decoration: none;
}

.mp-btn-primary:hover {
  background: var(--mp-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--mp-shadow-md);
}

/* ── 15. ORDER CONFIRMATION ─────────────────────────────── */
.mp-order-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.mp-order-done-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.mp-order-done h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--mp-text);
  margin-bottom: 8px;
}

.mp-order-done p {
  font-size: 0.9rem;
  color: var(--mp-text-secondary);
  margin-bottom: 24px;
}

/* ── 16. PROFILE PAGE ───────────────────────────────────── */
.mp-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
  background: var(--mp-bg);
}

.mp-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--mp-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}

.mp-profile-avatar .material-symbols-outlined {
  font-size: 36px;
  color: var(--mp-primary);
}

.mp-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mp-text);
  margin-bottom: 4px;
}

.mp-profile-phone {
  font-size: 0.85rem;
  color: var(--mp-text-secondary);
}

.mp-profile-menu {
  padding: 0 20px;
}

.mp-profile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--mp-border);
  text-decoration: none;
  color: var(--mp-text);
  transition: var(--mp-transition);
}

.mp-profile-menu-item:last-child { border-bottom: none; }

.mp-profile-menu-item:hover { opacity: 0.7; }

.mp-profile-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--mp-radius-sm);
  background: var(--mp-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mp-primary);
}

.mp-profile-menu-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
}

.mp-profile-menu-arrow {
  color: var(--mp-text-muted);
}

/* ── 17. LOGIN PAGE ─────────────────────────────────────── */
.mp-login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--mp-bg);
}

.mp-login-hero {
  background: var(--mp-primary-gradient);
  padding: 60px 24px 80px;
  text-align: center;
  color: #fff;
  border-radius: 0 0 32px 32px;
}

.mp-login-hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.mp-login-hero p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.mp-login-form {
  padding: 32px 24px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.mp-login-input {
  width: 100%;
  height: 52px;
  border: 1.5px solid var(--mp-border);
  border-radius: var(--mp-radius);
  padding: 0 16px;
  font-size: 1rem;
  background: var(--mp-bg);
  margin-bottom: 12px;
  transition: var(--mp-transition);
}

.mp-login-input:focus {
  outline: none;
  border-color: var(--mp-primary);
  box-shadow: 0 0 0 3px var(--mp-primary-light);
}

.mp-login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--mp-text-muted);
  font-size: 0.8rem;
}

.mp-login-divider::before,
.mp-login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--mp-border);
}

.mp-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-bg);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--mp-transition);
  margin-bottom: 10px;
}

.mp-social-btn:hover {
  border-color: var(--mp-primary);
  background: var(--mp-primary-light);
}

.mp-login-footer {
  text-align: center;
  padding: 16px 24px;
  font-size: 0.85rem;
  color: var(--mp-text-secondary);
}

.mp-login-footer a {
  color: var(--mp-primary);
  font-weight: 600;
}

/* ── 18. ORDERS PAGE ────────────────────────────────────── */
.mp-orders-tabs {
  display: flex;
  border-bottom: 1px solid var(--mp-border);
  padding: 0 20px;
}

.mp-orders-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mp-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--mp-transition);
}

.mp-orders-tab.active {
  color: var(--mp-primary);
  border-bottom-color: var(--mp-primary);
}

.mp-order-card {
  background: var(--mp-bg);
  border-radius: var(--mp-radius);
  padding: 16px;
  margin: 12px 20px;
  box-shadow: var(--mp-shadow-sm);
}

.mp-order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mp-order-card-store {
  font-weight: 700;
  font-size: 0.95rem;
}

.mp-order-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--mp-radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
}

.mp-order-status.active { background: #dcfce7; color: #16a34a; }
.mp-order-status.pending { background: #fef3c7; color: #d97706; }
.mp-order-status.done { background: #f3f4f6; color: #6b7280; }
.mp-order-status.cancelled { background: #fef2f2; color: #dc2626; }

.mp-order-card-items {
  font-size: 0.85rem;
  color: var(--mp-text-secondary);
  margin-bottom: 8px;
}

.mp-order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mp-order-card-total {
  font-weight: 800;
  color: var(--mp-text);
}

.mp-order-track-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--mp-radius-pill);
  background: var(--mp-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--mp-transition);
}

.mp-order-track-btn:hover {
  background: var(--mp-primary-dark);
}

/* ── 19. DESKTOP LAYOUT ─────────────────────────────────── */
@media (min-width: 769px) {
  /* Hide mobile bottom nav on desktop */
  .mp-bottom-nav {
    display: none !important;
  }

  /* Show desktop header nav */
  .mp-desktop-header {
    display: flex !important;
  }

  /* Hide mobile topbar on desktop */
  .mp-topbar {
    display: none !important;
  }

  /* Hide mobile demo banner on desktop */
  .mp-demo-banner-mobile {
    display: none !important;
  }

  .mp-app {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 0;
    background: var(--mp-bg-page);
    min-height: 100vh;
  }

  /* Consistent section spacing */
  .mp-category-section {
    padding: 0 32px 24px;
    margin-bottom: 8px;
  }

  .mp-promo-banner {
    margin: 24px 32px;
    min-height: 140px;
    padding: 24px 32px;
    border-radius: 20px;
  }

  .mp-stores-section {
    margin-bottom: 32px;
  }

  .mp-stores-section-header {
    padding: 0 32px;
    margin-bottom: 16px;
  }

  /* Consistent card design */
  .mp-meal-card {
    min-width: 200px;
    max-width: 220px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
  }

  .mp-meal-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
  }

  .mp-meal-card-img {
    height: 150px;
    border-radius: 16px 16px 0 0;
  }

  /* Horizontal scroll section */
  .mp-stores-scroll {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 8px;
    gap: 20px;
  }

  /* Store grid - 4 columns */
  .mp-store-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 32px;
  }

  .mp-store-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    border: 1px solid var(--mp-border);
    border-radius: 16px;
    background: #fff;
    transition: all 0.2s ease;
  }

  .mp-store-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-4px);
    border-color: var(--mp-primary);
  }

  .mp-store-item-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    border-radius: 16px;
  }

  .mp-store-item-info {
    align-items: center;
  }

  .mp-store-item-meta {
    justify-content: center;
  }

  .mp-store-item-delivery {
    justify-content: center;
  }

  .mp-stores-section-header,
  .mp-cart-items,
  .mp-profile-menu {
    padding-left: 32px;
    padding-right: 32px;
  }

  .mp-checkout-section {
    margin-left: 32px;
    margin-right: 32px;
  }

  .mp-page-header {
    display: none !important;
  }

  /* Search results container */
  .mp-search-results {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
  }

  /* Category section */
  .mp-category-pills {
    gap: 12px;
    padding: 0;
  }

  .mp-category-pill {
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
  }
}

/* ── 20. FULL-WIDTH DESKTOP ─────────────────────────────── */
@media (min-width: 1024px) {
  .mp-app {
    max-width: 100%;
  }

  .mp-topbar,
  .mp-category-section,
  .mp-stores-section-header,
  .mp-store-list {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  .mp-search-bar {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .mp-promo-banner {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── 21. EMPTY STATES ───────────────────────────────────── */
.mp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--mp-text-muted);
}

.mp-empty-state .material-symbols-outlined {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.mp-empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mp-text);
  margin-bottom: 8px;
}

.mp-empty-state p {
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ── 22. TOAST ──────────────────────────────────────────── */
.mp-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--mp-text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--mp-radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--mp-shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.mp-toast.show { opacity: 1; }

/* ── 23. SKELETON LOADING ───────────────────────────────── */
.mp-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--mp-radius-sm);
}

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

/* ── 24. LOADING STATES ─────────────────────────────────── */
.mp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--mp-text-muted);
}

.mp-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--mp-border);
  border-top-color: var(--mp-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

.mp-loading-text {
  font-size: 0.85rem;
}

/* ── 25. FEEDBACK MESSAGES ──────────────────────────────── */
.mp-feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--mp-radius);
  margin: 12px 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.mp-feedback-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.mp-feedback-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.mp-feedback-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.mp-feedback .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
}

/* ── 24. UTILITIES ──────────────────────────────────────── */
.mp-hidden { display: none !important; }
.mp-text-center { text-align: center; }
.mp-mt-1 { margin-top: 8px; }
.mp-mt-2 { margin-top: 16px; }
.mp-mt-3 { margin-top: 24px; }
.mp-mb-1 { margin-bottom: 8px; }
.mp-mb-2 { margin-bottom: 16px; }
.mp-mb-3 { margin-bottom: 24px; }
.mp-p-2 { padding: 16px; }
.mp-p-3 { padding: 24px; }

/* ── 25. DEVICE DETECTION & TOUCH/MOUSE OPTIMIZATION ─────── */

/* Base: apply to all devices */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

/* Touch device optimizations (mobile/tablet) */
@media (hover: none) and (pointer: coarse) {
  /* Touch-specific: larger tap targets, no hover effects */
  html {
    -webkit-tap-highlight-color: rgba(255, 92, 0, 0.15);
  }

  /* Larger tap targets for touch */
  button, a, [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Disable hover effects on touch - use active instead */
  .mp-meal-card:hover,
  .mp-store-item:hover,
  .mp-category-pill:hover,
  .mp-nav-item:hover {
    transform: none;
    box-shadow: none;
  }

  .mp-meal-card:active,
  .mp-store-item:active,
  .mp-category-pill:active {
    transform: scale(0.98);
    opacity: 0.8;
  }

  /* Smooth touch scrolling for horizontal scrollers */
  .mp-category-pills,
  .mp-stores-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
  }

  .mp-category-pill,
  .mp-meal-card {
    scroll-snap-align: start;
  }

  /* Prevent accidental zoom on double-tap */
  button, input, select, textarea {
    touch-action: manipulation;
  }

  /* Prevent pull-to-refresh on mobile */
  body {
    overscroll-behavior-y: contain;
  }

  /* Fix iOS rubber-band scrolling */
  .mp-app {
    overscroll-behavior: contain;
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  /* Bottom nav safe area */
  .mp-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Prevent text selection on interactive elements */
  .mp-nav-item,
  .mp-category-pill,
  .mp-btn-primary,
  .mp-topbar-btn {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Mouse/pointer device optimizations (desktop) */
@media (hover: hover) and (pointer: fine) {
  /* Desktop: smooth mouse scrolling */
  html {
    scroll-behavior: smooth;
  }

  /* Mouse hover effects */
  .mp-meal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mp-shadow-lg);
  }

  .mp-store-item:hover {
    opacity: 0.9;
    background: var(--mp-bg-soft);
  }

  .mp-category-pill:hover {
    border-color: var(--mp-primary);
    background: var(--mp-primary-light);
    color: var(--mp-primary);
  }

  .mp-nav-item:hover {
    color: var(--mp-primary);
  }

  .mp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--mp-shadow-lg);
  }

  /* Custom scrollbar for desktop */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
  }

  /* Hide scrollbar on horizontal scrollers (desktop) */
  .mp-category-pills::-webkit-scrollbar,
  .mp-stores-scroll::-webkit-scrollbar {
    display: none;
  }

  /* Desktop: cursor styles */
  .mp-meal-card,
  .mp-store-item,
  .mp-category-pill,
  .mp-nav-item,
  .mp-btn-primary,
  .mp-promo-btn,
  .mp-order-track-btn {
    cursor: pointer;
  }

  /* Desktop: focus visible for accessibility */
  .mp-meal-card:focus-visible,
  .mp-store-item:focus-visible,
  .mp-category-pill:focus-visible,
  .mp-nav-item:focus-visible,
  .mp-btn-primary:focus-visible,
  .mp-login-input:focus-visible,
  .mp-search-bar input:focus-visible {
    outline: 2px solid var(--mp-primary);
    outline-offset: 2px;
  }
}

/* ── 26. MOBILE TOUCH SCROLL AREAS ───────────────────────── */
@media (max-width: 768px) {
  /* Enable momentum scrolling on main content */
  .mp-app {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Horizontal scroll containers */
  .mp-category-pills,
  .mp-stores-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .mp-category-pills::-webkit-scrollbar,
  .mp-stores-scroll::-webkit-scrollbar {
    display: none;
  }

  /* Cart drawer touch scroll */
  .mp-cart-drawer-body,
  .mp-mob-sheet {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Product detail scroll */
  .mp-product-detail-scroll {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* ── 27. DESKTOP LAYOUT OPTIMIZATIONS ────────────────────── */
@media (min-width: 769px) {
  /* Desktop: grid layouts */
  .mp-offers-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Desktop: hover cursor */
  a, button, [role="button"] {
    cursor: pointer;
  }

  /* Desktop: remove touch-specific styles */
  .mp-meal-card:active,
  .mp-store-item:active {
    transform: none;
  }
}

/* ── 28. RESPONSIVE TOUCH TARGETS ────────────────────────── */
@media (max-width: 480px) {
  /* Extra small screens: larger touch targets */
  .mp-nav-item {
    padding: 10px 12px;
  }

  .mp-topbar-btn {
    width: 44px;
    height: 44px;
  }

  .mp-category-pill {
    padding: 12px 18px;
  }

  .mp-meal-card-add {
    width: 36px;
    height: 36px;
  }
}

/* ── 29. iOS SAFARI FIXES ────────────────────────────────── */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific fixes */
  body {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent iOS bounce */
  .mp-app {
    overscroll-behavior: none;
  }

  /* Fix iOS input zoom on focus */
  .mp-login-input,
  .mp-search-bar input,
  .mp-checkout-input {
    font-size: 16px !important;
  }

  /* iOS safe area for bottom nav */
  .mp-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

/* ── 30. ANDROID CHROME FIXES ────────────────────────────── */
@supports not (-webkit-touch-callout: none) {
  /* Android/Chrome specific */
  .mp-app {
    overscroll-behavior-y: none;
  }
}

/* ── 31. REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .mp-meal-card,
  .mp-store-item,
  .mp-category-pill,
  .mp-btn-primary {
    transition: none !important;
  }
}

/* ── 32. HIGH CONTRAST / ACCESSIBILITY ───────────────────── */
@media (prefers-contrast: high) {
  .mp-meal-card,
  .mp-store-item,
  .mp-checkout-option {
    border-width: 2px;
  }

  .mp-nav-item.active {
    font-weight: 800;
  }
}

/* ── 33. DARK MODE SUPPORT (future) ──────────────────────── */
@media (prefers-color-scheme: dark) {
  /* Placeholder for dark mode - currently disabled */
  /*
  :root {
    --mp-bg: #1a1a2e;
    --mp-bg-page: #0f0f1a;
    --mp-bg-soft: #252540;
    --mp-text: #f0f0f5;
    --mp-text-secondary: #94a3b8;
    --mp-text-muted: #64748b;
    --mp-border: #2d2d4a;
  }
  */
}

/* ── 34. FEEDBACK DIALOG ────────────────────────────────── */
.mp-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mp-feedback-overlay[hidden] { display: none !important; }
.mp-feedback-overlay.is-visible { opacity: 1; }

.mp-feedback-dialog {
  position: relative;
  width: min(100%, 430px);
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  background: #fff;
  color: var(--mp-text, #111827);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s ease;
}

.mp-feedback-overlay.is-visible .mp-feedback-dialog {
  transform: translateY(0) scale(1);
}

.mp-feedback-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mp-feedback-close:hover { background: #f1f5f9; color: #0f172a; }
.mp-feedback-close:active { transform: scale(0.94); }
.mp-feedback-close .material-symbols-outlined { font-size: 21px; }

.mp-feedback-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 17px;
  background: #eff6ff;
  color: #2563eb;
}

.mp-feedback-icon .material-symbols-outlined { font-size: 28px; }
.mp-feedback-overlay.is-warning .mp-feedback-icon { background: #fff7ed; color: #ea580c; }
.mp-feedback-overlay.is-error .mp-feedback-icon { background: #fef2f2; color: #dc2626; }
.mp-feedback-overlay.is-success .mp-feedback-icon { background: #ecfdf5; color: #059669; }

.mp-feedback-eyebrow {
  margin: 0 0 7px;
  color: #ea580c;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mp-feedback-overlay.is-error .mp-feedback-eyebrow { color: #dc2626; }
.mp-feedback-overlay.is-success .mp-feedback-eyebrow { color: #059669; }
.mp-feedback-overlay.is-info .mp-feedback-eyebrow { color: #2563eb; }

.mp-feedback-copy h2 {
  margin: 0;
  padding-right: 26px;
  color: #0f172a;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.mp-feedback-copy > p:last-child {
  margin: 11px 0 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.65;
}

.mp-feedback-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.mp-feedback-primary,
.mp-feedback-secondary {
  flex: 1;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.mp-feedback-primary {
  background: var(--mp-primary, var(--z-primary, #ff5c00));
  color: #fff;
  box-shadow: 0 9px 24px rgba(234, 88, 12, 0.18);
}

.mp-feedback-secondary { background: #f1f5f9; color: #334155; }
.mp-feedback-secondary:hover { background: #e2e8f0; }
.mp-feedback-primary:hover { filter: brightness(0.94); }
.mp-feedback-primary:active,
.mp-feedback-secondary:active { transform: translateY(1px); }
.mp-feedback-close:focus-visible,
.mp-feedback-primary:focus-visible,
.mp-feedback-secondary:focus-visible {
  outline: 3px solid rgba(255, 92, 0, 0.3);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .mp-feedback-overlay {
    align-items: flex-end;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  }

  .mp-feedback-dialog {
    width: 100%;
    padding: 26px 22px 22px;
    border-radius: 24px;
    transform: translateY(28px);
  }

  .mp-feedback-overlay.is-visible .mp-feedback-dialog { transform: translateY(0); }
  .mp-feedback-copy h2 { font-size: 1.18rem; }
  .mp-feedback-copy > p:last-child { font-size: 0.88rem; }
  .mp-feedback-actions { margin-top: 22px; }
}

/* Final desktop shell override. It intentionally comes last because older
   page-level rules constrained .mp-app to a mobile-width column on desktop. */
@media (min-width: 769px) {
  .mp-app {
    max-width: none;
    width: 100%;
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .mp-desktop-header { flex: 0 0 auto; }

  .mp-main-container,
  .mp-search-results,
  .mp-app > main,
  .mp-app > .mp-tab-content.active { flex: 1 0 auto; }

  .mp-desktop-footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 28px 0 18px;
  }

  .mp-desktop-footer-grid { margin-bottom: 22px; }
  .mp-desktop-footer-col a { margin-bottom: 6px; }
  .mp-desktop-footer-bottom { padding-top: 16px; }
}
