:root {
    --gold: #c9a800; /* fills and rules */
    --gold-text: #6f5d00; /* text and buttons on white: 6.4:1 */
    --message-link: #e6cf5b; /* link in the black message strip */
    --black: #000000;
    --paper: #fff;
    --muted: #666666;
    --line: #e4e0d2;
}

* { box-sizing: border-box; }

body.shop {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1b1b1b;
    background: var(--paper);
    line-height: 1.45;
}

.notice {
    padding: .6rem 1rem;
    background: var(--black);
    color: var(--paper);
    font-size: .9rem;
    text-align: center;
}

.notice a { color: var(--message-link); }

.site-header {
    padding: 1rem;
    border-bottom: 3px solid var(--gold);
}

.site-header__brand {
    color: var(--black);
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
}

.site-main { max-width: 80rem; margin: 0 auto; padding: 1rem; }

.site-footer { padding: 1.5rem 1rem; color: var(--muted); text-align: center; font-size: .9rem; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; margin-top: .75rem; }
.site-footer__legal a { color: inherit; text-decoration: underline; }
.site-footer__legal a:hover, .site-footer__legal a:focus-visible { color: var(--black); }

h1 { margin: 0 0 1rem; font-size: 1.6rem; }

/* filters */
.filters {
    display: grid;
    gap: .75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f7f4e8;
    border: 1px solid var(--line);
    border-radius: .5rem;
}

.filters__field { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.filters__field input, .filters__field select { padding: .5rem; font: inherit; color: #1b1b1b; border: 1px solid #c9c2a6; border-radius: .35rem; background: var(--paper); }
.filters__actions { display: flex; align-items: center; gap: 1rem; }
.filters__reset { color: var(--gold-text); }

.button {
    padding: .55rem 1.1rem;
    font: inherit;
    font-weight: 600;
    color: var(--paper);
    background: var(--gold-text);
    border: 0;
    border-radius: .35rem;
    cursor: pointer;
}

.button:hover { background: var(--black); }

.result-count { margin: 0 0 1rem; color: var(--muted); }
.empty { padding: 2rem 0; text-align: center; color: var(--muted); }

/* grid and cards: 1 / 2 / 3 / 4 columns */
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }

.card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; }

.card__image {
    aspect-ratio: 1 / 1;
    background: #f3f0e6 url("../images/placeholder-can.svg") center / 35% no-repeat;
}

.card__image img { display: block; width: 100%; height: 100%; object-fit: contain; } /* no background: a failing image must show the placeholder behind it */

.card__body { display: flex; flex: 1; flex-direction: column; gap: .35rem; padding: .9rem; }
.card__name { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.card__brewery { margin: 0; color: var(--gold-text); font-weight: 600; }
.card__style { margin: 0; color: var(--muted); font-size: .9rem; }
.card__facts { margin: 0; font-size: .9rem; }
.card__dates { margin: 0; font-size: .85rem; color: var(--muted); }
.card__dates div { display: flex; gap: .35rem; }
.card__dates dt, .card__dates dd { margin: 0; }
.card__date--passed { color: #b00020; font-weight: 600; }
.card__price { margin: auto 0 0; padding-top: .5rem; font-size: 1.3rem; font-weight: 700; }
.card__bundle { margin: 0; font-size: .9rem; }
.card__remaining { margin: 0; color: #b00020; font-weight: 600; font-size: .9rem; }
.card__untappd { margin: 0; font-size: .9rem; }
.card__untappd a { color: var(--gold-text); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem 0; }
.pagination__item { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .9rem; color: var(--black); text-decoration: none; border: 1px solid var(--black); border-radius: .35rem; }
/* an inactive control: WCAG does not require contrast for it */
.pagination__item--disabled { color: #aaa; border-color: #ddd; }
.pagination__status { color: var(--muted); }

@media (min-width: 40rem) {
    .filters { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; }
    .filters__actions { grid-column: 1 / -1; }
    .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 60rem) { .grid { grid-template-columns: repeat(3, 1fr); } }

@media (min-width: 80rem) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* S05 cart */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.flash { margin: 0 auto 1rem; padding: .7rem 1rem; max-width: 70rem; background: #f3efdb; border-left: 4px solid var(--gold); }
.flash--warning { border-left-color: #b00020; }

.card__buy { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-top: .5rem; }
.card__quantity { display: flex; flex-direction: column; gap: .15rem; font-size: .8rem; color: var(--muted); }
.card__quantity input, .cart__quantity input { width: 4.5rem; padding: .45rem; font: inherit; border: 1px solid #c9c2a6; border-radius: .35rem; }
.card__unavailable { margin: .5rem 0 0; color: #b00020; font-weight: 600; font-size: .9rem; }
.button--secondary { color: var(--black); background: transparent; border: 1px solid var(--black); }
.button--secondary:hover { color: var(--paper); background: var(--black); }
.button[disabled] { cursor: not-allowed; opacity: .5; }
.button[disabled]:hover { background: var(--gold-text); }

.cart__hold { color: var(--muted); }
.cart__lines { margin: 0 0 1rem; padding: 0; list-style: none; }
.cart__line { display: grid; grid-template-columns: 80px 1fr; gap: .75rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.cart__line--gone { opacity: .7; }
.cart__image { width: 80px; height: 80px; background: url('../images/placeholder-can.svg') center / contain no-repeat; }
.cart__image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cart__info p { margin: 0 0 .15rem; }
.cart__name { font-weight: 600; }
.cart__brewery { color: var(--gold-text); }
.cart__kind { color: var(--muted); font-size: .9rem; }
.cart__warning { color: #b00020; font-weight: 600; font-size: .9rem; }
.cart__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; }
.cart__quantity { display: flex; align-items: end; gap: .5rem; }
.cart__quantity label { display: flex; flex-direction: column; gap: .15rem; font-size: .8rem; color: var(--muted); }
.cart__line-total { margin: 0; font-size: 1.15rem; font-weight: 700; }
.cart__remove { padding: .4rem .6rem; font: inherit; color: #b00020; background: none; border: 0; text-decoration: underline; cursor: pointer; }
.cart__total { font-size: 1.2rem; text-align: right; }
.cart__checkout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.cart__continue-link { color: var(--gold-text); }

@media (min-width: 40rem) {
    .cart__line { grid-template-columns: 80px 1fr auto; }
    .cart__actions { grid-column: auto; flex-direction: column; align-items: end; }
}

/* S06 checkout */
.cart__line--summary { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.checkout__summary { margin-bottom: 1.5rem; }
.checkout__form { display: grid; gap: 1rem; max-width: 34rem; }
.field { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--muted); border: 0; padding: 0; margin: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea { padding: .6rem; font: inherit; color: #1b1b1b; border: 1px solid #c9c2a6; border-radius: .35rem; }
.field__error { color: #b00020; font-weight: 600; }
.form-errors { margin: 0 0 1rem; padding: .7rem 1rem; background: #fdecee; border-left: 4px solid #b00020; }
.field--pickup legend { padding: 0; margin-bottom: .25rem; }
.pickup__option { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; color: #1b1b1b; font-size: 1rem; }
.checkout__payment { margin: 0; color: var(--muted); }
.confirmation__number { font-size: 1.2rem; }
.confirmation__pickup, .confirmation__lines { margin-bottom: 1.5rem; }
.button[disabled] { cursor: not-allowed; opacity: .5; }

/* S16 shop refresh */
:root { --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif; }

:focus-visible { outline: 3px solid var(--gold-text); outline-offset: 2px; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 10; padding: .6rem 1rem; color: var(--paper); background: var(--black); }
.skip-link:focus { left: 0; }

.message-strip { padding: .55rem 1rem; color: var(--paper); background: var(--black); text-align: center; font-size: .95rem; }
.message-strip__text { margin: 0; }
.message-strip__link { margin-left: .5rem; color: var(--message-link); font-weight: 600; }

.site-header { padding: .75rem 1rem; }
.site-header__brand { font-family: var(--display); font-size: 1.9rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.site-header__accent { color: var(--gold-text); }
.site-header__logo { display: block; height: 3rem; width: auto; max-width: 70vw; }

.pre-line { white-space: pre-line; }
.info-row { margin: 0; padding: .45rem 1rem; color: #3d3d3d; background: #f7f4e8; border-bottom: 1px solid var(--line); text-align: center; font-size: .85rem; }

.hero { position: relative; display: flex; align-items: center; min-height: 14rem; max-height: 45vh; overflow: hidden; background: var(--black); }
.hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__body { position: relative; z-index: 1; width: 100%; max-width: 80rem; margin: 0 auto; padding: 2rem 1rem; color: var(--paper); }
.hero__title, .hero__text { text-shadow: 0 1px 3px rgba(0, 0, 0, .65), 0 0 18px rgba(0, 0, 0, .35); } /* the photo is shown as uploaded: a soft shadow keeps the white text readable (S18) */
.hero__title { margin: 0 0 .5rem; max-width: 30rem; font-family: var(--display); font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 700; line-height: 1.05; text-transform: uppercase; }
.hero__text { margin: 0 0 1rem; max-width: 30rem; font-size: 1.05rem; }
.hero__button { display: inline-block; min-height: 2.75rem; padding-top: .7rem; text-decoration: none; background: var(--gold); color: var(--black); }
.hero__button:hover { background: var(--paper); }

h1 { font-family: var(--display); font-size: 2rem; text-transform: uppercase; letter-spacing: .02em; }
.button { min-height: 2.75rem; }
.card { border-radius: .75rem; }
.card__buy .button { flex: 1 1 auto; }
.card__price { font-size: 1.5rem; }
.card__remaining { display: inline-block; align-self: flex-start; padding: .1rem .5rem; background: #fdecee; border-radius: 1rem; font-size: .8rem; }
.cart__remove, .filters__reset { display: inline-flex; align-items: center; min-height: 2.75rem; }
.card__quantity input, .cart__quantity input { min-height: 2.75rem; }

/* filters: search always visible, the rest behind a button on a phone */
.filters { grid-template-columns: 1fr; gap: .5rem; padding: .75rem; }
.filters__panel { border: 0; }
.filters__toggle { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; font-weight: 600; cursor: pointer; border: 1px solid var(--black); border-radius: .35rem; background: var(--paper); list-style: none; }
.filters__toggle::-webkit-details-marker { display: none; }
.filters__fields { display: grid; gap: .75rem; margin-top: .75rem; }
.filters__field input, .filters__field select { min-height: 2.75rem; }
.filters__field { color: #555; }

/* cart and checkout: form and summary side by side on a wide screen */
.checkout { display: grid; gap: 1.5rem; }
.checkout__form { max-width: none; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea { min-height: 2.75rem; }
.checkout__summary { padding: 1rem; background: #f7f4e8; border: 1px solid var(--line); border-radius: .75rem; }

@media (min-width: 40rem) {
    .filters { grid-template-columns: 1fr auto; align-items: end; }
    .filters__panel { grid-column: 1 / -1; }
    .filters__fields { grid-template-columns: repeat(3, 1fr); }
    .filters__panel[data-synced] .filters__toggle { display: none; } /* the script keeps the panel open on a wide screen */
    .filters__panel[data-synced] .filters__fields { margin-top: 0; }
    .filters__actions { grid-column: auto; }
}

@media (min-width: 56.25rem) {
    .checkout { grid-template-columns: minmax(0, 1fr) 24rem; align-items: start; }
    .checkout__summary { position: sticky; top: 1rem; order: 2; margin-bottom: 0; }
    .checkout__main { order: 1; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* not shown, but read by screen readers: the catalogue page keeps its one h1 */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* S09 customer accounts */
.site-header__nav { display: flex; align-items: center; gap: .25rem; }
.site-header__account { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .5rem; color: var(--black); font-weight: 600; text-decoration: none; } /* also the front page's header link */
.site-header__account:hover { text-decoration: underline; }

.account { max-width: 36rem; }
.account__form { display: grid; gap: 1rem; margin: 1rem 0; }
.account__links { margin: 1rem 0; padding: 0; list-style: none; }
.account__links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.account h2 { margin: 1.5rem 0 .5rem; font-size: 1.2rem; }
.field input[type="password"] { padding: .6rem; min-height: 2.75rem; font: inherit; color: #1b1b1b; border: 1px solid #c9c2a6; border-radius: .35rem; }
.account a { color: var(--gold-text); }
.account .button { color: var(--paper); text-decoration: none; }
.account .button--secondary { color: var(--black); }
.account .button--secondary:hover { color: var(--paper); }

/* S12b legal pages: one narrow readable column */
.legal { max-width: 44rem; margin: 2rem auto; padding: 0 1rem; line-height: 1.6; }
.legal h1 { margin: 0 0 1rem; font-family: var(--display); text-transform: uppercase; }
.legal h2 { margin: 1.75rem 0 .5rem; font-size: 1.25rem; }
.legal p, .legal ul { margin: 0 0 1rem; }
.legal ul { padding-left: 1.25rem; }
.legal__updated { color: var(--muted); font-size: .9rem; }

/* S20a catalogue cards: the title sits on the picture, and every part of a card has its own row that the cards of one grid row share */
.card__image { position: relative; }
.card__name {
    position: absolute; right: 0; bottom: 0; left: 0; margin: 0; padding: .45rem .7rem;
    font-size: 1rem; line-height: 1.25; color: #fff; background: rgba(0, 0, 0, .72);
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere;
}
.button--bundle { color: var(--gold); background: var(--black); border: 1px solid var(--black); }
.button--bundle:hover { color: var(--black); background: var(--gold); }
.card__buy-single { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.card__buy .button--bundle { width: 100%; }
.button:focus-visible, .card__quantity input:focus-visible, .filters__toggle:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
.button--bundle:focus-visible { outline-color: var(--gold-text); }

@supports (grid-template-rows: subgrid) {
    .grid { row-gap: 0; }
    .card { display: grid; grid-row: span 11; grid-template-rows: subgrid; margin-bottom: 1rem; padding-bottom: .9rem; }
    .card__body { display: contents; }
    .card__image { grid-row: 1; }
    .card__brewery { grid-row: 2; }
    .card__style { grid-row: 3; }
    .card__facts { grid-row: 4; }
    .card__dates { grid-row: 5; }
    .card__price { grid-row: 6; align-self: end; margin: 0; }
    .card__bundle { grid-row: 7; }
    .card__remaining { grid-row: 8; }
    .card__untappd { grid-row: 9; }
    .card__buy { grid-row: 10 / span 2; display: grid; grid-template-rows: subgrid; margin-top: .5rem; align-content: start; }
    .card__buy-single { grid-row: 1; }
    .card__buy .button--bundle { grid-row: 2; align-self: start; }
    .card__unavailable { grid-row: 10 / span 2; }
    .card__brewery, .card__style, .card__facts, .card__dates, .card__price, .card__bundle, .card__remaining, .card__untappd,
    .card__buy, .card__unavailable { margin-right: .9rem; margin-left: .9rem; }
    .card__brewery, .card__style, .card__facts, .card__dates, .card__bundle, .card__untappd { padding-top: .2rem; }
    .card__remaining { align-self: start; justify-self: start; margin-top: .3rem; }
}

html { overflow-anchor: none; } /* S20a: the browser must not scroll the page by itself when the sticky filter form shrinks or grows */
/* S20a filters: stuck to the top while scrolling, one row (search + Filtre) after a bit of scrolling.
   The form never covers more than 60 % of the screen; when shrunk its fields open as an overlay (out of the flow), and the script
   gives the shrunk form a bottom margin as large as the height it lost (--filters-lost), so shrinking never moves the cards. */
.filters { position: sticky; top: 0; z-index: 20; max-height: 60vh; max-height: 60dvh; overflow-y: auto; overflow-anchor: none; } /* the browser must not scroll the page when the form shrinks */
.filters--compact { grid-template-columns: 1fr auto auto; align-items: end; gap: .5rem; padding: .4rem .75rem; overflow: visible; max-height: none; margin-bottom: calc(1rem + var(--filters-lost, 0px)); }
.filters--compact .filters__field--search > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.filters--compact .filters__panel { grid-column: auto; }
.filters--compact .filters__panel[data-synced] .filters__toggle { display: inline-flex; }
.filters--compact .filters__fields {
    position: absolute; top: 100%; right: 0; left: 0; z-index: 21; margin-top: 0; padding: .75rem;
    max-height: calc(60vh - 4.5rem); max-height: calc(60dvh - 4.5rem); overflow-y: auto;
    background: #f7f4e8; border: 1px solid var(--line); border-radius: 0 0 .5rem .5rem; box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}
.filters--compact .filters__panel:not([open]) ~ .filters__actions .button { display: none; }
.filters--compact .filters__panel[data-active="0"]:not([open]) ~ .filters__actions { display: none; }
.filters--compact .filters__panel[open] ~ .filters__actions .filters__reset { display: none; } /* no room next to Vis on a phone */

/* S20b header: cart and profile as icons with a small caption, the cart with a number badge */
.site-header__icon { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .15rem .4rem; color: var(--black); text-decoration: none; border: 0; border-radius: .35rem; }
.site-header__icon:hover { background: #f7f4e8; text-decoration: none; }
.site-header__icon:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
.site-header__svg { display: block; width: 1.5rem; height: 1.5rem; }
.site-header__caption { margin-top: .05rem; font-size: .75rem; font-weight: 600; line-height: 1.1; color: #222; white-space: nowrap; }
.site-header__count { position: absolute; top: .05rem; right: .05rem; min-width: 1.15rem; padding: 0 .3rem; font-size: .7rem; font-weight: 700; line-height: 1.15rem; text-align: center; color: var(--black); background: var(--gold); border-radius: 1rem; }

/* S20b cart: back on the left, forward on the right */
.cart__checkout { align-items: stretch; }
.cart__checkout .button { display: inline-flex; flex: 1 1 12rem; align-items: center; justify-content: center; text-decoration: none; }
@media (min-width: 40rem) { .cart__checkout .button { flex: 0 1 auto; min-width: 14rem; } }

/* S20b checkout: form and summary share the width from 900 px, inputs a bit narrower */
@media (min-width: 56.25rem) {
    .checkout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .checkout__form .field input[type="text"], .checkout__form .field input[type="email"], .checkout__form .field input[type="tel"], .checkout__form .field textarea { max-width: 26rem; }
}

/* S21a product page: picture next to the text on a wide screen, stacked on a phone */
.card__link { display: block; width: 100%; height: 100%; color: inherit; text-decoration: none; }
.card__link:focus-visible { outline: 3px solid var(--black); outline-offset: -3px; }
.product__back { margin: 0 0 1rem; }
.product__back a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--gold-text); }
.product { display: grid; gap: 1.5rem; }
.product__image { aspect-ratio: 1 / 1; background: #f3f0e6 url("../images/placeholder-can.svg") center / 35% no-repeat; border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; }
.product__image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product__headline { margin: 0 0 .5rem; }
.product__brewery { margin: 0 0 1rem; color: var(--gold-text); font-weight: 600; }
.product__description { margin: 0 0 1.25rem; max-width: 40rem; overflow-wrap: anywhere; }
.product__info { margin: 0 0 1.25rem; padding: 1rem; background: #f7f4e8; border: 1px solid var(--line); border-radius: .75rem; }
.product__info div { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.product__info div:last-child { border-bottom: 0; }
.product__info dt { margin: 0; color: #3d3d3d; }
.product__info dd { min-width: 0; margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.product__info a { color: var(--gold-text); }
.product__price { margin: 0; font-size: 1.8rem; font-weight: 700; }
.product__bundle { margin: .25rem 0 0; }
.product__buy { margin-top: 1rem; max-width: 24rem; }
.product__buy .card__buy { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.product__buy .card__unavailable { margin: 0; }
@media (min-width: 56.25rem) { .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
