/* The Café Hans Menu (customer/cafe_menu.html): the dark look of the drinks page, the board as a list
   by section and series, and the order sheet that opens over it. Mobile first. */

/* style.css makes <body> its own scroll box; zoomed down to fit a short screen (fit.js) that box comes up
   short and leaves white under it. Here the window scrolls instead, on the page's own dark colour */
html:has(.cm-page) { background: var(--bl-night, #16110f); }
/* clip, not hidden: nothing can push the page sideways, and the tabs still stick (no scroll box is made) */
html:has(.cm-page) body { height: auto; overflow: visible; overflow-x: clip; background: var(--bl-night, #16110f); }

.cm-page {
  min-height: calc(100vh / var(--fit, 1));
  min-height: calc(100dvh / var(--fit, 1));
  color: var(--bl-on-dark, #fff);
  background-color: var(--bl-night, #16110f);
  background-image: radial-gradient(70% 40% at 50% 0%, rgba(199, 216, 187, 0.1), rgba(199, 216, 187, 0) 70%);
  background-repeat: no-repeat;
  font-family: 'Josefin Sans', sans-serif;
}

.cm-bar { background: transparent; border-bottom: 1px solid var(--bl-night-line, rgba(255, 255, 255, 0.1)); }

.cm-back {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  color: var(--bl-brown-dark, #1d1815);
  background: #fff;
  border-radius: 12px;
}

.cm-back:hover { color: var(--bl-brown-dark, #1d1815); background: var(--bl-mint-card, #d6e1ce); }
.cm-back:focus-visible { outline: 3px solid var(--bl-mint, #c7d8bb); outline-offset: 2px; }

.cm-bar-title { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.3px; }

.cm-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 120px;              /* room under the list for the help chat's button */
}

.cm-eyebrow {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--bl-mint, #c7d8bb);
}

.cm-title {
  margin: 8px 0 0;
  font-family: var(--bl-font-display);
  font-size: clamp(2rem, 9vw / var(--fit, 1), 3.2rem);
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.cm-lead { margin: 12px 0 0; font-size: 1rem; line-height: 1.5; color: var(--bl-on-dark-muted, #c5bab0); }
.cm-lead a { color: var(--bl-mint, #c7d8bb); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the section tabs: one page of the board at a time; they stay at the top ---------- */
.cm-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 22px -16px 0;
  padding: 10px 16px;
  background: var(--bl-night, #16110f);
}

.cm-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  padding: 0 10px;
  font-weight: 700;
  font-size: clamp(0.88rem, 3.4vw / var(--fit, 1), 1.05rem);
  white-space: nowrap;
  color: var(--bl-on-dark, #fff);
  border: 1.5px solid var(--bl-night-line, rgba(255, 255, 255, 0.18));
  border-radius: 14px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cm-tab i { font-size: 1.15em; }
.cm-tab:hover { color: #fff; border-color: var(--bl-mint, #c7d8bb); }
.cm-tab.is-on { color: var(--bl-night, #16110f); background: var(--bl-mint, #c7d8bb); border-color: var(--bl-mint, #c7d8bb); }
.cm-tab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cm-legend { margin: 12px 0 0; font-size: 0.88rem; color: var(--bl-on-dark-muted, #c5bab0); }
.cm-star { margin-left: 2px; font-size: 0.72em; color: #d4a017; vertical-align: 0.1em; }

/* ---------- a page of the board: cream paper, black series bars and price columns, like the printed one ---------- */
.cm-board {
  margin-top: 16px;
  padding: clamp(18px, 4vw / var(--fit, 1), 36px) clamp(14px, 3.5vw / var(--fit, 1), 36px) clamp(20px, 4vw / var(--fit, 1), 36px);
  color: #141110;
  background: #f4efe9;
  background-image: radial-gradient(120% 70% at 85% 0%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 60%);
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
  scroll-margin-top: 80px;
}

.cm-board[hidden] { display: none; }

.cm-board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #141110;
}

.cm-board-head h2 {
  margin: 0;
  font-family: var(--bl-font-display);
  font-size: clamp(2rem, 9vw / var(--fit, 1), 3.4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.cm-board-head img { flex: none; width: clamp(86px, 18vw / var(--fit, 1), 130px); height: auto; margin-bottom: 4px; }

.cm-board-grid { display: grid; gap: 26px clamp(28px, 4vw / var(--fit, 1), 48px); margin-top: 22px; }

@media (min-width: 900px) {
  .cm-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* a series' black bar, with its column headings over the prices */
.cm-series-head {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 9px 12px 9px 14px;
  color: #fff;
  background: #141110;
  border-radius: 999px;
}

.cm-series-head h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.cm-series-head .cm-col { font-size: 0.74rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #e6dfd8; }

.cm-series-note { margin: 8px 4px 0; font-size: 0.84rem; font-weight: 600; color: #4a5e3f; }

/* the price columns line up under their headings */
.cm-col { flex: none; width: 58px; text-align: right; }

.cm-list { margin: 4px 0 0; padding: 0; list-style: none; }

.cm-item {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 11px 12px 11px 14px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 1px dashed rgba(20, 17, 16, 0.18);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.cm-list li:last-child .cm-item { border-bottom: 0; }
.cm-item:hover { background: rgba(20, 17, 16, 0.06); }
.cm-item:focus-visible { outline: 2px solid #141110; outline-offset: -2px; }

.cm-item-text { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding-right: 8px; }
.cm-item-name { font-weight: 700; font-size: 0.98rem; letter-spacing: 0.3px; text-transform: uppercase; }
.cm-item-desc { font-size: 0.82rem; font-style: italic; line-height: 1.4; color: #5b514b; }

.cm-amt { font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cm-amt.is-off { text-decoration: line-through; opacity: 0.4; }
.cm-none { font-weight: 600; color: #a39890; }

.cm-item.is-off .cm-item-name,
.cm-item.is-off .cm-amt { opacity: 0.45; }

.cm-off {
  padding: 2px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.3px;
  color: #fff;
  background: #a1302b;
  border-radius: 999px;
}

/* ---------- phones: every width from 320px up, nothing wider than the screen ---------- */
@media (max-width: 480px) {
  .cm-main { padding-top: 20px; }
  .cm-lead { font-size: 0.95rem; }
  .cm-tabs { gap: 6px; margin-top: 18px; padding-top: 8px; padding-bottom: 8px; }
  /* the icon over the word, so "Non-Coffee" fits a third of the narrowest screen */
  .cm-tab { flex-direction: column; gap: 3px; min-height: 58px; padding: 6px 4px; font-size: 0.84rem; border-radius: 12px; }
  .cm-tab i { font-size: 1.2rem; }
  .cm-legend { font-size: 0.82rem; }

  .cm-board { margin-left: -6px; margin-right: -6px; padding: 18px 12px 16px; border-radius: 18px; }
  .cm-board-head { gap: 10px; padding-bottom: 10px; }
  .cm-board-head h2 { font-size: clamp(1.8rem, 9vw / var(--fit, 1), 2.4rem); }
  .cm-board-head img { width: clamp(78px, 24vw / var(--fit, 1), 100px); }
  .cm-board-grid { gap: 20px; margin-top: 16px; }

  .cm-series-head { padding: 8px 8px 8px 12px; }
  .cm-series-head h3 { font-size: 0.8rem; letter-spacing: 1px; }
  .cm-series-head .cm-col { font-size: 0.68rem; letter-spacing: 0.5px; }
  .cm-col { width: 48px; }
  .cm-item { padding: 10px 8px 10px 12px; }
  .cm-item-text { padding-right: 6px; }
  .cm-item-name { font-size: 0.88rem; letter-spacing: 0.2px; overflow-wrap: anywhere; }
  .cm-item-desc { font-size: 0.8rem; }
  .cm-amt { font-size: 0.92rem; }
}

/* the narrowest phones (320-360px) */
@media (max-width: 360px) {
  .cm-main { padding-left: 12px; padding-right: 12px; }
  .cm-tabs { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .cm-tab { font-size: 0.78rem; }
  .cm-board { margin-left: -4px; margin-right: -4px; padding-left: 8px; padding-right: 8px; }
  .cm-col { width: 44px; }
  .cm-item { padding-left: 8px; padding-right: 6px; }
  .cm-series-head { padding-left: 10px; padding-right: 6px; }
  .cm-item-name { font-size: 0.84rem; }
  .cm-amt { font-size: 0.86rem; }
}

/* a phone on its side: short, so the tabs stay slim */
@media (max-height: 480px) and (orientation: landscape) {
  .cm-tab { flex-direction: row; min-height: 42px; }
}

.cm-empty { margin-top: 30px; color: var(--bl-on-dark-muted, #c5bab0); }

/* ---------- the order sheet: up from the bottom on phones, a card in the middle on wide screens ---------- */
.cm-sheet {
  width: 100%;
  max-width: 520px;
  max-height: calc(92vh / var(--fit, 1));
  margin: auto auto 0;
  padding: 0;
  color: var(--bl-brown-dark, #1d1815);
  background: #fff;
  border: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
}

.cm-sheet::backdrop { background: rgba(10, 7, 6, 0.6); }

@media (min-width: 700px) {
  .cm-sheet { margin: auto; border-radius: 22px; }
}

.cm-sheet-inner { position: relative; padding: 22px 20px 20px; }

.cm-sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  color: inherit;
  background: #f2ece7;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.cm-sheet-close:focus { outline: none; }
.cm-sheet-close:focus-visible { outline: 2px solid #6b7f5e; outline-offset: 2px; }

.cm-sheet-series {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6b7f5e;
}

.cm-sheet-name { margin: 4px 48px 0 0; font-family: var(--bl-font-display); font-size: 1.5rem; font-weight: 800; }
.cm-sheet-desc { margin: 8px 0 0; font-size: 0.92rem; line-height: 1.45; color: #5b514b; }
.cm-sheet-note { margin: 10px 0 0; padding: 8px 12px; font-size: 0.88rem; background: #eef3ea; border-radius: 10px; }

.cm-choose { margin: 16px 0 0; padding: 0; border: 0; }
.cm-choose legend { float: none; width: auto; margin: 0 0 8px; font-size: 0.92rem; font-weight: 700; }

.cm-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.cm-chip { position: relative; }
.cm-chip input { position: absolute; opacity: 0; pointer-events: none; }

.cm-chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  background: #f2ece7;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.cm-chip small { font-weight: 600; color: #6e625a; }
.cm-chip input:checked + span { color: #fff; background: var(--bl-night, #16110f); }
.cm-chip input:checked + span small { color: var(--bl-mint, #c7d8bb); }
.cm-chip input:focus-visible + span { border-color: #6b7f5e; }
.cm-chip input:disabled + span { cursor: not-allowed; opacity: 0.45; text-decoration: line-through; }

.cm-note-box { display: block; margin-top: 16px; }
.cm-note-box > span { display: block; margin-bottom: 6px; font-size: 0.92rem; font-weight: 700; }
.cm-note-box small { font-weight: 500; color: #6e625a; }

.cm-note-box input {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 1rem;
  background: #faf7f5;
  border: 1.5px solid #e2d8cf;
  border-radius: 12px;
}

.cm-note-box input:focus { outline: none; border-color: #6b7f5e; }

.cm-sheet-foot { display: flex; align-items: center; gap: 12px; margin-top: 20px; }

.cm-qty {
  display: flex;
  flex: none;
  align-items: center;
  background: #f2ece7;
  border-radius: 999px;
}

.cm-qty button {
  width: 44px;
  height: 48px;
  font: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.cm-qty button:disabled { opacity: 0.35; cursor: not-allowed; }
.cm-qty span { min-width: 22px; font-weight: 800; text-align: center; }

.cm-add {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  color: #fff;
  background: var(--bl-night, #16110f);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.cm-add:hover { color: #fff; background: #000; }
.cm-add:disabled { cursor: not-allowed; opacity: 0.5; }

.cm-sheet-error { margin: 12px 0 0; font-size: 0.9rem; font-weight: 600; color: #a1302b; }

/* ---------- added: a note at the bottom with the way to the cart ---------- */
.cm-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 32px);
  padding: 12px 16px 12px 18px;
  color: var(--bl-night, #16110f);
  background: var(--bl-mint-card, #d6e1ce);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
}

.cm-toast span { font-weight: 700; }

.cm-toast a {
  flex: none;
  padding: 7px 14px;
  font-weight: 700;
  color: #fff;
  background: var(--bl-night, #16110f);
  border-radius: 999px;
}

.cm-toast a:hover { color: #fff; }
