/* Menu page design (layout and look only; no behaviour). Loaded after styles.css and theme.css. */
:root {
  --menu-gold: #f6c90e;
  --menu-line: #ececec;
}

/* ===== 1. Category pills ===== */
#tab-menu .category-filter { padding: 0.375rem 1rem; border-bottom: 1px solid var(--menu-line); box-shadow: none; }
#tab-menu .category-scroll { gap: 0.5rem; padding-top: 0; padding-bottom: 0; }
#tab-menu .category-btn { display: inline-flex; align-items: center; gap: 0.4rem; height: 2.25rem; padding: 0 0.875rem; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; color: #3a2f33; background: #f4f1f2; border-radius: 9999px; }
#tab-menu .category-btn:hover { background: #ebe5e7; }
#tab-menu .category-btn.has-icon { padding-left: 0.25rem; }
#tab-menu .category-btn-icon { width: 1.625rem; height: 1.625rem; }
#tab-menu .category-btn-count { font-size: 0.75rem; font-weight: 500; color: #8b7f83; }
#tab-menu .category-btn.active { background: var(--bq-accent, #7b1c3a); color: var(--bq-accent-text, #fff); }
#tab-menu .category-btn.active .category-btn-count { color: inherit; opacity: 0.75; }

/* ===== 2. Toolbar strip: search, status, sort, view ===== */
#tab-menu .menu-toolbar { gap: 0.75rem; margin: 0 -1rem; padding: 0.5rem 1rem; background: #fff; border: 0; border-bottom: 1px solid var(--menu-line); border-radius: 0; }
#tab-menu .menu-toolbar .search-bar input { height: 2.25rem; padding-top: 0; padding-bottom: 0; padding-left: 2.5rem; background: #fff; border: 1px solid #dcdde1; border-radius: 9999px; box-shadow: none; font-size: 0.9375rem; }
#tab-menu .menu-toolbar .search-bar input:focus { background: #fff; }
#tab-menu .menu-toolbar .search-bar svg { left: 1rem; }
#tab-menu .menu-toolbar-controls { gap: 0.625rem; margin-left: 0; padding-left: 0; border-left: 0; }
#tab-menu .menu-status { height: 2.25rem; min-height: 0; padding: 0 0.875rem; background: #fff; }
#tab-menu .menu-status.is-open { background: #ecfdf3; border-color: #a7e3bd; }
#tab-menu .menu-status.is-closed { background: #fff1f3; border-color: #f3b4c0; }
#tab-menu .menu-sort { height: 2.25rem; padding-top: 0; padding-bottom: 0; padding-left: 1rem; background-color: #fff; border: 1px solid #dcdde1; border-radius: 9999px; }
#tab-menu .menu-sort:hover { background-color: #fff; border-color: #c4c6cc; }
#tab-menu .menu-view-toggle { padding: 0.1875rem; background: #fff; border: 1px solid #dcdde1; }
#tab-menu .menu-view-toggle button { width: 1.75rem; height: 1.75rem; }
#tab-menu .menu-view-toggle button svg { width: 1rem; height: 1rem; }

/* ===== 3. Category banner ===== */
#tab-menu .menu-category-box {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 0.875rem;
  margin: 1.25rem 0 0.25rem; padding: 0.5rem 1.25rem; min-height: 3.25rem;
  color: var(--bq-accent, #7b1c3a);
  background: rgba(var(--bq-accent-rgb, 123, 28, 58), 0.08);
  border: 1px solid rgba(var(--bq-accent-rgb, 123, 28, 58), 0.16); border-radius: 0.875rem; box-shadow: none;
  overflow: hidden;
}
#tab-menu .menu-category-box:first-child { margin-top: 0.75rem; }
#tab-menu .menu-category-box::before,
#tab-menu .menu-category-box::after { content: ""; display: block; position: static; flex: 0 1 4rem; width: auto; height: 1px; border-radius: 0; background: linear-gradient(90deg, transparent, rgba(var(--bq-accent-rgb, 123, 28, 58), 0.4)); }
#tab-menu .menu-category-box::after { background: linear-gradient(270deg, transparent, rgba(var(--bq-accent-rgb, 123, 28, 58), 0.4)); }
#tab-menu .menu-category-box-icon { width: 2rem; height: 2rem; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
#tab-menu .menu-category-box-text { gap: 0.625rem; }
#tab-menu .menu-category-box-text h2 { color: inherit; font-family: "Playfair Display", Georgia, "Times New Roman", serif; font-size: 1.375rem; font-weight: 800; letter-spacing: 0; text-transform: none; line-height: 1.15; }
#tab-menu .menu-category-box-text h2::after { display: none; }
#tab-menu .menu-category-box-text span { padding: 0.125rem 0.625rem; background: var(--menu-gold); color: #3b2a00; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.06em; }

/* ===== 4. Item cards ===== */
#tab-menu #menuGrid { gap: 1.25rem; }
#tab-menu #menuGrid .menu-card { background: #fff; border: 1px solid #e9dde1; border-radius: 1.25rem; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09), 0 1px 3px rgba(0, 0, 0, 0.06); transition: box-shadow 0.2s, transform 0.2s; }
#tab-menu #menuGrid .menu-card:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06); transform: translateY(-2px); }
#tab-menu #menuGrid .menu-card-body { padding: 0.75rem 1rem 0.875rem; flex: 1 1 auto; display: flex; flex-direction: column; }
/* the Add / quantity area always sits at the bottom of the card, whatever the text length */
#tab-menu #menuGrid .menu-card-actions { margin-top: auto; padding-top: 0.5rem; min-height: 0; }
#tab-menu #menuGrid .menu-card-name { font-size: 1.125rem; font-weight: 800; line-height: 1.25; color: #2a1d21; }
#tab-menu #menuGrid .menu-card-name::after { content: ""; display: block; width: 2.5rem; height: 3px; margin-top: 0.375rem; border-radius: 3px; background: linear-gradient(90deg, var(--menu-gold), var(--bq-accent, #7b1c3a)); }
#tab-menu #menuGrid .menu-card-desc { margin-top: 0.125rem; color: #6b6266; font-size: 0.875rem; line-height: 1.45; }
#tab-menu #menuGrid .menu-card-price { margin-top: 0.25rem; color: var(--bq-accent-ink, var(--bq-accent, #7b1c3a)); font-size: 1.125rem; font-weight: 800; }
#tab-menu #menuGrid .add-btn { min-height: 2.5rem; padding: 0.5rem 1rem; background: var(--bq-accent, #7b1c3a); color: var(--bq-accent-text, #fff); border-radius: 9999px; font-size: 0.9375rem; font-weight: 700; }
#tab-menu #menuGrid .add-btn:hover { background: var(--bq-accent-hover, #4a0f22); }
#tab-menu #menuGrid .add-btn:disabled { background: #e5e2e3; color: #7b7276; }
@media (min-width: 1280px) { #tab-menu #menuGrid:not(.menu-list-view) { grid-template-columns: repeat(4, 1fr); } }

/* list view keeps the same look with a compact image column */
#tab-menu #menuGrid.menu-list-view .menu-card-body { padding: 1rem 1.125rem; }

/* ===== Small screens ===== */
@media (max-width: 640px) {
  #tab-menu .category-btn { padding: 0.25rem 0.75rem; font-size: 0.875rem; }
  #tab-menu .category-btn-icon { width: 1.5rem; height: 1.5rem; }
  #tab-menu .menu-toolbar { gap: 0.5rem; }
  /* status, sort and layout stay on ONE line; only the sort dropdown shrinks */
  #tab-menu .menu-toolbar-controls { width: 100%; flex-wrap: nowrap; gap: 0.375rem; justify-content: space-between; }
  #tab-menu .menu-status-wrap, #tab-menu .menu-view-toggle { flex: 0 0 auto; }
  #tab-menu .menu-status { padding: 0 0.625rem; font-size: 0.8125rem; }
  #tab-menu .menu-sort-wrap { flex: 1 1 0; min-width: 0; }
  #tab-menu .menu-sort { width: 100%; min-width: 0; padding-left: 0.75rem; padding-right: 1.75rem; font-size: 0.8125rem; text-overflow: ellipsis; }
  #tab-menu .menu-category-box { gap: 0.5rem; padding: 0.375rem 0.875rem; min-height: 2.75rem; border-radius: 0.75rem; }
  #tab-menu .menu-category-box::before,
  #tab-menu .menu-category-box::after { display: none; }
  #tab-menu .menu-category-box-icon { width: 1.75rem; height: 1.75rem; }
  #tab-menu .menu-category-box-text { gap: 0.5rem; }
  #tab-menu .menu-category-box-text h2 { font-size: 1.125rem; }
  #tab-menu .menu-category-box-text span { padding: 0.1rem 0.5rem; font-size: 0.625rem; }
  #tab-menu #menuGrid .menu-card-body { padding: 0.75rem 0.875rem; }
}

/* ===================================================================
   Page layout: header, banner (name + search), closed alert, pills, toolbar
   =================================================================== */

/* ----- Header: logo on the left, tabs inline next to it (wide screens) ----- */
@media (min-width: 900px) {
  .customer-masthead { justify-content: flex-start; gap: 2.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .customer-masthead .nav-tabs { flex: 1 1 auto; max-width: none; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .customer-masthead .nav-tabs-inner { gap: 0.25rem; align-items: center; }
  .customer-masthead .nav-tab { flex: 0 0 auto; gap: 0.625rem; min-height: 0; padding: 0.625rem 1rem; border: 0; border-radius: 0.75rem; background: transparent; color: #3a2f33; font-size: 1rem; font-weight: 600; box-shadow: none; }
  .customer-masthead .nav-tab svg { flex: 0 0 1.625rem; width: 1.625rem; height: 1.625rem; padding: 0; border-radius: 0; background: transparent; color: rgba(var(--bq-accent-rgb, 123, 28, 58), 0.6); }
  .customer-masthead .nav-tab:hover { background: #f6f1f2; color: #3a2f33; box-shadow: none; }
  .customer-masthead .nav-tab.active { background: rgba(var(--bq-accent-rgb, 123, 28, 58), 0.09); color: var(--bq-accent, #7b1c3a); box-shadow: none; }
  .customer-masthead .nav-tab.active > span { color: var(--bq-accent, #7b1c3a); font-weight: 700; }
  .customer-masthead .nav-tab.active svg { background: transparent; color: var(--bq-accent, #7b1c3a); }
  .customer-masthead #authTab { margin-left: auto; border: 1px solid #e5e7eb; background: #fff; }
  .customer-masthead #authTab:not(.active):hover { background: #f6f1f2; }
}

/* ----- Toolbar: hours status, sort and layout on the right ----- */
#tab-menu .menu-toolbar { justify-content: flex-end; }
#tab-menu .menu-toolbar-controls { margin-left: auto; }

/* ----- Search sits at the left of the toolbar ----- */
#tab-menu .menu-toolbar .search-bar { flex: 1 1 16rem; min-width: 0; max-width: 32rem; }
#tab-menu .menu-toolbar-controls { margin-left: auto; }

/* ----- Header separation: a clear line and a soft shadow below it ----- */
.customer-masthead { position: relative; z-index: 35; border-bottom: 1px solid #e2e2e6; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07); }

/* ----- Phone header: tab icons use the light theme colour too ----- */
@media (max-width: 899px) {
  .customer-masthead .nav-tab:not(.active) svg { color: rgba(var(--bq-accent-rgb, 123, 28, 58), 0.65); background: rgba(var(--bq-accent-rgb, 123, 28, 58), 0.08); }
  .customer-masthead #authTab:not(.active) svg { color: rgba(var(--bq-accent-rgb, 123, 28, 58), 0.65); }
}

/* ===================================================================
   Food photo on the card: full card width, top edge to edge (a click shows the complete photo)
   =================================================================== */
#tab-menu #menuGrid .menu-card-image.has-photo {
  position: relative; display: block; width: 100%;
  height: 9rem; padding: 0; overflow: hidden;
  background: #f3f1f2; border-bottom: 0; cursor: zoom-in;
}
#tab-menu #menuGrid .menu-card-image.has-photo::before { content: none; }
#tab-menu #menuGrid .menu-card-image.has-photo > img {
  position: absolute; left: 0; top: 0; display: block; width: 100%; height: 100%; max-width: none; max-height: none;
  padding: 0; object-fit: fill; border-radius: 0; border: 0; filter: none; box-shadow: none;
}
/* thumbnail style: whole photo, rounded, centred on white (used for full-bleed photos with a dark edge) */
#tab-menu #menuGrid .menu-card-image.has-photo.photo-thumb { background: #f3f1f2; }
#tab-menu #menuGrid .menu-card-image.has-photo.photo-thumb > img { border-radius: 0; }
/* the browser's "hidden" must win over the display rule above (a failed photo is swapped for the icon) */
#tab-menu #menuGrid .menu-card-image > img[hidden] { display: none !important; }
#tab-menu #menuGrid .menu-card-image.has-photo:focus-visible { outline: 3px solid var(--bq-accent, #7b1c3a); outline-offset: -3px; }
/* list view: the photo fills its column */
#tab-menu #menuGrid.menu-list-view .menu-card-image.has-photo { width: auto; height: auto; min-height: 6.5rem; padding: 0; }
#tab-menu #menuGrid.menu-list-view .menu-card-image.has-photo > img { position: absolute; inset: 0; }

/* ----- photo viewer (click on a food photo) ----- */
.img-lightbox { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(10, 10, 12, 0.85); }
.img-lightbox img { max-width: min(94vw, 1100px); max-height: 90vh; object-fit: contain; border-radius: 0.75rem; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.img-lightbox-close { position: absolute; top: 0.75rem; right: 1rem; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.95); color: #222; font-size: 1.625rem; line-height: 1; cursor: pointer; }
.img-lightbox-close:hover { background: #fff; }

/* icon cards (no photo) are shorter as well */
#tab-menu #menuGrid .menu-card-image:not(.has-photo) { height: 5.5rem; padding: 0.5rem; }
/* grid view: icon cards get the same image-area height as photo cards so every item name starts on the same line */
#tab-menu #menuGrid:not(.menu-list-view) .menu-card-image:not(.has-photo) { height: 9rem; display: flex; align-items: center; justify-content: center; }
@media (max-width: 640px) {
  #tab-menu #menuGrid .menu-card-image.has-photo { height: 9.5rem; }
  #tab-menu #menuGrid:not(.menu-list-view) .menu-card-image:not(.has-photo) { height: 9.5rem; }
}

/* compact card: smaller gaps (the theme adds 10-12px around the price and a 74px button area) */
#tab-menu #menuGrid .menu-card-header { margin-bottom: 0.25rem; }
#tab-menu #menuGrid .menu-card-desc-wrap { margin-bottom: 0.25rem; }
#tab-menu #menuGrid .menu-card-food-info { margin: 0 0 0.375rem; }
#tab-menu #menuGrid .menu-card-price { margin: 0.25rem 0 0.5rem; padding-top: 0; }
#tab-menu #menuGrid .menu-card-actions { min-height: 0; }

/* ----- drag the photo to see its trimmed parts ----- */
#tab-menu #menuGrid .menu-card-image.has-photo > img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* small move hint (hidden after the first drag, and while dragging) */
#tab-menu #menuGrid .menu-card-image.has-photo.can-pan::after {
  content: attr(data-pan); position: absolute; right: 0.5rem; bottom: 0.5rem; z-index: 2;
  display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 0.95rem; line-height: 1; pointer-events: none; transition: opacity 0.2s;
}
html.bq-pan-learned #tab-menu #menuGrid .menu-card-image.has-photo.can-pan::after,
#tab-menu #menuGrid .menu-card-image.has-photo.is-panning::after { opacity: 0; }

/* hover pan: the photo glides to follow the pointer; a touch drag moves it directly */
#tab-menu #menuGrid .menu-card-image.has-photo.can-pan > img { transition: left 0.18s ease-out, top 0.18s ease-out; }
#tab-menu #menuGrid .menu-card-image.has-photo.is-panning > img { transition: none; }

/* closed-hours dialog (add to cart while closed) */
.bq-closed-modal { position: fixed; inset: 0; z-index: 100002; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 15, 18, 0.55); }
.bq-closed-card { width: 100%; max-width: 34rem; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 1.5rem; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35); animation: bq-closed-in .2s ease-out; }
@keyframes bq-closed-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.bq-closed-head { display: flex; align-items: center; gap: .75rem; padding: 1.5rem 1.75rem 1.125rem; border-bottom: 1px solid #efe3e6; color: var(--bq-accent, #7b1c3a); }
.bq-closed-head svg { width: 1.75rem; height: 1.75rem; flex: 0 0 auto; }
.bq-closed-head h2 { flex: 1 1 auto; margin: 0; font-family: "Playfair Display", Georgia, "Times New Roman", serif; font-size: 1.75rem; font-weight: 800; color: #2b2326; line-height: 1.15; }
.bq-closed-x { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: transparent; color: #5c5256; font-size: 2rem; line-height: 1; cursor: pointer; }
.bq-closed-x:hover { background: #f4eef0; }
.bq-closed-body { padding: 1.25rem 1.75rem 1.75rem; }
.bq-closed-msg { margin: 0 0 1.25rem; padding: 1.125rem 1.375rem; border-radius: 1.125rem; background: #fdf0f0; color: #c0182b; font-size: 1.125rem; font-weight: 700; line-height: 1.5; }
.bq-closed-body ul { list-style: none; margin: 0; padding: 0; }
.bq-closed-body li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .75rem; margin: 0 -.75rem; font-size: 1.125rem; color: #6b6266; border-radius: .75rem; }
.bq-closed-body li span:last-child { font-weight: 700; color: #2b2326; }
.bq-closed-body li.is-today { background: rgba(var(--bq-accent-rgb, 123, 28, 58), .08); color: var(--bq-accent, #7b1c3a); font-weight: 800; }
.bq-closed-body li.is-today span:last-child { color: #2b2326; }
@media (max-width: 480px) { .bq-closed-head { padding: 1.125rem 1.125rem .875rem; } .bq-closed-head h2 { font-size: 1.5rem; } .bq-closed-body { padding: 1rem 1.125rem 1.25rem; } .bq-closed-msg { font-size: 1rem; } .bq-closed-body li { font-size: 1rem; } }
