/* ============================================================
   DODO-style mobile menu  (gracerest.ru)  — v2
   - category chips float (glass), no dark container
   - tiny arrow "back" button, no section titles
   - 2-column dish cards (price left, small "add" right)
   Mobile only (<=768px). Desktop layout is untouched.
   Sticky offsets use --header-h / --subhdr-h set by menu-mobile.js
   ============================================================ */
@media (max-width: 768px) {

  /* keep content clear of the fixed top header */
  .main { margin-top: var(--header-h, 74px) !important; padding: 0 10px 96px !important; }
  /* reorder: categories on top, then a small back button, then dishes */
  .menu-sec.active { padding-top: 0; animation: none; display: flex; flex-direction: column; }

  /* hide the Filters button on mobile (admin toggle will control it later) */
  .filters-bar { display: none !important; }

  /* ---- back area: small floating arrow, placed UNDER the categories ---- */
  .sec-header {
    order: 2;
    position: sticky;
    top: calc(var(--header-h, 74px) + var(--tabs-h, 48px));
    z-index: 59;
    margin: 0 0 8px;
    padding: 0;
    min-height: 0;
    border: none !important;
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    justify-content: flex-start;
  }
  .sec-header h2 { display: none !important; }   /* remove section title */

  /* back button -> small floating glass arrow (beats edem-beach theme) */
  html[data-menu-theme="edem-beach"] .sec-header .back-btn,
  .sec-header .back-btn {
    width: 36px; height: 36px;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 50% !important;
    font-size: 0 !important;                 /* hide the "НАЗАД" text */
    display: inline-flex !important;
    align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
    color: #fff !important;
  }
  .sec-header .back-btn::before {
    content: "\2039";                        /* ‹ */
    font-size: 22px; line-height: 1; color: #fff;
  }

  /* ---- category scroll: transparent container, glass chips floating ---- */
  .tabs {
    order: 1;
    position: sticky;
    top: var(--header-h, 74px);
    z-index: 55;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;            /* free, snappy horizontal swipe */
    scroll-snap-type: none;
    gap: 8px;
    margin: 0 -10px 10px;
    padding: 4px 10px;
    background: transparent !important;
    border: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px !important;
    padding: 6px 13px !important;
    border-radius: 50px !important;
  }
  /* active chip = brighter glass highlight (beats edem-beach theme) */
  html[data-menu-theme="edem-beach"] .tabs .tab.active,
  .tabs .tab.active {
    background: rgba(255, 255, 255, 0.30) !important;
    border-color: rgba(255, 255, 255, 0.65) !important;
    color: #fff !important;
    font-weight: 600 !important;
  }

  .filter-toggle { margin: 2px 0 10px; }

  /* ---- 2-column dish grid (DODO) ---- */
  .items-grid { order: 3; grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

  .item {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 8px !important;
    gap: 8px !important;
  }
  .item img { width: 100% !important; height: 130px !important; }
  .item-info { width: 100%; }
  .item-info h3 { font-size: 14px; line-height: 1.25; margin-bottom: 4px; }
  .item-desc {
    font-size: 11px; line-height: 1.4; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .item-meta { font-size: 10px; }

  /* price (left) + small "add" button (right), pinned to card bottom */
  .item-right {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px;
    margin-top: auto;
  }
  .item-price {
    font-size: 15px !important;
    margin-bottom: 0 !important;
    white-space: nowrap !important;       /* keep "390 ₽" on one line */
  }
  /* smaller Add button (beats edem-beach padding 12/24) */
  html[data-menu-theme="edem-beach"] .item-right .add-btn,
  .item-right .add-btn {
    padding: 6px 12px !important;
    font-size: 11px !important;
    border-radius: 50px !important;
    letter-spacing: 0 !important;
    flex-shrink: 0;
  }

  /* ---- dish detail modal: make it scrollable so the description and
     "add" button are never clipped (was overflow:hidden) ---- */
  .dish-modal-box {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    max-height: 88vh !important;
  }
  .dish-media { height: 200px !important; }
}
