/* 67 Specialty Coffee — customer menu.
   Layout: night-black brand band (lockup + product photo), a sticky kraft-paper search bar, then a centred column that widens with the screen:
   category tiles 2→3 across, product cards 2→3→4 across, branch cards four across on every screen, and a compact night footer with the 67 pattern.
   Identity kept as is: kraft paper, cocoa, night black, neon accent, the 67 mark and pattern. */
:root {
  color-scheme: light;
  --paper: #F1E6DA; --paper-2: #E7D8C7; --line: #D8C6B2; --cocoa: #5A4A3E; --ink: #2B211A; --muted: #6F5D4E;
  --night: #120D0A; --night-2: #1E1611; --night-fg: #F1E6DA; --night-muted: #B9A897; --neon: #E8A450;
  --card: #FCF8F2; --bronze: #8A5A1F; --bronze-line: rgba(138, 90, 31, .28); --card-muted: #75634F;
  --danger: #A23B2A; --surface: #FBF6F0;
  --display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --body: "IBM Plex Sans Arabic", "Alexandria", "Segoe UI", Tahoma, Arial, sans-serif;
  --wrap: 1120px;
  --r-lg: 18px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 18px 32px -24px rgba(43, 33, 26, .55);
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100% }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; font-weight: 400; line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper) }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0 }
ul { list-style: none }
a { color: inherit; text-decoration: none }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
img { display: block; max-width: 100% }
:focus-visible { outline: 2px solid var(--cocoa); outline-offset: 3px; border-radius: 6px }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.col { width: 100%; max-width: var(--wrap); margin-inline: auto }
.num { font-variant-numeric: tabular-nums }
.ico { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
[dir="ltr"] .flip { transform: scaleX(-1) }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* ---------- Brand band ---------- */
.band { background: var(--night); color: var(--night-fg) }
.brandbar { padding-block: 18px 6px }
.brandbar .col { display: flex; justify-content: center }
.lockup { width: min(220px, 58vw); height: auto }
.hero-wrap { padding-block: 0 0 }
.hero, .banner { width: 100%; max-width: 760px; height: auto; margin-inline: auto }
.banner-mark { display: grid; place-items: center; padding-block: 28px; background: var(--night) }
.banner-mark img { width: 52px; height: auto }

/* ---------- Sticky bar + search ---------- */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: rgba(241, 230, 218, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-block: 10px }
.bar .col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px }
.bar-top { display: flex; align-items: center; gap: 10px }
.mark { flex: none; display: grid; place-items: center; width: 42px; height: 46px }
.mark img { height: 38px; width: auto }
.search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center }
.search .ico { position: absolute; inset-inline-start: 16px; width: 19px; height: 19px; color: var(--muted); pointer-events: none }
#q { width: 100%; height: 46px; padding-inline: 46px 44px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: 15.5px; color: var(--ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 8px 18px -16px rgba(43, 33, 26, .6); transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none }
#q::-webkit-search-cancel-button { display: none }
#q::placeholder { color: var(--muted); opacity: .9 }
#q:focus { outline: none; border-color: var(--cocoa); box-shadow: 0 0 0 3px rgba(90, 74, 62, .14) }
.clear { position: absolute; inset-inline-end: 6px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--cocoa) }
.clear .ico { position: static; width: 15px; height: 15px; color: currentColor }
#lang { flex: none; height: 46px; min-width: 56px; padding-inline: 14px; background: transparent; color: var(--cocoa); border: 1px solid var(--cocoa); border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 14px; transition: background .15s, color .15s }
#lang:hover { background: var(--cocoa); color: var(--paper) }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; scroll-padding-inline: 16px; mask-image: linear-gradient(to left, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%) }
.tabs::-webkit-scrollbar { display: none }
.tabs a { flex: none; padding: 6px 15px; font-family: var(--display); font-size: 14px; font-weight: 500; color: var(--cocoa); border: 1px solid var(--line); border-radius: 999px; background: var(--card); transition: background .15s, border-color .15s }
.tabs a:hover { border-color: var(--cocoa) }
.tabs a[aria-current="page"] { background: var(--cocoa); border-color: var(--cocoa); color: var(--paper) }

/* ---------- Page rhythm ---------- */
main { padding-block: 24px 0 }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px }
.stack.tight { gap: 22px }
.sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px }
.sec-title { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw + 14px, 30px); line-height: 1.25; color: var(--cocoa); letter-spacing: -.005em; text-wrap: balance }
.sec-meta { font-size: 13.5px; color: var(--muted); white-space: nowrap }
.sec-sub { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--cocoa) }
.sec-sub::after { content: ""; flex: 1; height: 1px; background: var(--line) }
.empty-msg { padding-block: 30px; color: var(--muted) }

/* ---------- Category tiles ---------- */
.mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.tile { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--night); color: var(--night-fg); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease }
.tile-photo { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--night) }
.tile-photo img.photo { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease }
.tile-photo::after { content: ""; position: absolute; inset: auto 0 0; height: 34%; background: linear-gradient(to top, var(--night), transparent) }
.tile.pattern .tile-photo .marks { position: absolute; inset: 0; background: url("images/mark-paper.png") 0 0 / 28px auto repeat; opacity: .12 }
.tile.pattern .tile-photo .solo { position: absolute; inset: 0; margin: auto; height: 46%; width: auto }
.tile-text { display: flex; align-items: center; gap: 10px; padding: 10px 14px 13px; margin-top: -2px }
.tile-name { flex: 1; min-width: 0; display: grid }
.tile-name b { font-family: var(--display); font-weight: 600; font-size: 16.5px; line-height: 1.3 }
.tile-name small { font-size: 12.5px; color: var(--neon); line-height: 1.4 }
.tile-go { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(241, 230, 218, .28); border-radius: 50%; color: var(--night-fg); transition: background .2s, color .2s, border-color .2s }
.tile-go .ico { width: 15px; height: 15px }
.mosaic .tile:last-child:nth-child(odd) { grid-column: 1 / -1 }
.mosaic .tile:last-child:nth-child(odd) .tile-photo { aspect-ratio: 8 / 3 }

/* ---------- Branches ---------- */
.branches { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; max-width: 760px; margin-inline: auto; width: 100% }
.branch { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; gap: 7px; padding: 6px 6px 10px; text-align: center; background: var(--card); border: 1px solid var(--bronze-line); border-radius: var(--r-md); box-shadow: var(--shadow); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease }
.branch-photo { width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm); background: var(--paper) }
.branch-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease }
.branch-body { min-width: 0; display: grid; justify-items: center; gap: 5px }
.branch-name { font-family: var(--display); font-weight: 600; font-size: 12px; line-height: 1.35; color: var(--cocoa) }
.branch-name small { display: none }
.branch-cta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--body); font-weight: 500; font-size: 11px; color: var(--card-muted); transition: color .2s }
.branch-cta .ico { width: 13px; height: 13px }

/* ---------- Product cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.cards > li { min-width: 0; display: flex }
.card { width: 100%; min-width: 0; display: flex; flex-direction: column; padding: 6px; background: var(--card); color: var(--ink); border: 1px solid var(--bronze-line); border-radius: var(--r-md); text-align: start; box-shadow: var(--shadow); transition: border-color .2s ease, transform .2s ease }
.card-photo { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm); background: var(--paper) }
.card-photo > img:not(.solo) { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease }
.card-photo.empty { background: var(--paper-2) }
.card-photo.empty .marks { position: absolute; inset: 0; background: url("images/mark-cocoa.png") 0 0 / 28px auto repeat; opacity: .06 }
.card-photo.empty .solo { position: absolute; inset: 0; margin: auto; width: 34%; height: auto }
.card-photo .badge-out { position: absolute; top: 8px; inset-inline-start: 8px; margin: 0 }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 10px 6px 4px }
.card-text { display: grid; gap: 2px; padding-bottom: 10px; min-width: 0 }
.card h3 { font-family: var(--display); font-size: 15.5px; font-weight: 600; color: var(--cocoa); line-height: 1.4; text-wrap: balance }
.alt { font-size: 13px; color: var(--muted) }
.card .alt { font-size: 12px; line-height: 1.4; color: var(--card-muted) }
.card .desc { font-size: 12.5px; line-height: 1.55; color: var(--card-muted) }
.card .incat { font-size: 12px; font-weight: 500; color: var(--bronze) }
.card-price { margin-top: auto; display: flex; align-items: baseline; gap: 4px; padding-top: 8px; border-top: 1px solid var(--bronze-line); color: var(--card-muted); line-height: 1.2 }
.card-price b { font-family: var(--body); font-size: 21px; font-weight: 700; color: var(--bronze); font-variant-numeric: tabular-nums }
.card-price small { font-size: 12px }
.card.is-out .card-photo > img { opacity: .5 }
.card.is-out .card-text, .card.is-out .card-price { opacity: .6 }
.badge-out { display: inline-block; font-family: var(--display); font-size: 11.5px; font-weight: 600; color: var(--paper); background: var(--danger); padding: 1px 9px; border-radius: 999px }

/* ---------- Footer ---------- */
.foot { position: relative; margin-top: 48px; background: var(--night); color: var(--night-fg); overflow: hidden; padding-block: 26px calc(18px + env(safe-area-inset-bottom, 0px)) }
.foot .marks { position: absolute; inset: 0; background: url("images/mark-paper.png") 0 0 / 34px auto repeat; opacity: .06; pointer-events: none }
.foot .col { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px }
.foot-top { display: grid; justify-items: center; gap: 16px; text-align: center }
.foot .lockup { width: 168px }
.foot-tag { font-size: 13.5px; color: var(--night-muted); max-width: 30em }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px }
.social { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 16px 6px 14px; border: 1px solid rgba(241, 230, 218, .26); border-radius: 999px; background: rgba(241, 230, 218, .04); font-family: var(--display); font-size: 14px; font-weight: 500; transition: background .2s, border-color .2s, color .2s }
.social .ico { width: 18px; height: 18px }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding-top: 14px; border-top: 1px solid rgba(241, 230, 218, .12); font-size: 12.5px; color: var(--night-muted) }

/* ---------- Product sheet ---------- */
dialog { border: 0; padding: 0; background: var(--paper); color: var(--ink); width: min(520px, 100%); max-width: 100%; max-height: 90%; margin: auto auto 0; overflow-y: auto; border-radius: 20px 20px 0 0 }
dialog::backdrop { background: rgba(18, 13, 10, .62) }
.sheet { padding: 12px max(18px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px }
.sheet-close { justify-self: end; display: inline-flex; align-items: center; gap: 6px; background: var(--paper-2); border: 0; border-radius: 999px; padding: 5px 14px; font-family: var(--display); font-size: 13.5px; font-weight: 500 }
.sheet-img { width: min(300px, 80%); aspect-ratio: 1; object-fit: cover; justify-self: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg) }
.sheet h2 { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.3; color: var(--cocoa) }
.facts { display: grid; gap: 10px; font-size: 15px; padding-top: 4px }
.facts dt { font-family: var(--display); font-size: 12.5px; font-weight: 500; color: var(--muted) }
.sheet-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; font-weight: 700; font-size: 30px; color: var(--bronze) }
.sheet-price small { font-size: 14px; font-weight: 400; color: var(--muted) }
.opts { display: grid; gap: 2px }
.opts li { display: flex; justify-content: space-between; gap: 12px; padding-block: 8px; border-bottom: 1px solid var(--line); font-weight: 500 }
.opts li:last-child { border-bottom: 0 }
.opts li span:last-child { color: var(--bronze); font-weight: 700 }

/* ---------- Editor preview strip (only shown to editors with an unpublished draft) ---------- */
.preview-strip { background: var(--neon); color: var(--ink); padding-block: 7px; font-size: 13.5px; font-weight: 500 }
.preview-strip .col { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px }
.preview-strip a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px }
img.broken { object-fit: contain; opacity: .35; padding: 18% }

/* ---------- Access screen for #admin (non-editors) ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding-block: 32px; background: var(--night); color: var(--night-fg); position: relative; overflow: hidden }
.gate .marks { position: absolute; inset: 0; background: url("images/mark-paper.png") 0 0 / 34px auto repeat; opacity: .06 }
.gate-card { position: relative; width: min(420px, 100%); display: grid; justify-items: center; gap: 14px; text-align: center; padding: 30px 24px; background: var(--night-2); border: 1px solid rgba(241, 230, 218, .12); border-radius: var(--r-lg) }
.gate-card img { width: 150px; height: auto }
.gate-card h1 { font-family: var(--display); font-weight: 700; font-size: 21px }
.gate-card p { font-size: 14.5px; color: var(--night-muted) }
.gate-card a { display: inline-flex; align-items: center; min-height: 42px; padding: 6px 18px; border-radius: 999px; background: var(--night-fg); color: var(--night); font-family: var(--display); font-weight: 600; font-size: 14px }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(241, 230, 218, .2); border-top-color: var(--neon); animation: spin .8s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }

#toast { position: fixed; inset: auto 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 520px; margin-inline: auto; z-index: 60; background: var(--night); color: var(--night-fg); padding: 11px 18px; border-radius: 14px; font-weight: 500; font-size: 14.5px; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .15s, transform .15s; pointer-events: none; box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .7) }
#toast.show { opacity: 1; transform: none }
#toast.bad { background: var(--danger) }

/* ---------- Hover (pointer devices only) ---------- */
@media (hover: hover) {
  .tile:hover { transform: translateY(-3px); box-shadow: 0 24px 36px -26px rgba(43, 33, 26, .8) }
  .tile:hover img.photo { transform: scale(1.05) }
  .tile:hover .tile-go { background: var(--neon); border-color: var(--neon); color: var(--night) }
  .branch:hover { transform: translateY(-3px); border-color: var(--bronze) }
  .branch:hover .branch-photo img { transform: scale(1.05) }
  .branch:hover .branch-cta { color: var(--cocoa) }
  .card:hover { border-color: var(--bronze); transform: translateY(-2px) }
  .card:hover .card-photo > img:not(.solo) { transform: scale(1.04) }
  .social:hover { background: var(--night-fg); border-color: var(--night-fg); color: var(--night) }
}

/* ---------- Breakpoints: tablet / desktop ---------- */
@media (min-width: 640px) {
  .mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px }
  .mosaic .tile:last-child:nth-child(odd) { grid-column: auto }
  .mosaic .tile:last-child:nth-child(odd) .tile-photo { aspect-ratio: 4 / 3 }
  .mosaic .tile:last-child:nth-child(3n + 1) { grid-column: 2 }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px }
  .branches { gap: 14px }
  .branch { padding: 8px 8px 12px; gap: 9px }
  .branch-name { font-size: 14px }
  .branch-cta { font-size: 12px }
}
@media (min-width: 760px) {
  .foot { padding-block: 30px calc(20px + env(safe-area-inset-bottom, 0px)) }
  .foot-top { grid-template-columns: auto minmax(0, 1fr) auto; justify-items: stretch; text-align: start; align-items: center; gap: 28px }
  .foot-tag { justify-self: start }
  .socials { justify-content: flex-end }
  .foot-bottom { justify-content: space-between }
  main { padding-block: 32px 0 }
  .stack { gap: 44px }
}
@media (min-width: 980px) {
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px }
  .mosaic { gap: 16px }
  .card h3 { font-size: 16px }
  .brandbar { padding-block: 22px 8px }
}
@media (min-width: 560px) { dialog { margin: auto; border-radius: 20px } }
@media (prefers-reduced-motion: reduce) {
  .tile, .tile img.photo, .branch, .branch-photo img, .card, .card-photo > img, #toast { transition: none }
  .tile:hover, .branch:hover, .card:hover { transform: none }
  .tile:hover img.photo, .branch:hover .branch-photo img, .card:hover .card-photo > img:not(.solo) { transform: none }
  .spinner { animation-duration: 2s }
}

/* ---------- Saudi riyal symbol ---------- */
.money { display: inline-flex; align-items: center; gap: .22em; white-space: nowrap; line-height: 1; direction: ltr }
[dir="rtl"] .money { direction: rtl }
.sar { height: .78em; width: auto; flex: none; fill: currentColor; position: relative; top: -.02em }
.card-price .money { color: var(--bronze) }
.card-price .money b { font-size: 21px }
.card-price .money .sar { height: 15px }
.sheet-price .money { font-size: 30px; font-weight: 700; color: var(--bronze) }
.sheet-price .money .sar { height: 23px }
.opts .money { color: var(--bronze); font-weight: 700 }
.opts .money .sar { height: 13px }

/* ---------- Continuous menu ---------- */
.menu-flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px }
.catsec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px }
.catsec + .catsec { padding-top: 34px; border-top: 1px solid var(--line) }
@media (min-width: 760px) { .menu-flow { gap: 48px } .catsec + .catsec { padding-top: 42px } }
