/**
 * Menu Template 3 — "Menu Explorer" (Pro).
 * Loaded on top of frontend.css only when this template is active; layout
 * only, scoped under .rztqm-menu--template-3 — every color still comes from
 * the active color theme's CSS variables. Three screens, all built by
 * frontend-menu.js's template-3 branches: a "Popular picks" category list
 * (renderCategoryBrowse()), a tabbed per-category item list
 * (renderTemplate3Tabs() + renderContent()), and a full item-detail popup
 * (openItemModal() + buildModalDetailsList()).
 */

/* Soft tinted page background so the white browse/item cards read as
   floating cards, not just flat rows — matches the reference design's
   tinted page behind white content cards. */
.rztqm-menu--template-3 {
  background: var(--rztqm-bg-soft);
}

/* ------------------------------------------------------------------ */
/* Screen 1: category browse ("Popular picks")                         */
/* ------------------------------------------------------------------ */

.rztqm-category-browse__heading {
  margin: 4px 0 12px;
  padding: 0 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--rztqm-text);
}

.rztqm-category-browse {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rztqm-category-browse__card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: var(--rztqm-bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.rztqm-category-browse__card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.rztqm-category-browse__card:focus-visible {
  outline: 2px solid var(--rztqm-accent);
  outline-offset: 2px;
}

/* A colored rounded-square tile (not a circle) — matches the reference
   design's category icon treatment. */
.rztqm-category-browse__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: color-mix(in srgb, var(--rztqm-accent) 14%, var(--rztqm-bg));
}

.rztqm-category-browse__icon--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.rztqm-category-browse__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.rztqm-category-browse__name {
  font-size: 17px;
  font-weight: 700;
}

.rztqm-category-browse__count {
  font-size: 12px;
  color: var(--rztqm-text-muted);
}

.rztqm-category-browse__arrow {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--rztqm-text-muted);
}

/* ------------------------------------------------------------------ */
/* Screen 2: tabbed per-category item list                             */
/* ------------------------------------------------------------------ */

/* Underline tabs, plus a circular back button — replaces the pill-style
   nav the other templates use, since template-3's nav switches which
   category's items are shown rather than scroll-jumping one long page. */
.rztqm-menu--template-3 .rztqm-category-pill {
  min-height: auto;
  padding: 6px 4px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--rztqm-text-muted);
  font-size: 14px;
}

.rztqm-menu--template-3 .rztqm-category-pill[aria-current="true"] {
  color: var(--rztqm-accent);
  border-bottom-color: var(--rztqm-accent);
}

.rztqm-menu--template-3 .rztqm-category-pill--back {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 4px;
  padding: 0;
  border-radius: 50%;
  background: var(--rztqm-bg-soft);
  color: var(--rztqm-text);
}

.rztqm-menu--template-3 .rztqm-category-pill--back svg {
  width: 16px;
  height: 16px;
}

/* Item cards: name/price/description/meta on the left, image + a pill
   "Add" button stacked on the right — matches the reference design's
   per-category item list. */
.rztqm-menu--template-3 .rztqm-item-card {
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 14px;
}

.rztqm-menu--template-3 .rztqm-item-card__name {
  font-size: 16px;
}

.rztqm-menu--template-3 .rztqm-item-card__price-current {
  color: var(--rztqm-accent);
  font-size: 15px;
}

/* This card's image sits on the trailing (right) edge, not the leading
   edge like the other two templates — the shared frontend.css overlay
   rule's top-left default would float the badge over plain text instead
   of the photo, so pin it to the top-right here instead. */
.rztqm-menu--template-3 .rztqm-item-card__body .rztqm-item-badge {
  left: auto;
  right: 14px;
}

/* Flip the tooltip to open leftward here — the badge itself sits at the
   card's trailing (right) edge, so the default rightward tooltip would run
   off the card/viewport. */
.rztqm-menu--template-3 .rztqm-item-badge--icon::after {
  left: auto;
  right: calc(100% + 8px);
}

.rztqm-menu--template-3 .rztqm-item-card__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Scoped under .rztqm-item-card (not just .rztqm-menu--template-3), since the
   item modal's photo wrapper shares the same base .rztqm-item-card__image-wrap
   class — without this scoping the higher-specificity selector below would
   also shrink the modal's photo down to card-thumbnail size. */
.rztqm-menu--template-3 .rztqm-item-card .rztqm-item-card__image-wrap {
  width: 84px;
  height: 84px;
  border-radius: 12px !important;
}

.rztqm-item-card__add-btn--pill {
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--rztqm-accent);
  border: 1px solid var(--rztqm-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.rztqm-item-card__add-btn--pill:hover {
  transform: scale(1.04);
}

/* ------------------------------------------------------------------ */
/* Screen 3: item detail popup                                         */
/* ------------------------------------------------------------------ */

/* Same top spacing as every other template's modal image (the normal gap
   below the header, via .rztqm-modal__body's own padding) — just a taller
   photo. */
.rztqm-menu--template-3 .rztqm-modal__image-wrap {
  height: 260px;
}

.rztqm-menu--template-3 .rztqm-modal__name {
  font-size: 21px;
}

.rztqm-menu--template-3 .rztqm-modal__price {
  color: var(--rztqm-accent);
  font-size: 17px;
}
