/* Pages publiques des commerces (/commerces) : complète espace.css. */
.public-page { background: var(--bg); }
.public-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.public-bar-inner { max-width: var(--content-width, 1080px); margin: 0 auto; padding: 12px var(--gutter, 16px); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.public-bar { position: relative; z-index: 1000; }
.public-bar .appbar-brand { min-width: 0; }
.public-bar .appbar-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.public-nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.public-nav a[aria-current="page"] { color: var(--brand); }
.public-nav-login { display: none; }
.public-actions { display: none; align-items: center; gap: 8px; flex: none; }
.public-menu-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.public-menu-toggle .icon { width: 20px; height: 20px; }
.public-main { padding-top: 24px; padding-bottom: 48px; }
.public-hero h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.public-hero { margin-bottom: 18px; }
.public-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--grid-gap, 16px); }
.public-card { display: grid; padding: 0; overflow: hidden; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.public-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.public-card-cover { display: grid; place-items: center; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--brand) 10%, var(--surface)); overflow: hidden; }
.public-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.public-card-cover img.is-logo { width: 60%; height: 70%; object-fit: contain; }
.public-card-initials { font-size: 2rem; font-weight: 800; color: var(--brand); }
.public-card-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
.public-card-excerpt { font-size: .9rem; color: var(--muted); }
.public-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.chip-open { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.chip-dot { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 22%, transparent); }
.chip-open.active .chip-dot { background: #fff; box-shadow: none; }
.public-crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.public-crumbs a { color: var(--muted); }
.public-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.public-head h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.public-head .company-avatar { width: 72px; height: 72px; flex: none; }
.public-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0; font-size: .92rem; }
.public-footer p { margin: 4px 0; }
/* Téléphone et tablette étroite : bouton « Menu » et panneau déroulant. */
@media (max-width: 760px) {
    .public-bar-inner { flex-wrap: nowrap; padding-top: 10px; padding-bottom: 10px; }
    .public-actions { display: flex; }
    .public-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter, 16px) 16px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 0, 0, .08); }
    .public-bar.is-open .public-nav { display: flex; }
    .public-nav a:not(.btn) { padding: 13px 4px; font-size: 1rem; border-bottom: 1px solid var(--line); }
    .public-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); padding-left: 12px; }
    .public-nav-login { display: block; border-bottom: 0 !important; }
    .public-nav .public-join { display: none; }
}
@media (max-width: 380px) {
    .public-menu-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.public-offer { display: grid; align-content: start; }
.public-offer-member { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 600; color: var(--brand); text-decoration: none; }
.public-news { display: grid; gap: 16px; max-width: 820px; }
.public-news-item { display: grid; gap: 14px; }
.public-news-item > img { width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; }

/* Carte de fidélité, côté client. */
.loyalty-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 32px; align-items: start; }
.loyalty-hero h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.loyalty-steps { padding-left: 1.2em; display: grid; gap: 6px; }
.loyalty-login { margin-top: 18px; }
.loyalty-login summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.loyalty-partners { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.loyalty-partner { display: grid; gap: 4px; align-content: start; }
.loyalty-partner-name { display: inline-flex; align-items: center; gap: 4px; justify-self: start; color: inherit; text-decoration: none; }
.loyalty-partner-name .icon { width: 16px; height: 16px; color: var(--brand); transition: transform .15s; }
.loyalty-partner-name:hover strong { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.loyalty-partner-name:hover .icon { transform: translateX(2px); }
.loyalty-rewards { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.loyalty-rewards li { display: flex; gap: 10px; align-items: baseline; font-size: .95rem; }
.loyalty-cost { flex: none; min-width: 52px; padding: 2px 8px; border-radius: 8px; text-align: center; font-weight: 700; font-size: .85rem; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.loyalty-rewards li.is-reachable .loyalty-cost { color: #fff; background: #15803d; }
.loyalty-card-layout { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 24px; align-items: start; }
.loyalty-pass { display: grid; gap: 6px; justify-items: center; text-align: center; }
.loyalty-pass-name { font-size: .85rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.loyalty-pass-holder { font-size: 1.2rem; }
.loyalty-pass .qr { width: 220px; max-width: 100%; }
.loyalty-pass .qr svg { width: 100%; height: auto; }
.loyalty-pass-number { font-family: ui-monospace, monospace; letter-spacing: .08em; }
.loyalty-balance { margin: 6px 0; font-size: 1.1rem; }
.loyalty-balance strong { font-size: 2.2rem; color: var(--brand); }
.loyalty-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.loyalty-line:first-child { border-top: 0; padding-top: 0; }
.loyalty-line strong.is-plus { color: #15803d; }
@media (max-width: 860px) {
    .loyalty-hero, .loyalty-card-layout { grid-template-columns: 1fr; }
}
.loyalty-boosts { display: grid; gap: 8px; margin: 12px 0 16px; }
.loyalty-boost { margin: 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, transparent); }
.loyalty-boost.is-now { background: color-mix(in srgb, #15803d 14%, transparent); }
.loyalty-boost strong { color: var(--brand); margin-right: 4px; }
.loyalty-boost.is-now strong { color: #15803d; }
.loyalty-draws { display: grid; gap: 12px; }
.loyalty-draw { display: grid; gap: 8px; border: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.loyalty-draw-title { font-size: 1.2rem; }
.loyalty-draw-form { display: flex; gap: 8px; align-items: center; }
.loyalty-draw-form input { width: 6em; }

/* Page d'accueil publique de l'association. */
.public-main section { margin-top: 32px; }
.public-main section:first-child { margin-top: 0; }
.home-public-hero { padding: 28px 0 8px; }
.home-public-hero h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 5vw, 2.8rem); }
.home-public-hero .lead { max-width: none; margin: 0 0 18px; font-size: 1.1rem; color: var(--muted); }
.home-public-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.home-public-head h2 { margin: 0; }
.home-public-head a { font-weight: 600; color: var(--brand); text-decoration: none; }
.home-public-loyalty { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.home-public-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.home-public-columns section { margin-top: 32px; }
.home-public-item { display: grid; gap: 4px; margin-bottom: 10px; }
.home-public-join { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.fiche .public-news { max-width: none; }
.fiche .public-news-item > img { max-height: 280px; }

/* Texte réservé aux lecteurs d'écran. */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Suite d'accueil commune à plusieurs thèmes (public._home-more) : mise en page de base, habillée par chaque thème. */
.hm-news { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.hm-news-item { display: grid; gap: 6px; padding: 8px 8px 18px; overflow: hidden; color: inherit; text-decoration: none; }
.hm-news-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; margin-bottom: 6px; }
.hm-news-item > span, .hm-news-item > strong { padding: 0 8px; }
.hm-join { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.hm-join .card { padding: 28px; }
.hm-join h2 { margin: 0 0 8px; font-size: 1.45rem; }
.hm-join p { margin: 0 0 16px; }

/* Suggestions de la recherche (public/js/search-suggest.js) */
form.has-suggest { position: relative; }
.suggest-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #fff); box-shadow: 0 18px 40px -16px rgb(0 0 0 / .3); text-align: left; }
.suggest-list a { display: flex; align-items: baseline; gap: 8px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.suggest-list a:hover, .suggest-list a[aria-selected="true"] { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.suggest-label { font-weight: 700; }
.suggest-detail { overflow: hidden; color: var(--muted); font-size: .85rem; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.suggest-type { flex: none; margin-left: auto; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--muted); font-size: .72rem; font-weight: 700; }

/* Accueils : rythme des sections et bande teintée pleine largeur (tous les thèmes) */
.public-page { overflow-x: clip; }
.hm-section { margin-top: 56px !important; }
.hm-section > .home-public-head { align-items: end; margin-bottom: 18px; }
.hm-section > .home-public-head h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.15; }
.hm-band { margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; padding: 44px max(16px, calc(50vw - 50%)); background: color-mix(in srgb, var(--brand) 6%, var(--bg, #fff)); }
.hm-band > * { max-width: var(--content-width, 1080px); margin-left: auto; margin-right: auto; }

/* Bons plans : étiquette compacte et commerce en tête, puis l'offre (tous les thèmes) */
.public-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.public-offer > * { max-width: 100%; }
.public-offer .highlight { order: -2; margin: 0 0 4px; padding: 3px 10px; font-size: .92rem; line-height: 1.2; }
.public-offer-member { order: -1; margin: 0 0 2px !important; color: var(--text); font-weight: 800; font-size: 1rem; }
.public-offer-member .icon { width: 16px; height: 16px; color: var(--brand); }
.public-offer > strong { margin-top: 0 !important; font-weight: 700; line-height: 1.35; }
.public-offer p { margin-top: 2px !important; font-size: .93rem; }
.public-offer-loyalty { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--brand); font-size: .88rem; font-weight: 700; text-decoration: none; }
.public-offer-loyalty .icon { width: 16px; height: 16px; }
.public-offer-loyalty:hover { text-decoration: underline; }

/* Agenda en pavés de date (public._events) */
.ev-list { display: grid; gap: 10px; }
.ev { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; }
.ev-date { display: grid; place-items: center; align-content: center; width: 58px; height: 64px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 12%, #fff); color: color-mix(in srgb, var(--brand) 75%, #000); font-size: .78rem; font-weight: 800; text-transform: uppercase; line-height: 1; }
.ev-date strong { font-size: 1.6rem; line-height: 1.05; }
.ev-text { display: grid; gap: 3px; min-width: 0; }
.ev-when { color: color-mix(in srgb, var(--brand) 70%, #000); font-weight: 700; font-size: .88rem; }
.ev-text .muted { font-size: .9rem; }
.ev-image { width: 84px; height: 64px; border-radius: 10px; object-fit: cover; }

/* Rubriques en tuiles (public._families) */
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.fam { position: relative; display: flex; align-items: flex-end; min-height: 120px; padding: 14px; overflow: hidden; border-radius: 16px; background: color-mix(in srgb, var(--brand) 12%, #fff); color: color-mix(in srgb, var(--brand) 60%, #000); text-decoration: none; transition: transform .15s; }
.fam:hover { transform: translateY(-3px); }
.fam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fam.has-photo { color: #fff; }
.fam.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgb(0 0 0 / .62)); }
.fam-initial { position: absolute; right: 10px; top: 2px; font-size: 4.2rem; font-weight: 900; line-height: 1; color: color-mix(in srgb, var(--brand) 22%, transparent); }
.fam-text { position: relative; z-index: 1; display: grid; gap: 2px; }
.fam-text strong { font-size: 1.05rem; line-height: 1.2; }
.fam-text span { font-size: .85rem; opacity: .9; }

/* Mini-plan des commerces (public._mini-map) */
.mini-map { display: block; width: 100%; height: auto; border-radius: 12px; color: var(--brand); fill: var(--brand); }
.mini-map-ground { fill: #fff; fill-opacity: .7; }
.mini-map-street { stroke: var(--brand); stroke-opacity: .12; stroke-width: 3; fill: none; }
.mini-map-avenue { stroke: var(--brand); stroke-opacity: .18; stroke-width: 6; stroke-linecap: round; fill: none; }
.mini-map-river { stroke: #9cc7dd; stroke-opacity: .7; stroke-width: 9; stroke-linecap: round; fill: none; }
.mini-map-dot { fill: var(--brand); stroke: #fff; stroke-width: 2.5; }
.mini-map .is-accent { fill: #e0603a; }

@media (max-width: 760px) {
    .hm-section { margin-top: 40px !important; }
    .hm-band { padding-top: 32px; padding-bottom: 32px; }
    .fam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fam { min-height: 96px; }
    .ev-image { display: none; }
}

/* Récompenses de la carte de fidélité parmi les bons plans de la fiche publique : contour en pointillés, coût en points. */
.public-page .public-offer.is-loyalty { background: var(--surface, #fff); border: 1.5px dashed color-mix(in srgb, var(--brand) 45%, transparent); color: var(--text); }
.public-page .public-offer.is-loyalty .highlight { border: 0; background: var(--brand); color: #fff; transform: none; }
.public-page .public-offer.is-loyalty > strong { color: var(--text); }

/* Bandeau de consentement aux cookies de mesure d'audience (public._consent) : refuser et accepter à égalité. */
.consent { position: fixed; z-index: 1000; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; padding: 18px 20px; border-radius: 16px; background: var(--surface, #fff); color: var(--ink, #17171a); box-shadow: 0 18px 50px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.06); font-size: .92rem; line-height: 1.45; }
.consent[hidden] { display: none; }
.consent p { margin: 0 0 10px; }
.consent-title { font-weight: 800; font-size: 1rem; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions .btn { flex: 1; justify-content: center; }
