/* Bernie's blue is almost exactly the browser's link blue — so here the brand is the hyperlink. */
:root {
  --blue: #0027F6;
  --ink: #111;
  --mute: #6b6b6b;
  --sys: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #fff; color: var(--ink); font: 15px/1.4 var(--sys); -webkit-text-size-adjust: 100%; }
a { color: var(--blue); text-underline-offset: 2px; }
a:visited { color: var(--blue); }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
small, .small { font-size: 12px; color: var(--mute); }

.top { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 14px 0; }
.top__id { display: flex; align-items: center; gap: 8px; color: var(--blue); text-decoration: none; font: 18px/1 "Mansalva", cursive; letter-spacing: .04em; }
.top__id img { width: 28px; height: 28px; }
.top__bag { font-size: 14px; }

.wrap { padding: 0 14px; }
main { max-width: 560px; padding-bottom: 20px; }

.date { margin: 22px 0 2px; font-size: 13px; letter-spacing: .04em; color: var(--mute); }
.h { margin: 0 0 10px; font-size: 15px; font-weight: 700; letter-spacing: .02em; }

/* today's photo: a different crop of a real Bernie's photo every day */
.ph { margin: 0 -14px; overflow: hidden; aspect-ratio: 4 / 5; background: #e9e6fb; }
.ph img { width: 100%; height: 100%; object-fit: cover; }

.ratio { margin: 10px 0 14px; font-size: 15px; font-variant-numeric: tabular-nums; }
.ratio b { margin-right: 6px; }
.ref { font-size: 10px; letter-spacing: .08em; color: var(--mute); border: 1px solid #ccc; padding: 0 3px; vertical-align: 2px; cursor: help; }

.dl { display: grid; grid-template-columns: 62px 1fr; gap: 6px 10px; margin: 0 0 14px; padding: 10px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.dl dt { color: var(--mute); font-size: 13px; padding-top: 1px; }
.dl dd { margin: 0; }
.pr { color: var(--mute); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }

.line { margin: 0 0 16px; font-size: 15px; }

.acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.acts button { border: 1px solid var(--blue); background: #fff; color: var(--blue); padding: 11px 14px; font-weight: 600; letter-spacing: .03em; border-radius: 0; }
.acts button:first-child, #pay { background: var(--blue); color: #fff; }
.acts button:active { transform: translateY(1px); }
.acts button:disabled { opacity: .45; cursor: default; }

/* HAZLO: the page becomes the thing next to your bowl */
#maker { border-left: 3px solid var(--blue); padding: 2px 0 2px 12px; margin: 0 0 16px; }
.mk { margin: 0; padding: 0 0 0 18px; display: grid; gap: 8px; }
.mk label { cursor: pointer; }
.mk input { accent-color: var(--blue); width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.mk button { margin-left: 6px; border: 1px solid var(--blue); background: var(--blue); color: #fff; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.mk button:disabled { opacity: .4; }
.count { margin: 8px 0 0; font-size: 64px; line-height: 1; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; min-height: 0; }
.count:empty { display: none; }

.nav { margin: 0 0 14px; font-size: 14px; }
.dim { color: var(--mute); }
.club { margin: 0; font-size: 13px; }
.club i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--blue); margin: 0 0 0 4px; vertical-align: -1px; }
.club i.s { background: #cfd6ff; }
.club i.m { background: var(--blue); }

/* archive: a dense, plain list */
.arch { list-style: none; margin: 8px 0; padding: 0; }
.arch li a { display: grid; grid-template-columns: 92px 44px 1fr; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid #eee; text-decoration: none; color: var(--ink); font-size: 13px; }
.arch li a:hover .ao { text-decoration: underline; color: var(--blue); }
.arch img { width: 44px; height: 44px; object-fit: cover; }
.ad { font-variant-numeric: tabular-nums; color: var(--mute); letter-spacing: .02em; }
.arch li.made .ad::after { content: " ●"; color: var(--blue); }
.ao { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* store */
.shop { list-style: none; margin: 8px 0; padding: 0; }
.shop li { border-bottom: 1px solid #e5e5e5; }
.shop__row { width: 100%; display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; background: none; border: 0; text-align: left; color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.shop__row img { width: 56px; height: 40px; object-fit: cover; }
.shop__row .pr { text-decoration: none; }
.shop__more { display: none; padding: 4px 0 12px; }
.shop li.open .shop__more { display: block; }
.shop__ph { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 8px; scrollbar-width: none; }
.shop__ph img { height: 120px; width: auto; flex: none; }
.shop__more p { margin: 0 0 6px; }
.buy { display: flex; gap: 8px; align-items: stretch; }
.qty { display: inline-flex; align-items: center; border: 1px solid #999; }
.qty button { width: 32px; height: 32px; border: 0; background: none; font-size: 16px; }
.qty b { min-width: 18px; text-align: center; }
.add { border: 1px solid var(--blue); background: var(--blue); color: #fff; padding: 0 12px; font-weight: 600; }

.bag { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 14px; }
.bag td { padding: 7px 0; border-bottom: 1px solid #e5e5e5; }
.bag td.qty { border: 0; border-bottom: 1px solid #e5e5e5; display: table-cell; white-space: nowrap; }
.bag td.qty button { width: 28px; height: 28px; border: 1px solid #bbb; background: #fff; }
.bag td.qty b { display: inline-block; min-width: 22px; text-align: center; }
.bag .pr { text-align: right; }
.bag .tot td { font-weight: 700; color: var(--ink); }

.side { display: none; }
.foot { margin: 28px 14px calc(24px + env(safe-area-inset-bottom)); max-width: 560px; font-size: 11px; color: var(--mute); }

/* desktop: today on the left, the archive always open on the right */
@media (min-width: 900px) {
  .top, .wrap, .foot { padding-left: 40px; padding-right: 40px; margin-left: 0; }
  .foot { margin: 28px 40px 32px; padding: 0; }
  .wrap { display: grid; grid-template-columns: minmax(0, 560px) 340px; gap: 0 80px; }
  .ph { margin: 0; }
  .side { display: block; position: sticky; top: 20px; align-self: start; padding-top: 22px; }
  .side__h { margin: 0 0 4px; font-size: 13px; color: var(--mute); letter-spacing: .04em; }
  body[data-view="archivo"] .side { visibility: hidden; }
}
