/* FOOD VIBES Step 60 | Compact professional menu on phones.
   Applied to the public menu only. No change to product/order functionality.
   Loaded after the older menu, theme and Step 56 CSS. */

@media screen and (max-width: 640px) {
  html body main.customer-wrap {
    width: 100%;
    max-width: 100%;
    padding: 14px 12px 76px;
  }

  html body main.customer-wrap .menu-banner {
    border-radius: 16px !important;
    padding: 20px 18px !important;
    margin-bottom: 14px !important;
  }
  html body main.customer-wrap .menu-banner h1 {
    font-size: clamp(1.35rem, 5.7vw, 1.8rem) !important;
    line-height: 1.18;
    margin: 6px 0 8px;
  }
  html body main.customer-wrap .menu-banner p {
    font-size: .85rem;
    line-height: 1.45;
  }

  /* Search takes a complete row; category another; buttons share a row. */
  html body main.customer-wrap .menu-controls {
    padding: 14px !important;
    border-radius: 16px !important;
    margin-bottom: 14px !important;
  }
  html body main.customer-wrap .menu-controls .filter-form {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: end !important;
    gap: 10px !important;
  }
  html body main.customer-wrap .menu-controls .filter-form > div {
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  html body main.customer-wrap .menu-controls .filter-form label {
    font-size: .77rem;
    margin: 0 0 5px !important;
  }
  html body main.customer-wrap .menu-controls :is(input[type="search"],select) {
    width: 100%;
    height: 42px;
    min-height: 42px !important;
    padding: 8px 10px !important;
    font-size: .83rem;
  }
  html body main.customer-wrap .menu-controls .filter-form > .btn {
    grid-column: auto;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px;
    padding: 9px 10px !important;
    margin: 0 !important;
    font-size: .82rem;
    white-space: nowrap;
  }

  /* Two clearly tappable cards on normal phones instead of one huge card. */
  html body main.customer-wrap .food-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 11px !important;
    align-items: stretch !important;
  }
  html body main.customer-wrap .food-grid > .food-card {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 15px !important;
    overflow: hidden;
  }
  html body main.customer-wrap .food-card .food-photo {
    width: 100% !important;
    height: clamp(105px, 31vw, 146px) !important;
    min-height: 0 !important; /* Overrides Step 56 160px minimum. */
    flex: none;
    overflow: hidden;
  }
  html body main.customer-wrap .food-card .food-photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
  }
  html body main.customer-wrap .food-card .food-photo > span {
    font-size: 2.6rem !important;
  }
  html body main.customer-wrap .food-card .food-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    min-width: 0;
    padding: 12px 10px 12px !important;
  }
  html body main.customer-wrap .food-card .food-category {
    font-size: .65rem !important;
    letter-spacing: .04em;
    line-height: 1.2;
  }
  html body main.customer-wrap .food-card .food-content h2,
  html body main.customer-wrap .food-card .food-content h3 {
    font-size: clamp(.94rem, 3.7vw, 1.13rem) !important;
    line-height: 1.24 !important;
    margin: 0 !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow-wrap: anywhere;
  }
  html body main.customer-wrap .food-card .food-content > p:not(.fv56-order-help):not(.fv56-role-note) {
    margin: 0 !important;
    min-height: 0 !important;
    font-size: .74rem !important;
    line-height: 1.38 !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
  }
  html body main.customer-wrap .food-card .fv-mini {
    display: flex;
    flex-wrap: wrap;
    margin: 2px 0 0 !important;
    gap: 5px;
    align-items: center;
    min-width: 0;
  }
  html body main.customer-wrap .food-card .fv-mini > a {
    flex: 1 1 100%;
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .68rem !important;
    line-height: 1.3;
  }
  html body main.customer-wrap .food-card .fv-mini form button {
    font-size: .68rem;
    min-height: 32px;
    padding: 5px 8px;
  }
  html body main.customer-wrap .food-card .food-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-top: auto !important;
    gap: 5px;
    padding-top: 5px;
  }
  html body main.customer-wrap .food-card .food-bottom strong {
    font-size: clamp(.93rem, 3.9vw, 1.1rem) !important;
    line-height: 1.2;
    white-space: nowrap;
  }
  html body main.customer-wrap .food-card .available-pill {
    font-size: .62rem !important;
    line-height: 1.15;
    padding: 5px 7px !important;
    white-space: nowrap;
  }
  html body main.customer-wrap .food-card .fv56-order-help,
  html body main.customer-wrap .food-card .fv56-role-note {
    font-size: .7rem !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    min-height: 0 !important;
    overflow-wrap: anywhere;
  }
  html body main.customer-wrap .food-card .fv56-order-btn,
  html body main.customer-wrap .food-card .food-content form > button.btn {
    width: 100%;
    min-height: 44px !important;
    padding: 9px 7px !important;
    border-radius: 10px;
    font-size: .78rem !important;
    line-height: 1.25;
    margin: 2px 0 0 !important;
    white-space: normal;
  }
  html body main.customer-wrap .next-feature {
    font-size: .78rem;
    line-height: 1.5;
    margin: 20px 0 0;
  }
}

/* Extra-narrow devices: compact horizontal cards stay readable. */
@media screen and (max-width: 340px) {
  html body main.customer-wrap .food-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  html body main.customer-wrap .food-grid > .food-card {
    display: grid !important;
    grid-template-columns: 105px minmax(0, 1fr);
    align-items: stretch;
  }
  html body main.customer-wrap .food-card .food-photo {
    height: 100% !important;
    min-height: 140px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body main.customer-wrap .food-card,
  html body main.customer-wrap .food-card img { transition: none !important; }
}
