/*
 * FarmersMarkets user interface styles.
 *
 * The look follows the brand banner (static/img/brand/banner.jpg): deep olive green ink on warm paper,
 * botanical line art and a sturdy slab serif for headings. Pickup times are still written in chalk.
 * No CSS framework: custom properties on :root and a mobile-first layout with breakpoints at
 * 600 px (large phones), 768 px (tablets), 1024 px (laptops) and 1280 px (desktops).
 */

/* ---------- Tokens ---------- */
:root {
    color-scheme: light;

    /* The banner green (#2c4b24) and its tints */
    --green-950: #142310;
    --green-900: #1c3217;
    --green-800: #24401e;
    --green-700: #2c4b24;
    --green-600: #3b6232;
    --green-500: #4e7a42;
    --green-400: #739a66;
    --green-300: #a3bf98;
    --green-200: #cddcc5;
    --green-100: #e5eedf;
    --green-50: #f2f6ee;

    --paper: #fbfaf5;
    --paper-2: #f3f1e8;
    --card: #ffffff;
    --ink: #1d2a1c;
    --ink-soft: #4a5847;
    --muted: #697565;
    --line: #e2e6da;
    --line-strong: #c9d2bd;

    /* The sunflower from the banner: highlights and chalk */
    --sun: #e9a825;
    --sun-600: #9a6a05;
    --sun-100: #fdf2d3;
    --berry: #a8322d;
    --berry-600: #8a2723;
    --berry-100: #fbe6e3;
    --sky: #2f6fa5;
    --sky-100: #e4eef7;

    --radius-lg: 22px;
    --radius: 16px;
    --radius-sm: 10px;
    --pill: 999px;
    --shadow-sm: 0 1px 2px rgb(28 50 23 / 6%);
    --shadow: 0 1px 2px rgb(28 50 23 / 6%), 0 8px 24px -12px rgb(28 50 23 / 22%);
    --shadow-lg: 0 2px 6px rgb(28 50 23 / 8%), 0 22px 44px -18px rgb(28 50 23 / 32%);

    --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Podkova", Georgia, "Times New Roman", serif;
    --font-hand: "Caveat", "Segoe Print", cursive;

    --container: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 64px;
    --tabbar-h: 62px;
    --focus: var(--green-500);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* The hidden attribute must win over layout classes such as .stack { display: grid } */
[hidden] {
    display: none !important;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    /* Links into a page (a list's next page, say) stop below the sticky header, which grows by the notch */
    scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
    /* Room for the bottom tab bar on phones */
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

img, svg, picture {
    max-width: 100%;
    display: block;
}

/* The width and height attributes only reserve the space: an image narrowed by CSS keeps its proportions */
img {
    height: auto;
}

a {
    color: var(--green-600);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--green-800);
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.2;
}

p, ul, ol, dl, figure {
    margin: 0;
}

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

::selection {
    background: var(--green-200);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

.page {
    flex: 1;
    padding-block: 24px 56px;
}

.page.container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page--narrow {
    max-width: 560px;
}

.page--medium {
    max-width: 880px;
}

.muted {
    color: var(--muted);
}

.nowrap {
    white-space: nowrap;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--paper);
}

.skip-link:focus {
    top: 12px;
}

.js .js-hidden {
    display: none !important;
}

.no-js-only {
    display: none;
}

html:not(.js) .js-only {
    display: none !important;
}

html:not(.js) .no-js-only {
    display: block;
}

/* ---------- Icons ---------- */
.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--sm {
    width: 1em;
    height: 1em;
}

.icon--lg {
    width: 1.6em;
    height: 1.6em;
}

/* ---------- Typography ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green-500);
}

.eyebrow a {
    color: inherit;
    text-decoration: none;
}

.eyebrow a:hover {
    color: var(--green-800);
}

.page-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.7rem, 4.4vw, 2.5rem);
    letter-spacing: -0.01em;
    color: var(--green-900);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.25rem, 2.8vw, 1.6rem);
    color: var(--green-900);
}

.section-title--small {
    font-size: 1.2rem;
}

.section-title a {
    color: inherit;
    text-decoration: none;
}

.page-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-head--split {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.page-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 12px;
    margin-block: 8px 16px;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    text-decoration: none;
}

.link-arrow:hover {
    text-decoration: underline;
}

/* ---------- Header ---------- */
/*
 * The header is opaque on purpose. Safari 26 on iPhone draws the page under the status bar and the address field
 * and fills that strip with the colour of a sticky or fixed bar at the top edge, but only a bar with a solid colour:
 * a translucent, blurred header left the strip showing the page scrolling past above it, as if the header had
 * come off the top of the screen.
 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--paper);
    padding-top: env(safe-area-inset-top);
}

/* The same colour reaches up from the header, so the strip is filled even where the browser does not extend the
   header itself; everywhere else this lies above the screen and is never seen */
.site-header::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 100vh;
    background: inherit;
    pointer-events: none;
}

.header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--header-h);
}

/* The vine from the banner as the header's lower edge */
.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 12px;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='12' viewBox='0 0 140 12'%3E%3Cpath d='M0 6q35-5 70 0t70 0' fill='none' stroke='%232c4b24' stroke-opacity='.55' stroke-width='1.3'/%3E%3Cpath d='M44 3.67c3.6-4 8.6-4.4 11-2.8-2.4 2.8-6.4 4-11 2.8z' fill='%232c4b24' fill-opacity='.7'/%3E%3Cpath d='M96 8.33c-3.6 4-8.6 4.4-11 2.8 2.4-2.8 6.4-4 11-2.8z' fill='%232c4b24' fill-opacity='.7'/%3E%3Ccircle cx='70' cy='6' r='1.5' fill='%232c4b24' fill-opacity='.6'/%3E%3C/svg%3E") repeat-x center / 140px 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: var(--green-700);
    text-decoration: none;
}

.brand__mark {
    width: 40px;
    height: 40px;
    transition: transform 0.6s var(--ease);
}

.brand:hover .brand__mark {
    transform: rotate(26deg);
}

.brand__wordmark {
    height: 34px;
    width: auto;
}

@media (max-width: 479px) {
    /* A guest's sign-in buttons and the city need the room on a narrow phone: the emblem alone stands for the brand */
    .header-bar:has(.header-auth) .brand > picture {
        display: none;
    }
}

/* ---------- City switch in the header ---------- */
.city-menu {
    min-width: 0;
}

.city-menu > summary {
    list-style: none;
    cursor: pointer;
}

.city-menu > summary::-webkit-details-marker {
    display: none;
}

.city-menu__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 40px;
    padding: 6px 12px 6px 10px;
    border: 1.5px solid var(--line);
    border-radius: var(--pill);
    background: var(--card);
    color: var(--green-800);
    font-size: 0.92rem;
    font-weight: 800;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.city-menu__toggle:hover, .city-menu[open] > .city-menu__toggle {
    border-color: var(--green-500);
    background: var(--green-50);
}

.city-menu__toggle > .icon {
    color: var(--green-500);
}

.city-menu__toggle > .icon--sm {
    color: var(--muted);
    transition: transform 0.2s var(--ease);
}

.city-menu[open] > .city-menu__toggle > .icon--sm {
    transform: rotate(180deg);
}

.city-menu__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* On a phone the panel spans the header (the sticky header is its containing block), on wider screens it hangs
   from the button */
.city-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: var(--gutter);
    right: var(--gutter);
    z-index: 10;
    display: grid;
    gap: 10px;
    max-height: calc(100dvh - var(--header-h) - var(--tabbar-h) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: pop-in 0.16s var(--ease);
}

.city-menu__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--green-900);
}

.city-menu__hint {
    margin-top: -6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.city-menu__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 8px;
}

.city-menu__list a {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.city-menu__list a:hover {
    background: var(--green-50);
    color: var(--green-800);
}

.city-menu__list a.is-active {
    background: var(--green-100);
    color: var(--green-800);
    font-weight: 800;
}

@media (min-width: 768px) {
    .city-menu {
        position: relative;
    }

    .city-menu__panel {
        top: calc(100% + 12px);
        left: 0;
        right: auto;
        width: min(520px, calc(100vw - 2 * var(--gutter)));
        max-height: calc(100dvh - var(--header-h) - 24px);
    }

    .city-menu__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.main-nav {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.icon-link {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
    background: var(--card);
    color: var(--green-700);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.icon-link:hover {
    border-color: var(--green-500);
    background: var(--green-50);
    color: var(--green-800);
}

/* Phones reach the cart from the bottom tab bar. After .icon-link, which would otherwise show it again */
.header-cart {
    display: none;
}

.count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding-inline: 6px;
    border-radius: var(--pill);
    background: var(--sun);
    color: var(--green-950);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--paper);
}

.header-auth {
    display: flex;
    gap: 8px;
}

@media (max-width: 420px) {
    .header-auth .btn--ghost {
        display: none;
    }
}

@media (min-width: 768px) {
    .header-bar {
        gap: 20px;
        min-height: 72px;
    }

    :root {
        --header-h: 72px;
    }

    .brand__wordmark {
        height: 40px;
    }

    .main-nav {
        display: flex;
        gap: 2px;
    }

    .main-nav a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        border-radius: var(--pill);
        color: var(--ink-soft);
        font-weight: 700;
        font-size: 0.95rem;
        text-decoration: none;
        white-space: nowrap;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .main-nav a:hover {
        background: var(--green-50);
        color: var(--green-800);
    }

    .main-nav a.is-active {
        background: var(--green-100);
        color: var(--green-800);
    }

    .header-cart {
        display: grid;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* Tablets: icons only in the navigation, labels in tooltips */
    .main-nav a span {
        display: none;
    }

    .main-nav a {
        padding: 10px;
    }
}

/* ---------- User menu ---------- */
.user-menu {
    position: relative;
}

.user-menu > summary {
    list-style: none;
    cursor: pointer;
    border-radius: 50%;
}

.user-menu > summary::-webkit-details-marker {
    display: none;
}

.avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--green-700);
    color: var(--paper);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 0 3px var(--green-100);
    transition: box-shadow 0.15s ease;
}

.user-menu[open] .avatar, .user-menu > summary:hover .avatar {
    box-shadow: 0 0 0 3px var(--sun);
}

.user-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    z-index: 10;
    width: min(280px, calc(100vw - 2 * var(--gutter)));
    padding: 10px;
    display: grid;
    gap: 2px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: pop-in 0.16s var(--ease);
}

.user-menu__who {
    display: grid;
    padding: 8px 12px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
}

.user-menu__name {
    font-weight: 800;
    overflow-wrap: anywhere;
}

.user-menu__role {
    color: var(--muted);
    font-size: 0.88rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.menu-link:hover {
    background: var(--green-50);
    color: var(--green-800);
}

.menu-link .icon {
    color: var(--green-500);
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
}

/* ---------- Bottom tab bar (phones) ---------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 4px max(6px, env(safe-area-inset-left)) max(4px, env(safe-area-inset-bottom));
    /* Opaque for the same reason as the header: Safari 26 extends it under its own bottom toolbar */
    background: var(--card);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px -12px rgb(28 50 23 / 25%);
}

/* The tab bar's colour continues below it, under the browser's toolbar, instead of the page showing through */
.tabbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 100vh;
    background: inherit;
    pointer-events: none;
}

.tabbar a {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    min-height: calc(var(--tabbar-h) - 8px);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
}

.tabbar a .icon {
    width: 24px;
    height: 24px;
}

.tabbar a.is-active {
    color: var(--green-700);
}

.tabbar a.is-active::before {
    content: "";
    position: absolute;
    top: -4px;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--green-700);
}

.tabbar .count-badge {
    top: 2px;
    right: calc(50% - 22px);
}

@media (min-width: 768px) {
    .tabbar {
        display: none;
    }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 22px;
    border: 2px solid transparent;
    border-radius: var(--pill);
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled, .btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.btn--primary {
    background: var(--green-700);
    color: #fff;
    box-shadow: 0 3px 0 var(--green-900);
}

.btn--primary:hover {
    background: var(--green-800);
    color: #fff;
}

.btn--primary:active {
    box-shadow: 0 1px 0 var(--green-900);
}

.btn--sun {
    background: var(--sun);
    color: var(--green-950);
    box-shadow: 0 3px 0 var(--sun-600);
}

.btn--sun:hover {
    background: #f0b53c;
    color: var(--green-950);
}

.btn--ghost {
    background: var(--card);
    border-color: var(--line-strong);
    color: var(--green-800);
}

.btn--ghost:hover {
    border-color: var(--green-500);
    background: var(--green-50);
    color: var(--green-900);
}

.btn--danger {
    color: var(--berry);
}

.btn--danger:hover {
    border-color: var(--berry);
    background: var(--berry-100);
    color: var(--berry-600);
}

.btn--sm {
    min-height: 38px;
    padding: 6px 16px;
    font-size: 0.9rem;
}

.btn--lg {
    min-height: 54px;
    padding: 12px 28px;
    font-size: 1.05rem;
}

.btn--block {
    width: 100%;
}

.btn[aria-busy="true"] {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn[aria-busy="true"]::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgb(255 255 255 / 45%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn--ghost[aria-busy="true"]::after {
    border-color: var(--green-200);
    border-top-color: var(--green-700);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover {
    color: var(--berry);
}

.icon-button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover {
    background: var(--berry-100);
    color: var(--berry-600);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.button-row--center {
    justify-content: center;
}

.plain-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---------- Cards, messages, badges ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(18px, 3vw, 28px);
}

.card--flat {
    box-shadow: none;
}

.card--tint {
    background: var(--green-50);
    border-color: var(--green-200);
    box-shadow: none;
}

.stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-content: start;
}

.stack--sm {
    gap: 8px;
}

.flash-area {
    padding-top: 22px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 16px;
    border-radius: var(--radius);
    font-weight: 700;
    border: 1px solid;
    animation: pop-in 0.2s var(--ease);
}

.flash__text {
    flex: 1;
}

.flash__action {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flash--success {
    background: var(--green-50);
    border-color: var(--green-200);
    color: var(--green-800);
}

.flash--error {
    background: var(--berry-100);
    border-color: #f1c4bf;
    color: var(--berry-600);
}

.flash__close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
}

.flash__close:hover {
    opacity: 1;
    background: rgb(0 0 0 / 6%);
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--sun-100);
    color: var(--ink-soft);
}

.notice > .icon {
    margin-top: 2px;
    color: var(--sun-600);
}

.notice--info {
    background: var(--sky-100);
}

.notice--info > .icon {
    color: var(--sky);
}

.notice--danger, .notice--adult {
    background: var(--berry-100);
}

.notice--danger > .icon {
    color: var(--berry);
}

.notice--adult b {
    color: var(--berry-600);
}

.notice--success {
    background: var(--green-50);
}

.notice--success > .icon {
    color: var(--green-600);
}

.notice__body {
    display: grid;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--pill);
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.badge--adult {
    background: var(--berry);
    color: #fff;
}

.badge--muted {
    background: rgb(29 42 28 / 78%);
    color: #fff;
}

.badge--soft {
    background: var(--green-100);
    color: var(--green-800);
}

.badge--sun {
    background: var(--sun-100);
    color: var(--sun-600);
}

.badge--outline {
    border: 1.5px solid var(--line-strong);
    color: var(--ink-soft);
}

.media-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
    pointer-events: none;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: clamp(32px, 6vw, 56px) 20px;
    text-align: center;
    color: var(--ink-soft);
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: rgb(255 255 255 / 50%);
}

.empty-state__art {
    width: 88px;
    height: auto;
    opacity: 0.85;
}

.empty-state__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-700);
}

.empty-state__icon .icon {
    width: 30px;
    height: 30px;
}

.empty-state p {
    max-width: 46ch;
}

/* ---------- Forms ---------- */
.form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.form--wide {
    max-width: 820px;
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.form-section {
    display: grid;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px dashed var(--line-strong);
}

/* The first section of a form has no line above it. Not :first-child: a form starts with the hidden CSRF field */
.form-section:not(.form-section ~ .form-section) {
    padding-top: 0;
    border-top: 0;
}

.form-section__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--green-900);
}

/* On a phone the marker moves under the title rather than squeezing it into two lines */
.form-section__title .optional {
    font-family: var(--font-body);
    font-size: 0.85rem;
}

.form-section__title .icon {
    color: var(--green-500);
}

.step {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green-700);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 800;
}

.field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    align-content: start;
}

.field-row {
    display: grid;
    gap: 18px;
}

@media (min-width: 600px) {
    .field-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-row--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

label, .label {
    font-weight: 700;
    font-size: 0.95rem;
}

.optional {
    color: var(--muted);
    font-weight: 500;
}

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], input[type="url"], select, textarea {
    width: 100%;
    /* A select is otherwise as wide as its longest option and a field about 20 characters: a narrow phone
       would scroll sideways */
    min-width: 0;
    min-height: 48px;
    padding: 10px 14px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: max(16px, 1rem); /* 16 px keeps iOS from zooming into the field */
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
    resize: vertical;
    min-height: 96px;
}

select {
    appearance: none;
    padding-right: 40px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232c4b24' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
}

/* A code typed from a letter or said aloud: large, spaced digits that are easy to check against the source */
input.code-input {
    min-height: 54px;
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 0.2em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

input:hover, select:hover, textarea:hover {
    border-color: var(--green-300);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px var(--green-100);
}

input::placeholder, textarea::placeholder {
    color: #9aa494;
}

.is-invalid {
    border-color: var(--berry) !important;
    background-color: #fffafa;
}

.field__error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--berry-600);
    font-size: 0.88rem;
    font-weight: 700;
}

.field__hint {
    color: var(--muted);
    font-size: 0.86rem;
}

/* An icon to the left of the text; when the text wraps, the icon stays level with its first line */
.field__hint--icon {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.field__hint--icon .icon {
    margin-top: calc((1lh - 1em) / 2);
}

.input-group {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px var(--green-100);
}

.input-group input {
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    min-width: 0;
}

/* A long prefix (/shops/a-long-shop-name/) gives way to the field: at most half of it, then an ellipsis */
.input-group__prefix {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    max-width: 50%;
    padding-inline: 12px;
    background: var(--paper-2);
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
    border-right: 1px solid var(--line);
}

.input-group__prefix > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-group__button {
    display: grid;
    place-items: center;
    min-width: 48px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.input-group__button:hover {
    color: var(--green-700);
}

.inline-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.inline-field select, .inline-field input {
    width: auto;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--green-700);
    flex-shrink: 0;
}

.upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.upload__preview {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.upload__note {
    flex-basis: 100%;
    color: var(--sun-600);
    font-size: 0.88rem;
}

input[type="file"] {
    max-width: 100%;
    font: inherit;
    font-size: 0.92rem;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--pill);
    background: var(--card);
    color: var(--green-800);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

/* Choice cards: radio buttons and checkboxes that look like tiles */
.choices {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.choices legend {
    margin-bottom: 8px;
    padding: 0;
    font-weight: 700;
}

@media (min-width: 600px) {
    .choices--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.choice {
    position: relative;
    display: block;
    cursor: pointer;
}

.choice > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice__card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 4px 12px;
    height: 100%;
    padding: 14px 16px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.choice:hover .choice__card {
    border-color: var(--green-300);
}

.choice__icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--green-50);
    color: var(--green-700);
}

.choice__title {
    font-weight: 800;
}

.choice__meta {
    grid-column: 2 / -1;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
}

.choice__aside {
    font-weight: 800;
    color: var(--green-800);
    white-space: nowrap;
}

/* A check mark appears in the corner of the chosen card */
.choice__card::after {
    content: "";
    grid-row: 1;
    grid-column: 3;
    width: 22px;
    height: 22px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: #fff;
}

.choice > input[type="checkbox"] ~ .choice__card::after {
    border-radius: 7px;
}

.choice:has(.choice__aside) .choice__card::after {
    display: none;
}

/* "~" rather than "+": Thymeleaf puts a hidden "_field" input right after a bound checkbox */
.choice > input:checked ~ .choice__card {
    border-color: var(--green-600);
    background: var(--green-50);
    box-shadow: 0 0 0 3px var(--green-100);
}

.choice > input:checked ~ .choice__card::after {
    border-color: var(--green-700);
    background: var(--green-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / 14px;
}

.choice > input:focus-visible ~ .choice__card {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.choice > input:disabled ~ .choice__card {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Settings that belong to a switched-on method */
.choice-details {
    display: grid;
    gap: 16px;
    margin-top: -4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--paper);
}

.js .choice-details[hidden] {
    display: none;
}

/* Role picker on the registration page */
.role-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
}

.role-picker legend {
    margin-bottom: 8px;
    font-weight: 700;
}

.role-option input {
    position: absolute;
    opacity: 0;
}

.role-option__card {
    display: grid;
    /* Both cards are as tall as the taller one; their lines start at the top, so the titles stay level */
    align-content: start;
    gap: 6px;
    height: 100%;
    padding: 16px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.role-option__card small {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.35;
}

.role-option__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--green-50);
    color: var(--green-700);
}

.role-option input:checked ~ .role-option__card {
    border-color: var(--green-600);
    background: var(--green-50);
    transform: translateY(-2px);
}

.role-option input:checked ~ .role-option__card .role-option__icon {
    background: var(--green-700);
    color: #fff;
}

.role-option input:focus-visible ~ .role-option__card {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* Quantity stepper */
.stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--pill);
    background: #fff;
    overflow: hidden;
}

.stepper:focus-within {
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px var(--green-100);
}

.stepper input {
    width: 64px;
    min-height: 44px;
    padding: 6px 4px;
    border: 0;
    border-radius: 0;
    text-align: center;
    font-weight: 800;
    box-shadow: none !important;
    -moz-appearance: textfield;
}

.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper button {
    display: grid;
    place-items: center;
    width: 44px;
    border: 0;
    background: transparent;
    color: var(--green-700);
    cursor: pointer;
}

.stepper button:hover {
    background: var(--green-50);
}

.stepper button:disabled {
    color: var(--line-strong);
    cursor: default;
    background: transparent;
}

html:not(.js) .stepper button {
    display: none;
}

.stepper--sm input {
    width: 52px;
    min-height: 38px;
}

.stepper--sm button {
    width: 38px;
}

/* Toggle switch for settings */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.switch span {
    position: absolute;
    inset: 0;
    border-radius: var(--pill);
    background: var(--line-strong);
    transition: background-color 0.18s ease;
    pointer-events: none;
}

.switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s var(--ease);
}

.switch input:checked ~ span {
    background: var(--green-600);
}

.switch input:checked ~ span::after {
    transform: translateX(20px);
}

.switch input:focus-visible ~ span {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* A setting: a switch with a title and what it means */
.setting {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.setting__head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 4px 14px;
    padding: 14px 16px;
    cursor: pointer;
}

.setting__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--green-50);
    color: var(--green-700);
}

.setting__title {
    font-weight: 800;
}

.setting__text {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}

.setting:has(input:checked) {
    border-color: var(--green-300);
}

.setting:has(input:checked) .setting__icon {
    background: var(--green-700);
    color: #fff;
}

.setting__body {
    display: grid;
    gap: 16px;
    padding: 16px;
    border-top: 1px dashed var(--line);
    background: var(--paper);
}

.js .setting:not(:has(> .setting__head input:checked)) > .setting__body {
    display: none;
}

/* ---------- Auth pages ---------- */
.auth-layout {
    display: grid;
    gap: 28px;
    align-items: start;
}

@media (min-width: 1024px) {
    .auth-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
        max-width: 1100px;
        margin-inline: auto;
        width: 100%;
        align-items: center;
    }
}

.auth-art {
    display: none;
}

@media (min-width: 1024px) {
    .auth-art {
        display: grid;
        gap: 18px;
        justify-items: start;
        padding: 24px;
    }

    .auth-art img {
        width: min(100%, 460px);
    }
}

.auth-art__lead {
    max-width: 40ch;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

.auth-card {
    display: grid;
    gap: 18px;
}

.auth-card__switch {
    text-align: center;
    color: var(--muted);
}

.auth-card__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.mail-illustration {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-700);
}

.mail-illustration .icon {
    width: 40px;
    height: 40px;
}

.steps-list {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
    counter-reset: steps;
}

.steps-list li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    counter-increment: steps;
}

.steps-list li::before {
    content: counter(steps);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-800);
    font-weight: 800;
    font-size: 0.85rem;
}

.password-meter {
    height: 6px;
    border-radius: var(--pill);
    background: var(--line);
    overflow: hidden;
}

.password-meter span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--berry);
    transition: width 0.25s var(--ease), background-color 0.25s ease;
}

.password-meter[data-strength="2"] span {
    width: 66%;
    background: var(--sun);
}

.password-meter[data-strength="1"] span {
    width: 33%;
}

.password-meter[data-strength="3"] span {
    width: 100%;
    background: var(--green-600);
}

/* ---------- Home page hero ---------- */
.hero {
    padding-block: 12px 8px;
}

.hero__grid {
    display: grid;
    gap: 20px;
    align-items: center;
}

.hero__art {
    justify-self: center;
    width: min(100%, 340px);
}

.hero__art img {
    width: 100%;
}

.hero__text {
    display: grid;
    gap: 18px;
    min-width: 0;
}

/* The tagline, what the marketplace does and what it gives the buyer, read as one block */
.hero__intro {
    display: grid;
    gap: 12px;
    padding: clamp(18px, 3vw, 26px);
    border: 1px solid var(--green-200);
    border-radius: var(--radius-lg);
    background: var(--green-50);
}

.hero__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.55rem, 3.6vw, 2.25rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--green-900);
}

.hero__lead {
    max-width: 60ch;
    font-size: 1.04rem;
    color: var(--ink-soft);
}

.perks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    padding: 0;
    list-style: none;
    color: var(--green-700);
    font-size: 0.92rem;
    font-weight: 700;
}

.perks li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.perks .icon {
    color: var(--green-500);
}

@media (max-width: 599px) {
    .perks {
        flex-direction: column;
    }
}

@media (min-width: 1024px) {
    .hero {
        padding-block: 28px 16px;
    }

    .hero__grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        gap: 48px;
    }

    .hero__art {
        order: 2;
        width: 100%;
        max-width: 560px;
    }
}

/* The landing without a city: choosing one is the first step */
.city-choice {
    display: grid;
    gap: 12px;
}

.city-choice__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.25rem, 2.6vw, 1.5rem);
    color: var(--green-900);
}

.city-choice__title .icon {
    color: var(--green-500);
}

.city-choice__hint {
    max-width: 60ch;
    color: var(--ink-soft);
}

.city-choice__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-choice__more {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding-top: 4px;
}

.how {
    display: grid;
    gap: 16px;
    padding-block: 32px 8px;
}

.how__steps {
    display: grid;
    gap: 12px;
}

.how__step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 14px;
    align-items: start;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.how__icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-700);
}

.how__step b {
    color: var(--green-900);
    font-weight: 800;
}

.how__step span:last-child {
    color: var(--ink-soft);
    font-size: 0.94rem;
}

@media (min-width: 768px) {
    .how__steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

.search {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 600px;
    padding: 6px 6px 6px 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--pill);
    background: #fff;
    box-shadow: var(--shadow);
}

.search:focus-within {
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px var(--green-100), var(--shadow);
}

.search > .icon {
    color: var(--muted);
}

.search input {
    min-height: 44px;
    padding-inline: 4px;
    border: 0;
    background: transparent;
    box-shadow: none !important;
}

.search .btn {
    flex-shrink: 0;
}

/* Inside a card: no shadow of its own, as wide as the card */
.search--flat {
    max-width: none;
    box-shadow: none;
}

.search--flat:focus-within {
    box-shadow: 0 0 0 4px var(--green-100);
}

@media (max-width: 420px) {
    .search .btn span {
        display: none;
    }

    .search .btn {
        padding-inline: 14px;
    }
}

.section-title__city {
    color: var(--green-500);
}

/* ---------- Chips (categories, filters) ---------- */
.chips {
    display: flex;
    gap: 8px;
    padding-block: 4px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}

.chips::-webkit-scrollbar {
    display: none;
}

/* Swiping a row sideways suits a phone; with a mouse, or room enough, every chip stays in sight */
@media (min-width: 768px), (hover: hover) and (pointer: fine) {
    .chips {
        flex-wrap: wrap;
        margin-inline: 0;
        padding-inline: 0;
        -webkit-mask-image: none;
        mask-image: none;
    }
}

/* Never squeezed below its label: a row of chips scrolls or wraps instead (Safari shrank them, the text spilled) */
.chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--pill);
    background: var(--card);
    color: var(--ink);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.chip:hover {
    border-color: var(--green-400);
    color: var(--green-900);
}

.chip.is-active {
    background: var(--green-700);
    border-color: var(--green-700);
    color: #fff;
}

.chip--accent {
    border-color: var(--sun);
    background: var(--sun-100);
}

.chip--accent.is-active {
    background: var(--sun);
    border-color: var(--sun);
    color: var(--green-950);
}

.chip-sep {
    flex: 0 0 1px;
    margin-inline: 4px;
    background: var(--line);
}

/* ---------- Product cards ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
        gap: 20px;
    }
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green-200);
}

@media (prefers-reduced-motion: reduce) {
    .product-card:hover {
        transform: none;
    }
}

.product-card.is-sold-out .visual {
    filter: grayscale(0.75);
    opacity: 0.75;
}

.product-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.product-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

/*
 * Every photo gets the same 4:3 frame. Inside a flex column the frame would otherwise grow to the natural height
 * of a tall photo (a flex item is never shorter than its content), so the photo is taken out of the flow and
 * cropped by object-fit instead.
 */
.product-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.product-card__media > .visual {
    position: absolute;
    inset: 0;
}

.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
    padding: 14px;
}

/* A word longer than a narrow card ("Сухолиманський" at 320 px) is hyphenated or broken, not cut off */
.product-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    hyphens: auto;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
}

.product-card__shop {
    color: var(--muted);
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card__footer {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}

.product-card__price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

@media (max-width: 599px) {
    .product-card__body {
        padding: 12px;
    }

    .product-card__title {
        font-size: 0.92rem;
    }

    .product-card .method-icons {
        display: none;
    }
}

/* Category tile shown instead of a missing photo */
.visual {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
}

/*
 * A photo fills its frame and is cropped around its centre. It is taken out of the flow on purpose: as a grid item
 * it would be at least as tall as its own proportions demand, so a tall photo overflowed the frame and was cut
 * at the bottom instead of evenly.
 */
.visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visual__emoji {
    font-size: clamp(2.6rem, 8vw, 4rem);
    filter: drop-shadow(0 8px 8px rgb(40 30 0 / 16%));
    transform: rotate(-8deg);
}

.tone-cheese { --tone-a: #fdf4d6; --tone-b: #f1d98e; }
.tone-dairy { --tone-a: #f3f7fa; --tone-b: #d7e4ee; }
.tone-honey { --tone-a: #fdecc0; --tone-b: #f0c25e; }
.tone-wine { --tone-a: #f5e2e8; --tone-b: #d3a0b3; }
.tone-vegetables { --tone-a: #ebf3e2; --tone-b: #bcd6a1; }
.tone-fruits { --tone-a: #fde6e2; --tone-b: #f1aea4; }
.tone-bakery { --tone-a: #f7ebd8; --tone-b: #e0bf8f; }
.tone-meat { --tone-a: #f9e3dc; --tone-b: #e2a796; }
.tone-eggs { --tone-a: #fdf7ea; --tone-b: #efdeb8; }
.tone-preserves { --tone-a: #edf2e5; --tone-b: #c6d7ac; }
.tone-other { --tone-a: #f2eee6; --tone-b: #dad1c2; }

.price-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.price-tag b {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--green-900);
}

.price-tag small {
    color: var(--muted);
    font-weight: 600;
}

.price-tag--large b {
    font-size: clamp(1.9rem, 5vw, 2.4rem);
}

.offer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: var(--pill);
    background: var(--green-50);
    color: var(--green-800);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.offer-chip .icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* The chip is a flex row, so a text too long for a narrow card is cut here, with an ellipsis */
.offer-chip__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offer-chip--ships {
    background: var(--sun-100);
    color: var(--sun-600);
}

.method-icons {
    display: inline-flex;
    gap: 6px;
    color: var(--green-500);
}

.method-icons .icon {
    width: 17px;
    height: 17px;
}

/* ---------- Pagination: pages are buds on a vine, the page shown is a sunflower in bloom ---------- */
/*
 * On a phone the pages take a row of their own and the steps go under them, around the status; from a tablet up
 * the steps hold the ends of the vine. Seven places at most fit a 320 px screen: the buds shrink with the screen.
 */
.pagination {
    --bead: clamp(34px, 9.6vw, 40px);
    --bead-gap: clamp(6px, 2vw, 14px);
    display: grid;
    grid-template-areas:
        "pages pages pages"
        "prev status next";
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px 10px;
    margin-top: 40px;
}

/* The stem the pages are strung on, fading out at its ends */
.pagination::before {
    content: "";
    grid-area: pages;
    align-self: center;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='16' viewBox='0 0 70 16'%3E%3Cpath d='M0 8q17.5-5 35 0t35 0' fill='none' stroke='%232c4b24' stroke-opacity='.5' stroke-width='1.4'/%3E%3C/svg%3E") repeat-x center / 70px 16px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
    pointer-events: none;
}

.pagination__pages {
    grid-area: pages;
    justify-self: center;
    display: flex;
    align-items: center;
    gap: var(--bead-gap);
    margin: 0;
    padding: 0;
    list-style: none;
    /* Leaves and petals go behind the buds, yet above the stem */
    position: relative;
    isolation: isolate;
}

.pagination__pages > li {
    position: relative;
    display: flex;
}

/* A leaf on the stem between two pages, above it and below it in turn; under the petals of a flower */
.pagination__pages > li + li::before {
    content: "";
    position: absolute;
    z-index: -2;
    top: 50%;
    left: calc(var(--bead-gap) / -2);
    width: 18px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'%3E%3Cpath d='M9 14C8 8 11 3 17 2c1 6-2 11-8 12z' fill='%234e7a42' fill-opacity='.85'/%3E%3Cpath d='M9 14 15 5' stroke='%23f2f6ee' stroke-opacity='.55' stroke-width='.8'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: translate(-50%, -100%);
}

.pagination__pages > li:nth-child(odd)::before {
    transform: translate(-50%, 0) scale(-1, -1);
}

.pagination__page, .pagination__gap {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--bead);
    height: var(--bead);
    border-radius: 50%;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.pagination__page {
    border: 1.5px solid var(--line-strong);
    background: var(--card);
    color: var(--green-800);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.25s var(--ease);
}

/* Petals: a bud opens a little under the pointer, the page shown is in full bloom */
.pagination__page::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-30 -30 60 60'%3E%3Cdefs%3E%3Cellipse id='p' cx='0' cy='-21' rx='4' ry='8.5'/%3E%3Cg id='r'%3E%3Cuse href='%23p'/%3E%3Cuse href='%23p' transform='rotate(30)'/%3E%3Cuse href='%23p' transform='rotate(60)'/%3E%3Cuse href='%23p' transform='rotate(90)'/%3E%3Cuse href='%23p' transform='rotate(120)'/%3E%3Cuse href='%23p' transform='rotate(150)'/%3E%3Cuse href='%23p' transform='rotate(180)'/%3E%3Cuse href='%23p' transform='rotate(210)'/%3E%3Cuse href='%23p' transform='rotate(240)'/%3E%3Cuse href='%23p' transform='rotate(270)'/%3E%3Cuse href='%23p' transform='rotate(300)'/%3E%3Cuse href='%23p' transform='rotate(330)'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23r' fill='%23f3c24f' transform='rotate(15)'/%3E%3Cuse href='%23r' fill='%23e9a825'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0;
    transform: scale(0.6) rotate(-40deg);
    transition: opacity 0.25s ease, transform 0.45s var(--ease);
}

a.pagination__page:hover {
    border-color: var(--green-500);
    background: var(--green-50);
    transform: translateY(-2px);
}

a.pagination__page:hover::before, a.pagination__page:focus-visible::before {
    opacity: 0.5;
    transform: scale(0.82);
}

.pagination__page[aria-current] {
    border-color: var(--green-800);
    /* The seeds of the sunflower's heart */
    background: var(--green-700) radial-gradient(rgb(255 255 255 / 13%) 1px, transparent 1.5px) 0 0 / 5px 5px;
    color: #fff;
    box-shadow: 0 2px 6px rgb(28 50 23 / 25%);
}

.pagination__page[aria-current]::before {
    opacity: 1;
    transform: none;
    animation: pagination-bloom 0.8s var(--ease) both;
}

@keyframes pagination-bloom {
    from {
        opacity: 0;
        transform: scale(0.4) rotate(-70deg);
    }
}

/* The dots of an ellipsis sit on the baseline: raised, they lie on the stem like seeds */
.pagination__gap {
    color: var(--green-500);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    transform: translateY(-0.25em);
}

/* Back and forward, each with a vine tendril curling round its outer end */
.pagination__step {
    grid-area: prev;
    justify-self: start;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 18px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--pill);
    background: var(--card);
    color: var(--green-800);
    font-weight: 800;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pagination__step--next {
    grid-area: next;
    justify-self: end;
}

.pagination__step .icon {
    transition: transform 0.25s var(--ease);
}

a.pagination__step:hover {
    border-color: var(--green-500);
    background: var(--green-50);
}

a.pagination__step--prev:hover .icon {
    transform: translateX(-3px);
}

a.pagination__step--next:hover .icon {
    transform: translateX(3px);
}

.pagination__step::after {
    content: "";
    position: absolute;
    top: -14px;
    left: -16px;
    width: 32px;
    height: 32px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M25 21C20 18 15 16 12 11C9 6 11 2 15 2c3.5 0 4.5 4 2 5.5-2 1.2-3.5-1-2-2' fill='none' stroke='%232c4b24' stroke-opacity='.8' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M18 16C12 15 6 18 3 23c6 1 12-1 15-7z' fill='%234e7a42' fill-opacity='.9'/%3E%3Cpath d='M18 16 8 21' stroke='%23f2f6ee' stroke-opacity='.55' stroke-width='.8'/%3E%3C/svg%3E") center / contain no-repeat;
    /* Centred, so the mirrored tendril of "next" stays in its place */
    transform-origin: 50% 66%;
    transition: transform 0.45s var(--ease);
    pointer-events: none;
}

.pagination__step--next::after {
    left: auto;
    right: -16px;
    transform: scaleX(-1);
}

a.pagination__step--prev:hover::after {
    transform: rotate(-10deg);
}

a.pagination__step--next:hover::after {
    transform: scaleX(-1) rotate(-10deg);
}

/* A step that leads nowhere keeps its place, faded; still opaque, so the stem does not show through */
span.pagination__step {
    border-color: var(--line);
    color: var(--line-strong);
    box-shadow: none;
}

span.pagination__step::after {
    opacity: 0.4;
}

.pagination__status {
    grid-area: status;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

@media (max-width: 479px) {
    .pagination__shown {
        display: none;
    }
}

@media (max-width: 359px) {
    /* Arrows alone leave the status room between them; screen readers still read the words */
    .pagination__step {
        padding: 0;
    }

    .pagination__step-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (min-width: 720px) {
    .pagination {
        grid-template-areas:
            "prev pages next"
            "status status status";
        grid-template-columns: auto auto auto;
        justify-content: center;
        column-gap: var(--bead-gap);
    }

    /* The vine runs from one step to the other */
    .pagination::before {
        grid-area: 1 / 1 / 2 / -1;
        margin-inline: -24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pagination__page, .pagination__page::before, .pagination__step::after, .pagination__step .icon {
        transition: none;
    }

    .pagination__page[aria-current]::before {
        animation: none;
    }

    a.pagination__page:hover {
        transform: none;
    }
}

/* ---------- Pickup boards: times written in chalk ---------- */
.pickup-list, .pickup-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pickup-board {
    position: relative;
    display: grid;
    gap: 4px;
    height: 100%;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--green-800);
    background-image: radial-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px);
    background-size: 6px 6px;
    color: #f4f1e4;
    box-shadow: inset 0 0 26px rgb(0 0 0 / 28%);
}

.pickup-board__kind {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    margin-bottom: 2px;
    padding: 2px 8px;
    border-radius: var(--pill);
    background: rgb(255 255 255 / 10%);
    color: #e3ead8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pickup-board__when {
    font-family: var(--font-hand);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--sun);
}

.pickup-board__hours {
    font-size: 0.86rem;
    font-weight: 700;
    color: #e3ead8;
}

.pickup-board__where {
    font-size: 0.93rem;
}

.pickup-board__shop {
    color: #f4f1e4;
    font-weight: 800;
    font-size: 0.9rem;
}

.pickup-board__shop:hover {
    color: var(--sun);
}

.pickup-board__distance {
    font-size: 0.82rem;
    opacity: 0.8;
}

.pickup-board__route {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    margin-top: 4px;
    color: var(--sun);
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.pickup-board__route:hover {
    color: #fff;
    text-decoration: underline;
}

.pickup-board--compact {
    padding: 12px 14px;
}

.pickup-board--compact .pickup-board__when {
    font-size: 1.32rem;
}

.pickup-board a:focus-visible {
    outline-color: var(--sun);
}

.pickup-stack {
    display: grid;
    gap: 10px;
}

/* Choosing a pickup at checkout */
.pickup-option {
    display: grid;
    gap: 8px;
}

.slot-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.slot {
    position: relative;
    cursor: pointer;
}

.slot input {
    position: absolute;
    opacity: 0;
}

.slot span {
    display: grid;
    gap: 1px;
    min-width: 96px;
    padding: 8px 12px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    text-align: center;
    line-height: 1.25;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.slot span b {
    font-size: 0.95rem;
}

.slot span small {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.slot:hover span {
    border-color: var(--green-300);
}

.slot input:checked ~ span {
    border-color: var(--green-600);
    background: var(--green-700);
    color: #fff;
}

.slot input:checked ~ span small {
    color: var(--green-100);
}

.slot input:focus-visible ~ span {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.pickup-place {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.pickup-place__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 10px;
}

.pickup-place__address {
    font-weight: 800;
}

/* ---------- Address suggestions ---------- */
.has-suggestions {
    position: relative;
    /* On a phone the field scrolls up under the sticky header to leave room for the list */
    scroll-margin-top: calc(var(--header-h) + 12px);
}

/* The field's own clear button replaces the browser's, which only some browsers draw */
.has-suggestions input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

.suggest-clear {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.suggest-clear:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.suggest-clear .icon {
    width: 18px;
    height: 18px;
}

/* In a form field the button sits inside the input's right edge (the script sets its top) */
.field > .suggest-clear {
    position: absolute;
    right: 8px;
}

input.has-clear-button {
    padding-right: 46px;
}

/* Above the maps: each map is a stacking context of its own (z-index on .map) */
.suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: pop-in 0.12s var(--ease);
}

/* New suggestions are on their way: a thin running line along the top edge */
.suggestions.is-busy::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--green-500);
    animation: suggestions-busy 0.9s var(--ease) infinite;
}

@keyframes suggestions-busy {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(340%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .suggestions.is-busy::before {
        width: 100%;
        animation: none;
        opacity: 0.4;
    }
}

.suggestions__list {
    max-height: min(360px, 50dvh);
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
}

.suggestions__list:empty {
    display: none;
}

.suggestions__heading {
    padding: 8px 12px 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.suggestion > .icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--green-500);
}

.suggestion__text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.suggestion__text b {
    color: var(--ink);
    font-weight: 700;
}

.suggestion__text span {
    color: var(--muted);
    font-size: 0.86rem;
}

.suggestion mark {
    padding: 0;
    background: none;
    color: var(--green-700);
    font-weight: 800;
    text-decoration: underline 2px var(--sun);
    text-underline-offset: 3px;
}

.suggestion:hover, .suggestion[aria-selected="true"] {
    background: var(--green-50);
}

.suggestion[aria-selected="true"] {
    box-shadow: inset 3px 0 0 var(--green-600);
}

.suggestions__status {
    padding: 14px 16px;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.suggestions__list:not(:empty) + .suggestions__status {
    border-top: 1px solid var(--line);
}

/* "Put the point here" in the popup of a found place on a seller's map */
.map-popup {
    display: grid;
    gap: 10px;
    justify-items: start;
    font: inherit;
}

/* ---------- Maps ---------- */
.map {
    height: 320px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--paper-2);
    z-index: 0;
}

.map--tall {
    height: clamp(320px, 56vh, 540px);
}

.map--small {
    height: 220px;
}

.map--picker {
    height: clamp(300px, 52vh, 480px);
}

.map-pin {
    background: none;
    border: 0;
}

.map-pin span {
    position: relative;
    display: block;
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: var(--green-700);
    transform: rotate(-45deg);
    box-shadow: 0 4px 8px rgb(0 0 0 / 30%);
}

.map-pin span::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--sun);
}

.map-pin--me span {
    background: var(--sky);
}

.map-pin--me span::after {
    background: #fff;
}

.map-pin--farm span {
    background: var(--sun-600);
}

.leaflet-container {
    font-family: var(--font-body);
    border-radius: var(--radius-lg);
}

.leaflet-popup-content {
    font-weight: 700;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm);
}

/* ---------- Nearby ---------- */
.nearby {
    display: grid;
    gap: 24px;
}

.nearby__panel {
    display: grid;
    gap: 14px;
    align-self: start;
}

.nearby__area {
    display: grid;
    gap: 14px;
}

.nearby__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nearby__results {
    display: grid;
    gap: 12px;
    align-content: start;
    min-width: 0;
}

@media (min-width: 1024px) {
    .nearby {
        grid-template-columns: minmax(380px, 5fr) 7fr;
    }

    .nearby__panel {
        position: sticky;
        top: calc(var(--header-h) + 20px);
    }
}

/* ---------- Product page ---------- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.breadcrumbs li + li::before {
    content: "/";
    margin-right: 6px;
    color: var(--line-strong);
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--green-700);
    text-decoration: underline;
}

.product-detail {
    display: grid;
    gap: 24px;
}

.product-detail__media {
    position: relative;
    align-self: start;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

@media (max-width: 599px) {
    .product-detail__media {
        aspect-ratio: 4 / 3;
        margin-inline: calc(var(--gutter) * -1);
        border-radius: 0;
    }
}

@media (min-width: 900px) {
    .product-detail {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 40px;
    }

    .product-detail__media {
        position: sticky;
        top: calc(var(--header-h) + 20px);
    }
}

/* A product page shows the whole photo: the frame takes the photo's own proportions within 2:1 and 4:5,
   so a panorama is not a thin strip nor a tall photo a column; what does not fit shows in full on the category tone */
.product-detail__media--photo {
    aspect-ratio: auto;
    container-type: inline-size;
}

.product-detail__media--photo .visual img {
    position: static;
    height: auto;
    min-height: 50cqi;
    max-height: min(125cqi, 75vh);
    object-fit: contain;
}

.product-detail__media .visual__emoji {
    font-size: clamp(5rem, 16vw, 8rem);
}

.product-detail__info {
    display: grid;
    gap: 16px;
    align-content: start;
}

.shop-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    font-weight: 800;
    text-decoration: none;
}

.shop-link:hover {
    text-decoration: underline;
}

.stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}

.stock--in {
    color: var(--green-600);
}

.stock--out {
    color: var(--berry);
}

.description {
    color: var(--ink-soft);
    white-space: pre-line;
}

.buy-box {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--green-50);
    border: 1px solid var(--green-200);
}

.buy-box__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.buy-box__row .btn {
    flex: 1 1 200px;
}

.ways {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.way {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 2px 12px;
    align-items: start;
}

.way__icon {
    grid-row: span 3;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--green-50);
    color: var(--green-700);
}

/* However many lines a way has, they all stay in the text column: a fourth one (the shop's delivery note) used to
   fall into the 40 px icon column under the icon, a word per line */
.way > :not(.way__icon) {
    grid-column: 2;
}

.way__title {
    font-weight: 800;
}

.way__text {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nearest {
    display: grid;
    gap: 12px;
    padding-top: 16px;
    border-top: 2px dashed var(--line);
}

/* ---------- Shop page ---------- */
.shop-hero {
    display: grid;
    gap: 20px;
    align-items: center;
}

@media (min-width: 720px) {
    .shop-hero {
        grid-template-columns: 148px 1fr;
        gap: 28px;
    }
}

.shop-hero__image {
    position: relative;
    display: grid;
    place-items: center;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--green-50);
    color: var(--green-700);
    border: 5px solid #fff;
    box-shadow: var(--shadow);
}

@media (min-width: 720px) {
    .shop-hero__image {
        width: 148px;
        height: 148px;
    }
}

.shop-hero__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-hero__image .brand__mark {
    width: 64px;
    height: 64px;
}

.shop-hero__text {
    display: grid;
    gap: 10px;
}

.shop-hero__description {
    max-width: 72ch;
    color: var(--ink-soft);
    white-space: pre-line;
}

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

.contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 6px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--pill);
    background: #fff;
    color: var(--green-800);
    font-weight: 700;
    text-decoration: none;
}

.contact:hover {
    border-color: var(--green-400);
    color: var(--green-900);
}

.shop-layout {
    display: grid;
    gap: 32px;
}

.shop-layout__side {
    display: grid;
    gap: 18px;
    align-content: start;
}

@media (min-width: 1024px) {
    .shop-layout {
        grid-template-columns: 360px minmax(0, 1fr);
    }

    .shop-layout__side .pickup-list {
        grid-template-columns: 1fr;
    }
}

/* ---------- Cart and checkout ---------- */
.checkout {
    display: grid;
    gap: 24px;
}

@media (min-width: 1024px) {
    .checkout {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        align-items: start;
    }

    .checkout__form {
        position: sticky;
        top: calc(var(--header-h) + 20px);
    }
}

.checkout__items, .checkout__form form {
    display: grid;
    gap: 18px;
}

.cart-lines {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cart-line {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    grid-template-areas:
        "visual info remove"
        "visual qty total";
    align-items: center;
    gap: 8px 14px;
    padding-block: 14px;
    border-bottom: 1px dashed var(--line);
}

@media (min-width: 600px) {
    .cart-line {
        grid-template-columns: 72px 1fr auto auto auto;
        grid-template-areas: "visual info qty total remove";
    }
}

.cart-line__visual {
    grid-area: visual;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

@media (min-width: 600px) {
    .cart-line__visual {
        width: 72px;
        height: 72px;
    }
}

.cart-line__visual .visual__emoji {
    font-size: 1.8rem;
}

.cart-line__info {
    grid-area: info;
    display: grid;
    gap: 2px;
    min-width: 0;
}

.cart-line__info a {
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.cart-line__info a:hover {
    color: var(--green-700);
    text-decoration: underline;
}

.cart-line .qty-form {
    grid-area: qty;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-line__total {
    grid-area: total;
    justify-self: end;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
}

.cart-line__remove {
    grid-area: remove;
    justify-self: end;
}

.summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    margin: 0;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--paper-2);
}

.summary dd {
    margin: 0;
    font-weight: 800;
    text-align: right;
}

.summary__total {
    padding-top: 8px;
    border-top: 1px dashed var(--line-strong);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--green-900);
}

.summary dd.summary__total {
    font-weight: 700;
}

.checkout-login {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--green-50);
    text-align: center;
}

/* ---------- Orders ---------- */
.order-list {
    display: grid;
    gap: 16px;
}

.order-card {
    display: grid;
    gap: 16px;
}

.order-card:target {
    border-color: var(--sun);
    box-shadow: 0 0 0 4px var(--sun-100), var(--shadow);
}

.order-board {
    display: grid;
    gap: 18px;
}

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

.order-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.order-card__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--green-900);
}

.order-card__title a {
    color: inherit;
    text-decoration: none;
}

.order-card__title a:hover {
    text-decoration: underline;
}

.order-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.order-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.order-card__comment {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--paper-2);
}

.order-items {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.order-items li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
}

.order-items li > b {
    grid-row: span 2;
    align-self: center;
    white-space: nowrap;
}

.status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--pill);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status--new { background: var(--sun-100); color: var(--sun-600); }
.status--confirmed { background: var(--green-100); color: var(--green-700); }
.status--handed_over { background: var(--green-700); color: #fff; }
.status--cancelled { background: var(--paper-2); color: var(--muted); }

.progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.progress li {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    counter-increment: step;
}

.progress li::before {
    content: counter(step);
    z-index: 1;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: var(--card);
    font-weight: 800;
}

.progress li + li::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--line-strong);
}

.progress li.is-done {
    color: var(--green-700);
}

.progress li.is-done::before {
    content: "✓";
    border-color: var(--green-700);
    background: var(--green-700);
    color: #fff;
}

.progress li.is-done::after {
    background: var(--green-700);
}

/* Pickup code ticket: a dashed frame with perforation notches */
.ticket {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0 18px;
    padding: 14px 26px;
    border: 2px dashed var(--sun);
    border-radius: var(--radius);
    background: var(--sun-100);
}

.ticket::before, .ticket::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--card);
}

.ticket::before {
    left: -10px;
}

.ticket::after {
    right: -10px;
}

.ticket__label {
    grid-column: 2;
    color: var(--sun-600);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ticket__code {
    grid-row: span 2;
    grid-column: 1;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: 0.22em;
    line-height: 1.1;
    color: var(--green-900);
}

.ticket__hint {
    grid-column: 2;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/* Delivery details of an order */
.delivery-box {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 2px 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--paper-2);
}

.delivery-box > .way__icon {
    grid-row: span 4;
}

.delivery-box__title {
    font-weight: 800;
}

.delivery-box__line {
    color: var(--ink-soft);
    font-size: 0.93rem;
}

.delivery-box__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 4px;
}

.delivery-box__actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
}

.delivery-box__actions a:hover {
    text-decoration: underline;
}

.copy-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.copy-button:hover {
    background: var(--green-100);
    color: var(--green-700);
}

.copy-button.is-copied {
    color: var(--green-600);
}

html:not(.js) .copy-button {
    display: none;
}

.payment-details {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 2px solid var(--green-200);
    border-radius: var(--radius);
    background: var(--green-50);
}

.payment-details pre {
    margin: 0;
    font: inherit;
    font-weight: 800;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tracking-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tracking-form input {
    width: auto;
    flex: 1 1 180px;
    min-height: 40px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Seller dashboard ---------- */
.dash-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    overflow-x: auto;
    border-radius: var(--pill);
    background: var(--paper-2);
    scrollbar-width: none;
}

.dash-tabs::-webkit-scrollbar {
    display: none;
}

.dash-tabs a {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: var(--pill);
    color: var(--ink-soft);
    font-weight: 800;
    font-size: 0.92rem;
    text-decoration: none;
    white-space: nowrap;
}

.dash-tabs a:hover {
    color: var(--green-800);
}

.dash-tabs a.is-active {
    background: var(--card);
    color: var(--green-800);
    box-shadow: var(--shadow);
}

.sub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-banner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 14px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--berry);
    background: var(--berry-100);
}

.status-banner > .icon {
    grid-row: span 2;
    width: 28px;
    height: 28px;
    color: var(--berry);
}

.status-banner__title {
    font-weight: 800;
    color: var(--berry-600);
}

.handover {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    border: 2px solid var(--green-600);
    background: linear-gradient(120deg, var(--green-50), var(--card) 75%);
}

.handover__text {
    display: grid;
    gap: 2px;
    max-width: 52ch;
}

.handover__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--green-900);
}

.handover__row {
    display: flex;
    gap: 10px;
}

input.handover__input {
    width: 8.5ch;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 900px) {
    .stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }
}

.stat {
    display: grid;
    gap: 2px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    color: var(--ink-soft);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.stat b {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    color: var(--green-900);
    line-height: 1.1;
}

.stat--accent {
    background: var(--green-700);
    border-color: var(--green-700);
    color: var(--green-100);
}

.stat--accent b {
    color: #fff;
}

a.stat--accent:hover {
    color: #fff;
}

.dash-grid {
    display: grid;
    gap: 18px;
}

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

.mini-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Two parts of a line sit at its ends; on a narrow card the second one moves under the first instead of both
   being squeezed into columns */
.mini-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 12px;
    padding-block: 10px;
    border-bottom: 1px dashed var(--line);
}

.mini-list b {
    white-space: nowrap;
}

.mini-list a {
    color: inherit;
    text-decoration: none;
}

.mini-list a:hover {
    color: var(--green-700);
    text-decoration: underline;
}

.onboarding {
    background: linear-gradient(120deg, var(--sun-100), var(--card) 70%);
}

.checklist {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.checklist li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.checklist li::before {
    content: "";
    width: 22px;
    height: 22px;
    border: 2px solid var(--muted);
    border-radius: 6px;
}

.checklist li.is-done::before {
    content: "✓";
    display: grid;
    place-items: center;
    border-color: var(--green-700);
    background: var(--green-700);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
}

.checklist li.is-done a {
    color: var(--muted);
    text-decoration: line-through;
}

.limit-meter {
    display: grid;
    gap: 6px;
    min-width: 200px;
}

.limit-meter__bar {
    height: 8px;
    border-radius: var(--pill);
    background: var(--line);
    overflow: hidden;
}

.limit-meter__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green-600);
}

.limit-meter.is-full .limit-meter__bar span {
    background: var(--sun);
}

/* Filled tenths: inline styles are not allowed by the Content Security Policy */
.limit-meter__bar .w-1 { width: 10%; }
.limit-meter__bar .w-2 { width: 20%; }
.limit-meter__bar .w-3 { width: 30%; }
.limit-meter__bar .w-4 { width: 40%; }
.limit-meter__bar .w-5 { width: 50%; }
.limit-meter__bar .w-6 { width: 60%; }
.limit-meter__bar .w-7 { width: 70%; }
.limit-meter__bar .w-8 { width: 80%; }
.limit-meter__bar .w-9 { width: 90%; }
.limit-meter__bar .w-10 { width: 100%; }

.limit-meter__text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.manage-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.manage-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 12px 16px;
    padding: 14px 16px;
}

.manage-item.is-hidden {
    background: var(--paper);
}

.manage-item.is-hidden .manage-item__visual {
    opacity: 0.55;
}

.manage-item__visual {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.manage-item__visual .visual__emoji {
    font-size: 2rem;
}

.manage-item__info {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.manage-item__title {
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.manage-item__title:hover {
    color: var(--green-700);
    text-decoration: underline;
}

.manage-item__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.manage-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stock-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-form label {
    font-size: 0.85rem;
    color: var(--muted);
}

.stock-form, .manage-item__actions {
    grid-column: 1 / -1;
}

@media (min-width: 900px) {
    .manage-item {
        grid-template-columns: 64px minmax(0, 1fr) auto auto;
    }

    .stock-form, .manage-item__actions {
        grid-column: auto;
    }
}

.manage-item--pickup {
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .manage-item--pickup {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

.window-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.window-list a {
    display: grid;
    gap: 1px;
    padding: 8px 12px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-size: 0.86rem;
    line-height: 1.3;
    text-decoration: none;
}

.window-list a:hover {
    border-color: var(--green-400);
}

.window-list a.is-active {
    border-color: var(--green-700);
    background: var(--green-700);
    color: #fff;
}

.window-list small {
    color: inherit;
    opacity: 0.75;
    font-weight: 700;
}

.pickup-manage {
    display: grid;
    gap: 18px;
}

@media (min-width: 1024px) {
    .pickup-manage {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .pickup-manage .map {
        position: sticky;
        top: calc(var(--header-h) + 20px);
    }
}

.pickup-editor {
    display: grid;
    gap: 20px;
}

@media (min-width: 1024px) {
    .pickup-editor {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: start;
    }
}

.pickup-editor__map {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.map-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
}

/* The week lays itself out by the width of its own column: the pickup point form sits next to the map */
.week {
    display: grid;
    gap: 8px;
    container-type: inline-size;
}

.week__day {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.week__day.is-closed .week__times {
    opacity: 0.45;
}

.week__times {
    display: flex;
    align-items: center;
    gap: 8px;
}

.week__times input {
    flex: 1;
    min-height: 42px;
    padding-inline: 10px;
}

@container (min-width: 420px) {
    .week__day {
        grid-template-columns: 150px minmax(0, 1fr);
    }
}

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

.packing-slot {
    font-size: 1.05rem;
    color: var(--ink-soft);
}

.table-wrap {
    overflow-x: auto;
}

.packing-table {
    width: 100%;
    margin-top: 12px;
    border-collapse: collapse;
}

.packing-table th, .packing-table td {
    padding: 12px 8px;
    border-bottom: 1px dashed var(--line);
    text-align: left;
}

.packing-table th {
    color: var(--muted);
    font-size: 0.84rem;
}

.packing-table .num {
    text-align: right;
    white-space: nowrap;
}

.packing-table td.num {
    font-family: var(--font-display);
    font-weight: 700;
}

.packing-table input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--green-700);
}

.packing-table tr:has(input:checked) td {
    color: var(--muted);
    text-decoration: line-through;
}

.packing-orders {
    display: grid;
    gap: 14px;
}

/* ---------- Profile ---------- */
.profile-grid {
    display: grid;
    gap: 20px;
}

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

/* ---------- Confirmation dialog ---------- */
.dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
    background: rgb(20 35 16 / 45%);
    backdrop-filter: blur(2px);
}

.dialog[open] {
    animation: pop-in 0.18s var(--ease);
}

.dialog__body {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.dialog__message {
    font-size: 1.05rem;
    font-weight: 700;
}

.dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

/* ---------- Error pages ---------- */
.error-page {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding-block: 32px;
    text-align: center;
}

.error-page__art {
    width: 138px;
    height: auto;
}

.error-page__code {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(4rem, 16vw, 7rem);
    line-height: 1;
    color: var(--green-700);
    text-shadow: 6px 6px 0 var(--green-100);
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: auto;
    background: var(--green-800);
    color: var(--green-100);
}

.site-footer a {
    color: #fff;
}

.site-footer a:hover {
    color: var(--sun);
}

.site-footer__grid {
    display: grid;
    gap: 24px;
    padding-block: 32px 24px;
}

@media (min-width: 768px) {
    .site-footer__grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }
}

.site-footer__brand {
    display: grid;
    gap: 10px;
    max-width: 38ch;
}

.site-footer__brand .brand {
    color: #fff;
}

/* The green flower would vanish on the green footer: show it as a white silhouette */
.site-footer__brand .brand__mark {
    filter: brightness(0) invert(1);
}

.site-footer__tagline {
    font-family: var(--font-hand);
    font-size: 1.45rem;
    line-height: 1.2;
    color: var(--sun);
}

.site-footer__title {
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green-300);
}

.site-footer__links {
    display: grid;
    gap: 6px;
    padding: 0;
    list-style: none;
}

.site-footer__links a {
    text-decoration: none;
}

.site-footer__links a:hover {
    text-decoration: underline;
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding-block: 16px;
    border-top: 1px solid rgb(255 255 255 / 12%);
    font-size: 0.86rem;
    color: var(--green-300);
}

/* ---------- Print (packing list) ---------- */
@media print {
    .site-header, .site-footer, .tabbar, .flash-area, .dash-tabs, .no-print, .dialog {
        display: none !important;
    }

    body {
        padding: 0;
        background: #fff;
    }

    .page {
        padding: 0;
    }

    .card, .stat {
        box-shadow: none;
        border-color: #999;
        break-inside: avoid;
    }

    .stat--accent {
        background: #fff;
        color: var(--ink);
    }

    .stat--accent b {
        color: var(--ink);
    }

    .order-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
