/* ============================================================
   Menu Cafe — Public-menu theme system (seven distinct templates)
   Persian / RTL first. Each theme is scoped under .theme-<name>
   and driven by --t-* variables set inline from the palette
   (owner custom colors override defaults without changing layout).
   Category icons: .cat-icon sized via --icon-size (16–64px).
   ============================================================ */

.menu-theme {
  --icon-size: 28px;
  border-radius: 18px;
  padding: 1.25rem 1.25rem 2rem;
  background: var(--t-bg);
  color: var(--t-text);
  /* Explicit body stack (same as homepage/rest): Vazirmatn first, Tahoma
     fallback. Inherits correctly today, but explicit keeps Persian RTL
     rendering consistent across menus, categories, cards, buttons. */
  font-family: var(--font);
}

/* ---------- Category icons (shared) ---------- */
.cat-icon {
  width: var(--icon-size);
  height: auto;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.cat-head-beside { display: flex; align-items: center; gap: .6rem; }
.cat-head-above { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.cat-head-above.center, .cat-head-beside.center { align-items: center; text-align: center; }
.cat-head-above.center { align-items: center; }

/* ============================================================
   1) MODERN — clean, minimal, generous whitespace, big images
   ============================================================ */
.theme-modern { background: var(--t-bg); color: var(--t-text); }
.theme-modern .m-hero {
  background: var(--t-surface);
  border: 1px solid color-mix(in srgb, var(--t-primary) 12%, transparent);
  border-radius: 22px;
  padding: 2.4rem 1.6rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(28,25,23,.05), 0 8px 24px rgba(28,25,23,.06);
  margin-bottom: 1.4rem;
}
.theme-modern .m-hero img.m-logo {
  width: 96px; height: 96px; border-radius: 26px; object-fit: cover;
  border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.1);
}
.theme-modern .m-hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin: .8rem 0 .3rem; color: var(--t-text); }
.theme-modern .m-hero .sub { color: var(--t-text); opacity: .65; }
.theme-modern .m-nav {
  display: flex; gap: .5rem; overflow-x: auto; padding: .4rem 0 1.2rem;
  position: sticky; top: 57px; z-index: 5;
  background: color-mix(in srgb, var(--t-bg) 92%, transparent);
}
.theme-modern .m-nav a {
  flex: none; display: inline-flex; align-items: center; gap: .4rem;
  background: var(--t-surface); color: var(--t-text);
  border: 1px solid color-mix(in srgb, var(--t-primary) 22%, transparent);
  border-radius: 999px; padding: .42rem 1.05rem; font-size: .9rem; font-weight: 600;
}
.theme-modern .m-nav a:hover { background: var(--t-primary); color: #fff; text-decoration: none; }
.theme-modern .m-nav .cat-icon { --icon-size: 20px; }
.theme-modern .m-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.theme-modern .m-sec { margin-bottom: 2rem; }
.theme-modern .m-sec > h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: .2rem; color: var(--t-text); }
.theme-modern .m-sec .desc { opacity: .6; font-size: .88rem; margin-bottom: 1rem; }
.theme-modern .m-card {
  background: var(--t-surface); border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(0,0,0,.05);
  box-shadow: 0 1px 2px rgba(28,25,23,.05), 0 6px 18px rgba(28,25,23,.07);
  display: flex; flex-direction: column;
}
.theme-modern .m-card img.m-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: center; }
.theme-modern .m-card img.m-img.product-placeholder { object-fit: contain; }
.theme-modern .m-card .m-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.theme-modern .m-card h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.theme-modern .m-card .m-price { font-size: 1.15rem; font-weight: 800; color: var(--t-primary); white-space: nowrap; }
.theme-modern .m-card .m-foot { margin-top: auto; padding-top: .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.theme-modern .qty-btn.add { background: var(--t-btn); border-color: var(--t-btn); border-radius: 12px; padding: .5rem 1.4rem; }
.theme-modern .m-cartbar {
  position: sticky; bottom: 1rem; z-index: 30; margin-top: 1.4rem;
  background: var(--t-primary); color: #fff; border-radius: 18px;
  padding: .8rem 1.1rem; display: flex; align-items: center; gap: .8rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.theme-modern .m-cartbar .t { flex: 1; }
.theme-modern .m-cartbar .btn { background: #fff; color: var(--t-primary); border: none; font-weight: 800; }

/* ============================================================
   2) LUXURY — premium dark, elegant, gold accents
   ============================================================ */
.theme-luxury {
  background: var(--t-bg); color: var(--t-text);
  border: 1px solid color-mix(in srgb, var(--t-primary) 35%, transparent);
  letter-spacing: 0;
}
.theme-luxury .l-hero { text-align: center; padding: 2.6rem 1rem 1.6rem; }
.theme-luxury .l-rule { display: flex; align-items: center; gap: .9rem; margin: 1rem auto; max-width: 340px; }
.theme-luxury .l-rule::before, .theme-luxury .l-rule::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to left, transparent, var(--t-primary), transparent);
}
.theme-luxury .l-rule span { color: var(--t-primary); font-size: .8rem; letter-spacing: .35em; }
.theme-luxury .l-hero img.l-logo {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--t-primary); padding: 3px;
}
.theme-luxury .l-hero h1 { font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: .9rem 0 .2rem; color: var(--t-text); }
.theme-luxury .l-hero .sub { opacity: .7; font-size: .92rem; }
.theme-luxury .l-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; padding: 1rem 0 1.6rem; }
.theme-luxury .l-nav a {
  color: var(--t-secondary); border: 1px solid color-mix(in srgb, var(--t-primary) 45%, transparent);
  border-radius: 2px; padding: .35rem 1rem; font-size: .85rem; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: .4rem; background: transparent;
}
.theme-luxury .l-nav a:hover { background: var(--t-primary); color: #171717; text-decoration: none; }
.theme-luxury .l-nav .cat-icon { --icon-size: 18px; }
.theme-luxury .l-sec { margin-bottom: 2.2rem; }
.theme-luxury .l-sec-head { text-align: center; margin-bottom: 1.1rem; }
.theme-luxury .l-sec-head h2 { font-size: 1.3rem; font-weight: 700; color: var(--t-primary); margin: 0; }
.theme-luxury .l-sec-head .desc { opacity: .65; font-size: .85rem; }
.theme-luxury .l-item {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  /* wrap: an unusually long product name keeps its own line (the flex
     row used to over-constrain with qty>0 and crush the name to a
     column, or push price/qty past the card edge). Short names keep
     the single-line list look unchanged. */
  padding: .95rem .4rem; border-bottom: 1px solid color-mix(in srgb, var(--t-primary) 22%, transparent);
}
.theme-luxury .l-item img.l-img { width: 64px; height: 64px; aspect-ratio: 1/1; border-radius: 50%; object-fit: cover; object-position: center; border: 1px solid var(--t-primary); flex: none; }
.theme-luxury .l-item img.l-img.product-placeholder { object-fit: contain; }
.theme-luxury .l-item .grow { flex: 1 1 140px; min-width: 0; }
/* Definite basis (was flex:1 -> basis 0%): with a zero basis wrapping can
   never trigger, so once qty>0 the fixed price+dish-ctl strip (~243px)
   starves the name down to a vertical sliver. With a 140px basis the row
   wraps onto a second line only when it actually can't fit (<=~390px),
   and stays single-line like before on tablets/desktop and for plain
   rows («افزودن» only). */
.theme-luxury .l-item h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--t-text); }
.theme-luxury .l-item .d { opacity: .6; font-size: .82rem; margin: 0; }
.theme-luxury .l-dots { flex: none; width: 48px; border-bottom: 1px dotted color-mix(in srgb, var(--t-primary) 55%, transparent); height: 1px; }
.theme-luxury .l-price { color: var(--t-primary); font-weight: 800; white-space: nowrap; }
.theme-luxury .l-action { display: flex; align-items: center; gap: .7rem; flex: none; flex-wrap: wrap; }
.theme-luxury .dish-ctl { flex: none; }
.theme-luxury .qty-btn { background: transparent; color: var(--t-primary); border-color: var(--t-primary); }
.theme-luxury .qty-btn.add { border-radius: 2px; background: transparent; color: var(--t-primary); border: 1px solid var(--t-primary); }
.theme-luxury .qty-btn.add:hover { background: var(--t-primary); color: #171717; }
.theme-luxury .qty-num { color: var(--t-text); }
.theme-luxury .l-cartbar {
  position: sticky; bottom: 1rem; z-index: 30; margin-top: 1.6rem;
  border: 1px solid var(--t-primary); background: color-mix(in srgb, var(--t-bg) 60%, #000);
  color: var(--t-text); border-radius: 4px; padding: .8rem 1.1rem;
  display: flex; align-items: center; gap: .8rem;
}
.theme-luxury .l-cartbar .t { flex: 1; }
.theme-luxury .l-cartbar .btn { background: var(--t-primary); color: #171717; border: none; border-radius: 2px; font-weight: 800; }

/* ============================================================
   3) NATURE — calm organic, olive/sage, warm cream
   ============================================================ */
.theme-nature { background: var(--t-bg); color: var(--t-text); }
.theme-nature .n-hero {
  background:
    radial-gradient(420px 200px at 85% -40px, color-mix(in srgb, var(--t-secondary) 30%, transparent), transparent),
    radial-gradient(420px 220px at 10% 0%, color-mix(in srgb, var(--t-primary) 16%, transparent), transparent),
    var(--t-surface);
  border-radius: 28px; padding: 2.2rem 1.6rem; text-align: center;
  border: 1px solid color-mix(in srgb, var(--t-primary) 14%, transparent);
  margin-bottom: 1.3rem;
}
.theme-nature .n-hero img.n-logo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--t-surface); outline: 2px solid var(--t-secondary); }
.theme-nature .n-hero h1 { color: var(--t-primary); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin: .7rem 0 .2rem; }
.theme-nature .n-hero .sub { opacity: .7; }
.theme-nature .n-nav { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem 0 1.1rem; }
.theme-nature .n-nav a {
  flex: none; display: inline-flex; align-items: center; gap: .45rem;
  background: var(--t-surface); border: 1px solid var(--t-secondary);
  color: var(--t-primary); border-radius: 999px; padding: .4rem 1rem; font-weight: 700; font-size: .88rem;
}
.theme-nature .n-nav a:hover { background: var(--t-primary); border-color: var(--t-primary); color: #fff; text-decoration: none; }
.theme-nature .n-nav .cat-icon { --icon-size: 20px; }
.theme-nature .n-sec { margin-bottom: 1.8rem; }
.theme-nature .n-sec-head {
  display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem;
  background: var(--t-surface); border: 1px solid color-mix(in srgb, var(--t-primary) 14%, transparent);
  border-radius: 18px; padding: .7rem 1rem;
  border-inline-start: 5px solid var(--t-primary);
}
.theme-nature .n-sec-head h2 { margin: 0; font-size: 1.15rem; color: var(--t-primary); font-weight: 800; }
.theme-nature .n-sec-head .desc { margin: 0; opacity: .65; font-size: .83rem; }
.theme-nature .n-card {
  display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; background: var(--t-surface);
  border-radius: 22px; padding: .8rem; margin-bottom: .7rem;
  border: 1px solid color-mix(in srgb, var(--t-primary) 12%, transparent);
}
.theme-nature .n-card img.n-img { width: 76px; height: 76px; aspect-ratio: 1/1; border-radius: 20px 20px 20px 6px; object-fit: cover; object-position: center; flex: none; }
.theme-nature .n-card img.n-img.product-placeholder { object-fit: contain; }
.theme-nature .n-card .grow { flex: 1 1 120px; min-width: 0; }
/* Same over-constraint guard as luxury: a definite basis lets the row
   wrap price+qty onto a second line at very narrow widths instead of
   starving the name (flex:1 -> basis 0% could never wrap). */
.theme-nature .n-card h3 { margin: 0; font-size: 1rem; }
.theme-nature .n-card .m-price { color: var(--t-primary); font-weight: 800; white-space: nowrap; }
.theme-nature .n-action { display: flex; align-items: center; gap: .6rem; flex: none; flex-wrap: wrap; }
.theme-nature .qty-btn.add { background: var(--t-primary); border-color: var(--t-primary); color: #fff; border-radius: 999px; }
.theme-nature .n-cartbar {
  position: sticky; bottom: 1rem; z-index: 30; margin-top: 1.2rem;
  background: var(--t-primary); color: #fff; border-radius: 999px;
  padding: .7rem 1.2rem; display: flex; align-items: center; gap: .8rem;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--t-primary) 45%, transparent);
}
.theme-nature .n-cartbar .t { flex: 1; }
.theme-nature .n-cartbar .btn { background: #fff; color: var(--t-primary); border: none; border-radius: 999px; font-weight: 800; }

/* ============================================================
   4) CLASSIC — traditional cafe, ivory/burgundy/bronze
   ============================================================ */
.theme-classic { background: var(--t-bg); color: var(--t-text); }
.theme-classic .c-hero {
  border: 3px double var(--t-secondary); border-radius: 6px; background: var(--t-surface);
  padding: 2.2rem 1.5rem; text-align: center; margin-bottom: 1.5rem;
}
.theme-classic .c-hero .est { color: var(--t-secondary); font-size: .78rem; letter-spacing: .3em; }
.theme-classic .c-hero img.c-logo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--t-secondary); margin-top: .6rem; }
.theme-classic .c-hero h1 { color: var(--t-primary); font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 800; margin: .6rem 0 .2rem; }
.theme-classic .c-hero .sub { opacity: .75; }
.theme-classic .c-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; border-top: 1px solid var(--t-secondary); border-bottom: 1px solid var(--t-secondary); margin-bottom: 1.6rem; }
.theme-classic .c-nav a {
  padding: .55rem 1.1rem; color: var(--t-primary); font-weight: 700; font-size: .9rem;
  border-inline-end: 1px solid var(--t-secondary); display: inline-flex; align-items: center; gap: .4rem;
}
.theme-classic .c-nav a:last-child { border-inline-end: none; }
.theme-classic .c-nav a:hover { background: var(--t-primary); color: #fff; text-decoration: none; }
.theme-classic .c-nav .cat-icon { --icon-size: 18px; }
.theme-classic .c-sec { margin-bottom: 2rem; }
.theme-classic .c-sec-head { text-align: center; margin-bottom: 1rem; }
.theme-classic .c-sec-head .no { color: var(--t-secondary); font-size: .8rem; letter-spacing: .25em; }
.theme-classic .c-sec-head h2 { color: var(--t-primary); font-size: 1.4rem; margin: .1rem 0; }
.theme-classic .c-sec-head hr { border: none; border-top: 1px solid var(--t-secondary); max-width: 220px; margin: .5rem auto; position: relative; }
.theme-classic .c-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.theme-classic .c-card {
  background: var(--t-surface); border: 1px solid var(--t-secondary); border-radius: 6px;
  padding: 1rem; display: flex; gap: .8rem; align-items: flex-start;
}
.theme-classic .c-card img.c-img { width: 72px; height: 72px; aspect-ratio: 1/1; border-radius: 4px; object-fit: cover; object-position: center; border: 1px solid var(--t-secondary); flex: none; }
.theme-classic .c-card img.c-img.product-placeholder { object-fit: contain; }
.theme-classic .c-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.theme-classic .c-card h3 { margin: 0; font-size: .99rem; color: var(--t-primary); }
.theme-classic .c-card .m-price {
  display: inline-block; border: 1px solid var(--t-secondary);
  color: var(--t-primary); border-radius: 4px; padding: .05rem .6rem; font-weight: 800; font-size: .9rem; white-space: nowrap;
}
.theme-classic .c-card .c-action { margin-top: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-top: .4rem; }
.theme-classic .c-card .c-action .m-price { margin-top: 0; }
.theme-classic .qty-btn.add { background: var(--t-btn); border-color: var(--t-btn); border-radius: 4px; }
.theme-classic .c-cartbar {
  position: sticky; bottom: 1rem; z-index: 30; margin-top: 1.4rem;
  background: var(--t-surface); border: 2px solid var(--t-secondary); border-radius: 6px;
  padding: .75rem 1rem; display: flex; align-items: center; gap: .8rem; color: var(--t-text);
}
.theme-classic .c-cartbar .t { flex: 1; }
.theme-classic .c-cartbar .btn { background: var(--t-primary); color: #fff; border: none; border-radius: 4px; font-weight: 800; }

/* ============================================================
   5) DYNAMIC — energetic, bold, compact, strong CTAs
   ============================================================ */
.theme-dynamic { background: var(--t-bg); color: var(--t-text); }
.theme-dynamic .d-hero {
  background: linear-gradient(135deg, var(--t-primary), color-mix(in srgb, var(--t-primary) 55%, var(--t-secondary)));
  color: #fff; border-radius: 20px; padding: 1.8rem 1.4rem; margin-bottom: 1rem;
  display: flex; gap: 1rem; align-items: center;
}
.theme-dynamic .d-hero img.d-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; border: 2px solid rgba(255,255,255,.6); flex: none; }
.theme-dynamic .d-hero h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 900; text-transform: none; }
.theme-dynamic .d-hero .sub { margin: 0; opacity: .85; font-size: .88rem; }
.theme-dynamic .d-nav { display: flex; gap: .45rem; overflow-x: auto; padding: .2rem 0 1rem; position: sticky; top: 57px; z-index: 5; background: var(--t-bg); }
.theme-dynamic .d-nav a {
  flex: none; font-weight: 800; font-size: .85rem; padding: .4rem .9rem; border-radius: 10px;
  background: var(--t-surface); color: var(--t-text); border: 2px solid transparent;
  display: inline-flex; align-items: center; gap: .35rem;
}
.theme-dynamic .d-nav a:hover { border-color: var(--t-primary); text-decoration: none; }
.theme-dynamic .d-nav .cat-icon { --icon-size: 18px; }
.theme-dynamic .d-sec { margin-bottom: 1.4rem; }
.theme-dynamic .d-sec-head { display: flex; align-items: baseline; gap: .7rem; margin-bottom: .6rem; }
.theme-dynamic .d-sec-head h2 { margin: 0; font-size: 1.25rem; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; }
.theme-dynamic .d-sec-head h2::before { content: ""; display: inline-block; width: .55em; height: .55em; background: var(--t-primary); border-radius: 3px; margin-inline-end: .45em; }
.theme-dynamic .d-sec-head .count { background: var(--t-secondary); color: #fff; font-size: .75rem; font-weight: 800; border-radius: 999px; padding: .05rem .6rem; }
.theme-dynamic .d-row {
  display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; background: var(--t-surface);
  border-radius: 14px; padding: .55rem .7rem; margin-bottom: .5rem;
  border-inline-start: 4px solid var(--t-primary);
}
.theme-dynamic .d-row img.d-img { width: 54px; height: 54px; aspect-ratio: 1/1; border-radius: 10px; object-fit: cover; object-position: center; flex: none; }
.theme-dynamic .d-row img.d-img.product-placeholder { object-fit: contain; }
.theme-dynamic .d-row .grow { flex: 1 1 120px; min-width: 0; }
/* Same over-constraint guard as luxury/nature (definite basis + wrap). */
.theme-dynamic .d-row h3 { margin: 0; font-size: .95rem; font-weight: 800; }
.theme-dynamic .d-row .d { margin: 0; opacity: .6; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-dynamic .d-price { background: var(--t-primary); color: #fff; font-weight: 900; border-radius: 9px; padding: .2rem .6rem; font-size: .88rem; white-space: nowrap; }
.theme-dynamic .d-action { display: flex; align-items: center; gap: .5rem; flex: none; flex-wrap: wrap; }
.theme-dynamic .qty-btn { width: 30px; height: 30px; }
.theme-dynamic .qty-btn.add { background: var(--t-btn); border-color: var(--t-btn); border-radius: 10px; font-size: .85rem; padding: .3rem .9rem; width: auto; }
.theme-dynamic .d-cartbar {
  position: sticky; bottom: 1rem; z-index: 30; margin-top: 1.2rem;
  background: #1c1917; color: #fff; border-radius: 14px;
  padding: .75rem 1rem; display: flex; align-items: center; gap: .8rem;
  border: 2px solid var(--t-primary);
}
.theme-dynamic .d-cartbar .t { flex: 1; }
.theme-dynamic .d-cartbar .btn { background: var(--t-primary); color: #fff; border: none; border-radius: 10px; font-weight: 900; }

/* ============================================================
   6) COZY — warm bakery, caramel, soft rounded comfort
   ============================================================ */
.theme-cozy { background: var(--t-bg); color: var(--t-text); }
.theme-cozy .z-hero {
  background: var(--t-surface); border-radius: 30px; padding: 2.4rem 1.5rem 1.8rem;
  text-align: center; border: 1px dashed color-mix(in srgb, var(--t-primary) 35%, transparent);
  margin-bottom: 1.3rem;
}
.theme-cozy .z-hero img.z-logo {
  width: 110px; height: 130px; object-fit: cover; flex: none;
  border-radius: 999px 999px 26px 26px; border: 3px solid #fff;
  outline: 2px solid var(--t-secondary); box-shadow: 0 8px 20px rgba(139,94,60,.22);
}
.theme-cozy .z-hero h1 { color: var(--t-primary); font-weight: 800; font-size: clamp(1.55rem, 3vw, 2.1rem); margin: .8rem 0 .2rem; }
.theme-cozy .z-hero .warm { color: var(--t-secondary); font-size: .9rem; }
.theme-cozy .z-hero .sub { opacity: .7; font-size: .88rem; }
.theme-cozy .z-nav { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem 0 1.1rem; justify-content: flex-start; }
.theme-cozy .z-nav a {
  flex: none; display: inline-flex; align-items: center; gap: .45rem;
  background: var(--t-surface); color: var(--t-primary);
  border-radius: 999px; padding: .45rem 1.1rem; font-weight: 700; font-size: .88rem;
  border: 1px solid color-mix(in srgb, var(--t-secondary) 55%, transparent);
  box-shadow: 0 2px 6px rgba(139,94,60,.12);
}
.theme-cozy .z-nav a:hover { background: var(--t-primary); color: #fff; text-decoration: none; }
.theme-cozy .z-nav .cat-icon { --icon-size: 20px; }
.theme-cozy .z-sec { margin-bottom: 1.8rem; }
.theme-cozy .z-sec-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.theme-cozy .z-sec-head h2 { margin: 0; font-size: 1.2rem; color: var(--t-primary); font-weight: 800; }
.theme-cozy .z-sec-head::after { content: ""; flex: 1; border-top: 2px dotted var(--t-secondary); }
.theme-cozy .z-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.theme-cozy .z-card {
  background: var(--t-surface); border-radius: 26px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--t-primary) 12%, transparent);
  box-shadow: 0 4px 14px rgba(139,94,60,.12); display: flex; flex-direction: column;
}
.theme-cozy .z-card img.z-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: center; }
.theme-cozy .z-card img.z-img.product-placeholder { object-fit: contain; }
.theme-cozy .z-card .z-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.theme-cozy .z-card h3 { margin: 0; font-size: 1rem; }
.theme-cozy .z-card .z-price { color: var(--t-primary); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.theme-cozy .z-card .z-foot { margin-top: auto; padding-top: .4rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.theme-cozy .qty-btn.add { background: var(--t-btn); border-color: var(--t-btn); border-radius: 999px; }
.theme-cozy .z-cartbar {
  position: sticky; bottom: 1rem; z-index: 30; margin-top: 1.3rem;
  background: var(--t-primary); color: #fff; border-radius: 26px;
  padding: .8rem 1.2rem; display: flex; align-items: center; gap: .8rem;
  box-shadow: 0 10px 24px rgba(139,94,60,.35);
}
.theme-cozy .z-cartbar .t { flex: 1; }
.theme-cozy .z-cartbar .btn { background: #fff; color: var(--t-primary); border: none; border-radius: 999px; font-weight: 800; }

/* ============================================================
   7) CORAL — dark premium cafe, coral accent, photo-first cards
   ============================================================ */
.theme-coral { background: var(--t-bg); color: var(--t-text); }
.theme-coral .r-hero {
  position: relative; overflow: hidden; text-align: center;
  border-radius: 24px; padding: 2.6rem 1.4rem 1.9rem; margin-bottom: 1.2rem;
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--t-primary) 28%, transparent), transparent 60%),
    var(--t-surface);
  border: 1px solid color-mix(in srgb, var(--t-primary) 25%, transparent);
}
.theme-coral .r-cover {
  min-height: 190px; border-radius: 18px;
  /* Normal flow spacing (was -46px overlap): the brand block used to be
     pulled up onto the cover's bottom edge, which collided with the 76px
     fallback letter whenever the cafe name wrapped to 3+ lines. Keeping
     the brand in its own row eliminates that overlap for any name length. */
  margin-bottom: .9rem;
  /* Polished fallback shown when the cover is hidden or missing.
     When visible, Business.cover renders as .r-cover-img instead.
     The logo is never used here — logo and cover stay independent. */
  background:
    radial-gradient(90% 100% at 50% 0%, color-mix(in srgb, var(--t-primary) 34%, transparent), transparent 62%),
    radial-gradient(60% 55% at 85% 90%, color-mix(in srgb, var(--t-secondary) 20%, transparent), transparent 65%),
    repeating-linear-gradient(115deg, color-mix(in srgb, var(--t-text) 3.5%, transparent) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #2b2320 0%, #1c1614 55%, var(--t-surface) 100%);
  border: 1px solid color-mix(in srgb, var(--t-primary) 22%, transparent);
}
/* Full-bleed hero background: when a cover image is present it fills the
   entire hero edge to edge behind the content — never an inset framed
   image. The hero already provides the positioning context (relative)
   and clipping (overflow hidden + radius), so only the image needs to
   be taken out of flow. Fallback (.r-cover), toggles, and hero padding
   stay untouched. */
.theme-coral .r-hero:has(> img.r-cover-img) {
  min-height: clamp(280px, 45vw, 400px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.theme-coral .r-hero:has(> img.r-cover-img) .r-brand {
  position: relative;
  z-index: 1;
}
.theme-coral .r-cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  border: 0; border-radius: 0; margin: 0; display: block;
  background: var(--t-surface);
}
/* Readability blur: only the cover image is blurred, and only while the
   brand block (logo and/or brand text) sits on top of it. The slight
   scale keeps blurred edges from revealing the surface behind the image,
   so the hero stays full-bleed. Logo, text, and fallback are untouched. */
.theme-coral .r-cover-img.is-blurred {
  filter: blur(8px);
  transform: scale(1.05);
}
.theme-coral .r-brand {
  position: relative; display: flex; align-items: center; gap: .9rem;
  text-align: start; padding: 0 .4rem;
}
.theme-coral .r-brand img.r-logo {
  width: 76px; height: 76px; object-fit: cover; flex: none; border-radius: 22px;
  border: 2px solid var(--t-primary); background: var(--t-surface);
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
}
.theme-coral .r-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  width: 76px; height: 76px; flex: none; border-radius: 22px;
  background: var(--t-primary); color: #1a0f0c;
  font-size: 2rem; font-weight: 800;
  border: 2px solid var(--t-primary); box-shadow: 0 8px 20px rgba(0,0,0,.45);
}
.theme-coral .r-brand-text { min-width: 0; }
.theme-coral .r-hero h1 { font-weight: 800; font-size: clamp(1.35rem, 3vw, 1.9rem); margin: 0 0 .15rem; color: var(--t-text); }
.theme-coral .r-hero .sub { opacity: .72; font-size: .9rem; }
/* Sticky offset matches the other themes (modern/dynamic use 57px) so the
   toolbar parks below the sticky public-topbar instead of sliding under it. */
.theme-coral .r-toolbar { position: sticky; top: 57px; z-index: 20; padding: .5rem 0 .8rem; background: color-mix(in srgb, var(--t-bg) 92%, transparent); }
.theme-coral .r-search { position: relative; margin-bottom: .6rem; }
.theme-coral .r-search-icon {
  position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%);
  color: var(--t-primary); pointer-events: none;
}
.theme-coral .r-search-input {
  width: 100%; background: var(--t-surface); color: var(--t-text);
  border: 1px solid color-mix(in srgb, var(--t-text) 16%, transparent);
  border-radius: 999px; padding: .7rem 2.7rem .7rem 1.1rem; font-size: .95rem; font-family: inherit;
}
.theme-coral .r-search-input::placeholder { color: color-mix(in srgb, var(--t-text) 45%, transparent); }
.theme-coral .r-search-input:focus { outline: 2px solid var(--t-primary); outline-offset: 1px; border-color: var(--t-primary); }
.theme-coral .r-nav {
  display: flex; gap: .5rem; overflow-x: auto; padding: .1rem .1rem .3rem;
  scrollbar-width: thin;
}
.theme-coral .r-pill {
  flex: none; display: inline-flex; align-items: center; gap: .45rem;
  background: var(--t-surface); color: var(--t-text);
  border: 1px solid color-mix(in srgb, var(--t-primary) 35%, transparent);
  border-radius: 999px; padding: .45rem 1.15rem; font-weight: 700; font-size: .88rem;
  font-family: inherit; cursor: pointer;
}
.theme-coral .r-pill:hover { border-color: var(--t-primary); }
.theme-coral .r-pill.is-active { background: var(--t-primary); border-color: var(--t-primary); color: #1a0f0c; }
.theme-coral .r-pill:focus-visible,
.theme-coral .qty-btn:focus-visible, .theme-coral .r-cartbar .btn:focus-visible,
.theme-coral .cart-fab:focus-visible { outline: 2px solid var(--t-secondary); outline-offset: 2px; }
.theme-coral .r-nav .cat-icon { --icon-size: 20px; }
.theme-coral .r-result { margin: .45rem .2rem 0; }
.theme-coral .r-sec { margin-bottom: 2rem; scroll-margin-top: 70px; }
.theme-coral .r-sec-head h2 { margin: 0; font-size: 1.25rem; color: var(--t-primary); font-weight: 800; }
.theme-coral .r-sec-head .desc { opacity: .6; font-size: .88rem; margin: .2rem 0 1rem; }
.theme-coral .r-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.theme-coral .r-card h3, .theme-coral .r-card .d { overflow-wrap: anywhere; }
.theme-coral .r-card {
  background: var(--t-surface); border-radius: 20px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--t-text) 10%, transparent);
  box-shadow: 0 8px 22px rgba(0,0,0,.35); display: flex; flex-direction: column;
}
.theme-coral .r-card img.r-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: center; }
.theme-coral .r-card img.r-img.product-placeholder { object-fit: contain; }
.theme-coral .r-card .r-body { padding: .95rem 1.05rem 1.05rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.theme-coral .r-card h3 { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--t-text); }
.theme-coral .r-card .d { opacity: .65; font-size: .86rem; margin: 0; }
.theme-coral .r-card .r-foot {
  margin-top: auto; padding-top: .5rem;
  display: flex; align-items: center; gap: .4rem;
  flex-wrap: wrap;
}
.theme-coral .r-card .r-price { color: var(--t-primary); font-weight: 800; font-size: 1.08rem; white-space: nowrap; }
.theme-coral .r-card .r-action { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-inline-start: auto; }
/* Price stays nowrap; the action group wraps as a unit so the price and
   control remain adjacent even on narrow 2-column cards. */
.theme-coral .qty-btn.add { background: var(--t-btn); border-color: var(--t-btn); color: #1a0f0c; border-radius: 999px; font-weight: 800; }
.theme-coral .r-cartbar {
  position: sticky; bottom: 1rem; z-index: 30; margin-top: 1.3rem;
  background: var(--t-primary); color: #1a0f0c; border-radius: 20px;
  padding: .8rem 1.2rem; display: flex; align-items: center; gap: .8rem;
  box-shadow: 0 12px 28px rgba(255,111,97,.3);
}
.theme-coral .r-cartbar .t { flex: 1; }
.theme-coral .r-cartbar .btn { background: #1a0f0c; color: #fff; border: none; border-radius: 999px; font-weight: 800; }
@media (max-width: 360px) {
  .theme-coral .r-grid { grid-template-columns: 1fr; }
  .theme-coral .r-brand { align-items: flex-start; }
}
.theme-coral { padding-bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px)); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Unavailable products (listed but not orderable) ---------- */
.menu-theme .unavailable { opacity: .72; }
.menu-theme .unavailable img { filter: grayscale(45%); }

/* ---------- Preview badge ---------- */
.preview-badge {
  display: inline-block; background: #1c1917; color: #fff; font-size: .8rem;
  border-radius: 999px; padding: .25rem .9rem; margin-bottom: .8rem;
}

/* ---------- Horizontal category nav: hide visual scrollbar, keep touch scroll ---------- */
.theme-modern .m-nav,
.theme-nature .n-nav,
.theme-dynamic .d-nav,
.theme-cozy .z-nav,
.theme-coral .r-nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.theme-modern .m-nav::-webkit-scrollbar,
.theme-nature .n-nav::-webkit-scrollbar,
.theme-dynamic .d-nav::-webkit-scrollbar,
.theme-cozy .z-nav::-webkit-scrollbar,
.theme-coral .r-nav::-webkit-scrollbar {
  display: none;
}

/* ---------- Responsive: mobile / tablet / desktop ---------- */
@media (max-width: 860px) {
  .menu-theme { padding: 1rem .9rem 1.6rem; }
  .theme-modern .m-grid, .theme-classic .c-grid, .theme-cozy .z-grid, .theme-coral .r-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-dynamic .d-row .d { display: none; }
}
@media (max-width: 560px) {
  /* minmax(0,1fr): a plain 1fr keeps the auto min-content floor, so a
     long unbreakable token could push the single column (and the whole
     page) wider than the viewport. */
  .theme-modern .m-grid, .theme-classic .c-grid { grid-template-columns: minmax(0, 1fr); }
  /* Coral keeps two columns on ordinary phones; only exceptionally
     narrow screens collapse to protect readability. */
  .theme-coral .r-grid { gap: .8rem; }
  .theme-cozy .z-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .theme-luxury .l-dots { display: none; }
  .theme-modern .m-hero, .theme-nature .n-hero,
  .theme-classic .c-hero, .theme-cozy .z-hero { padding: 1.6rem 1rem; }
}
@media (min-width: 861px) {
  .theme-dynamic .d-sec { columns: 2; column-gap: 1rem; }
  .theme-dynamic .d-sec-head { column-span: all; }
  .theme-dynamic .d-row { break-inside: avoid; }
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .menu-theme *, .menu-theme *::before, .menu-theme *::after {
    animation: none !important; transition: none !important;
  }
}

/* ============================================================
   8) CROSS-THEME ROBUSTNESS
   Owner-entered text must never push a card or hero wider than
   the viewport. Long unbreakable tokens (product names, English
   words, IDs) were clipping the hero and item rows on the luxury,
   classic, dynamic, and nature themes — only modern handled them
   via overflow-wrap:anywhere. Applied theme-wide here so item
   text wraps instead of overflowing its container.
   ============================================================ */
.menu-theme :is(h1, h2, h3, h4, p, .desc, .muted, .small) {
  overflow-wrap: break-word;
}
/* Cart bar: the count line and total line were two inline runs that
   rendered visually jammed together and wrapped mid-phrase on narrow
   screens. Stack the two lines like the generic cart page does. */
[id="cartBar"] .t > strong,
[id="cartBar"] .t > span { display: block; }
/* The empty-cart bar must actually disappear. Every theme styles the bar
   with .x-cartbar { display:flex }, which beats the UA stylesheet's
   [hidden] { display:none } — so on real pages the bar rendered
   «۰ قلم در سبد / جمع: ۰ تومان» plus a «مشاهده سبد خرید» CTA even with
   an empty cart, and the JS bar.hidden toggle could never hide it. */
[id="cartBar"][hidden] { display: none; }
/* Coral sold-out badge: keep the full word on one line and let the
   nowrap price flow to its own row instead of squeezing the badge
   down to its first letter. */
.theme-coral .badge { flex: none; white-space: nowrap; }


/* ---------- Service request (درخواست خدمت‌رسانی) ---------- */
.service-request-wrap {
  position: fixed;
  bottom: 1rem;
  inset-inline-start: 1rem;
  z-index: 100;
}
.service-request-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--t-primary) 30%, transparent);
  background: var(--t-surface);
  color: var(--t-primary);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.service-request-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.service-request-btn:disabled { opacity: .6; cursor: wait; }
.service-request-icon { font-size: 1.2rem; line-height: 1; }
.service-request-label { font-size: .9rem; }
.service-request-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.service-request-modal[hidden] { display: none; }
.service-request-modal-box {
  background: var(--t-surface);
  color: var(--t-text);
  padding: 1.2rem;
  border-radius: 18px;
  width: min(360px, 92vw);
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.service-request-input {
  width: 100%;
  padding: .6rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--t-primary) 30%, transparent);
  background: var(--t-bg);
  color: var(--t-text);
  font-size: 1rem;
  margin-bottom: .8rem;
  box-sizing: border-box;
}
.service-request-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.service-request-actions .btn { flex: 1; min-width: 120px; }
.service-request-feedback { margin: .6rem 0 0; font-size: .9rem; min-height: 1.4em; }
.service-request-feedback.success { color: #0e7c66; }
.service-request-feedback.error { color: #c0392b; }
@media (max-width: 480px) {
  .service-request-wrap { bottom: 5rem; }
  .service-request-label { display: none; }
  .service-request-btn { padding: .65rem; border-radius: 50%; }
}

