/* ==========================================================================
   Món Ngon Express - Mobile Layer (loaded only at max-width: 767px)
   Thumb-first layout: compact header, horizontal dish cards, tidy action rows.
   ========================================================================== */

/* ---------- Header: bottom nav already carries Cart + Account ---------- */
.ed-header [data-header-actions] > a[href="cart.html"],
.ed-header #user-menu-container,
.ed-header [data-header-actions] > a.ed-pill {
  display: none !important;
}
.ed-header [data-header-actions] { gap: 2px !important; }
.ed-header #mne-header-search-btn,
.ed-header #mne-theme-toggle,
.ed-header #gift-toggle {
  display: inline-flex !important;
  width: 40px;
  height: 40px;
  border-radius: 999px;
}
.ed-header #gift-toggle { background: var(--ed-cream, #f3ede3); color: var(--primary); }

/* ---------- Buttons: never balloon, never wrap ---------- */
.ed-pill {
  min-height: 2.75rem;
  padding: 0 1.1rem;
  font-size: .9rem;
  white-space: nowrap;
  line-height: 1;
}
.ed-pill-dot { width: 1.4rem; height: 1.4rem; }
button, .ui-btn { white-space: nowrap; }

/* ---------- Headline rhythm ---------- */
.ed-hero-title { font-size: clamp(2.4rem, 12vw, 3.4rem); line-height: 1.05; }
.ed-page-title { font-size: clamp(2.2rem, 10.5vw, 3rem) !important; line-height: 1.04; }
h2.ed-serif { text-wrap: balance; }

/* Inline pill inside paragraph (home "Cách bếp làm") becomes a lead-in chip */
p > a.ed-pill.align-middle {
  display: flex;
  width: max-content;
  margin: 0 0 .9rem !important;
}
p:has(> a.ed-pill.align-middle) { line-height: 1.65 !important; }

/* ---------- Catalog: horizontal "menu-board" cards ---------- */
#products-grid { gap: 12px !important; grid-template-columns: 1fr !important; }
#products-grid > article {
  display: grid !important;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-column: auto !important;
  grid-row: auto !important;
  align-items: stretch;
  min-height: 0 !important;
  border-radius: 22px !important;
}
#products-grid > article > .mne-dish-thumb,
#products-grid > article > div:first-child {
  width: 112px !important;
  height: auto !important;
  min-height: 132px;
  aspect-ratio: auto !important;
  border-radius: 18px !important;
  margin: 6px 0 6px 6px;
  overflow: hidden;
}
#products-grid > article > .mne-dish-thumb img { height: 100% !important; }
#products-grid > article .favorite-btn {
  top: 6px !important;
  right: 6px !important;
  width: 30px !important;
  height: 30px !important;
}
#products-grid > article > div:last-child { padding: 12px 12px 12px 14px !important; min-width: 0; }
#products-grid > article h3 { font-size: 1.05rem !important; margin-top: 6px !important; line-height: 1.2; }
#products-grid > article h3 a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
#products-grid > article p.line-clamp-1 { font-size: .78rem !important; }
#products-grid > article .add-to-cart-btn {
  width: 36px; height: 36px; padding: 0 !important; border-radius: 999px !important; justify-content: center;
  background: var(--foreground) !important; color: var(--background) !important; border: 0 !important;
}
#products-grid > article .add-to-cart-btn > span:not(.mne-ph-icon) { display: none; }
#products-grid > article .add-to-cart-btn i,
#products-grid > article .add-to-cart-btn svg { color: var(--background) !important; stroke: currentColor; width: 18px; height: 18px; font-size: 18px; }
#products-grid > article .ui-badge { font-size: .68rem; padding: 2px 8px; }

/* Category pills: snap scrolling rail */
#mne-mobile-cat-pills { scroll-snap-type: x proximity; padding-inline: 2px; }
#mne-mobile-cat-pills > button { scroll-snap-align: start; height: 2.25rem; font-size: .82rem; }
#mne-mobile-filter-bar #mne-open-filter-sheet { height: 2.5rem; border-radius: 999px; }

/* Sort row sits inline with title count */
#sort-menu + .ui-select-trigger, .ui-select-trigger { min-height: 2.5rem; border-radius: 999px; }

/* ---------- Product page ---------- */
:has(> #wishlist-btn) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 48px 48px;
  gap: 8px !important;
  align-items: center;
}
:has(> #wishlist-btn) > a.ed-pill { justify-content: space-between; min-height: 3rem; }
#wishlist-btn {
  width: 48px; height: 48px; min-height: 48px; padding: 0 !important; justify-content: center; border-radius: 999px;
}
#wishlist-btn #wishlist-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#share-product-btn { width: 48px !important; height: 48px !important; }

#mne-product-sticky-bar {
  left: 10px !important; right: 10px !important;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
  border-radius: 999px; border: 1px solid var(--border-strong) !important;
  padding: 6px 6px 6px 18px !important;
  box-shadow: 0 16px 34px -14px rgba(0,0,0,.35) !important;
}
#mne-product-sticky-bar #mne-sticky-add-btn { min-height: 2.75rem !important; }

/* Size / extras rows: two-column chips instead of stretched bars */
#product-extras { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; }
#product-extras .pd-extra { min-height: 2.6rem; padding: 0 .7rem 0 .45rem; font-size: .8rem; white-space: normal; line-height: 1.15; }
#product-extras .pd-extra-mark { width: 1.25rem; height: 1.25rem; }

/* ---------- Cart page ---------- */
.remove-item { min-height: 2.5rem !important; width: 2.5rem; padding: 0 !important; justify-content: center; }
.remove-item > span { display: none; }

/* ---------- Bottom nav: floating dock ---------- */
#mne-mobile-bottom-nav {
  left: 10px !important; right: 10px !important;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  height: 62px !important;
  padding-bottom: 0 !important;
  border-radius: 24px;
  border: 1px solid var(--border-strong) !important;
  background: var(--surface) !important;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.4);
}
#mne-mobile-bottom-nav > a, #mne-mobile-bottom-nav > button { font-size: .68rem; gap: 3px; }
#mne-mobile-bottom-nav [aria-current="page"] { position: relative; }
#mne-mobile-bottom-nav [aria-current="page"]::before {
  content: ""; position: absolute; top: 7px; left: 50%; width: 42px; height: 30px;
  transform: translateX(-50%); border-radius: 999px; background: var(--primary-light); z-index: -1;
}
body.has-mobile-bottom-nav { padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)) !important; }

/* ---------- Forms & misc ---------- */
input.ui-input, select.ui-input, textarea.ui-input { font-size: 16px; }
.faq-toggle { font-size: .95rem; text-align: left; white-space: normal; }
.branch-item { white-space: normal; }
.ed-footer-sheet { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.ed-wordmark { font-size: 24vw !important; }
