/* ============================================================
   Cavalink — Feuille de style principale
   Palette équestre : vert écurie · or · crème
   ============================================================ */

:root {
    --green:        #14533C;
    --green-dark:   #0E3B2B;
    --green-soft:   #E8F0EB;
    --gold:         #C8973F;
    --gold-dark:    #A97C2C;
    --gold-soft:    #FBF1DD;
    --cream:        #FBF9F6;
    --surface:      #FFFFFF;
    --ink:          #1F2421;
    --muted:        #6B7B73;
    --line:         #E7E3DC;
    --danger:       #C0392B;
    --danger-soft:  #FBEAE7;
    --info:         #2C6E8F;
    --info-soft:    #E5F1F6;
    --success:      #1E7A4B;
    --radius:       16px;
    --radius-sm:    10px;
    --radius-lg:    24px;
    --shadow:       0 6px 24px rgba(20, 49, 35, .08);
    --shadow-lg:    0 18px 50px rgba(20, 49, 35, .16);
    --maxw:         1180px;
    --header-h:     70px;
    --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

a { color: var(--green); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-dark); }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.hidden { display: none !important; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    padding: .72em 1.4em; border-radius: 999px; border: 1.5px solid transparent;
    font-family: var(--font-body); font-size: .98rem; font-weight: 600;
    cursor: pointer; transition: all .16s ease; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-gold { background: var(--gold); color: #2a1e06; }
.btn-gold:hover { background: var(--gold-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.btn-ghost { background: var(--green-soft); color: var(--green); }
.btn-ghost:hover { background: #dce8e0; }
.btn-sm { padding: .5em 1em; font-size: .86rem; }
.btn-lg { padding: .9em 1.8em; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(251,249,246,.88); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--green); }
.brand:hover { color: var(--green); }
.brand .logo { width: 34px; height: 34px; }
.main-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.main-nav a { padding: .5em .85em; border-radius: 999px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { background: var(--green-soft); color: var(--green); }
.main-nav a.active { color: var(--green); font-weight: 600; }
.nav-divider { width: 1px; height: 26px; background: var(--line); margin: 0 6px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

/* Menu profil */
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1.5px solid var(--line); border-radius: 999px; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem; flex: 0 0 auto; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.8rem; }
.user-menu .dropdown {
    position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 8px; z-index: 200;
}
.user-menu .dropdown a { display: flex; align-items: center; gap: 10px; padding: .6em .8em; border-radius: 10px; color: var(--ink); font-size: .94rem; }
.user-menu .dropdown a:hover { background: var(--green-soft); color: var(--green); }
.user-menu .dropdown hr { border: none; border-top: 1px solid var(--line); margin: 6px 4px; }
.badge-dot { background: var(--gold); color: #2a1e06; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: 1px 7px; margin-left: auto; }

/* Cloche de notifications — toujours visible et tout à droite du header (mobile + PC) */
.header-bell { order: 10; position: relative; flex: 0 0 auto; margin-left: 6px; }
.header-bell .bell-btn { border: none; padding: 6px; border-radius: 50%; gap: 0; position: relative; background: none; }
.header-bell .bell-btn:hover { background: var(--green-soft); }
.bell-ico { width: 25px; height: 25px; display: block; }
.bell-badge { position: absolute; top: -1px; right: -1px; background: var(--gold); color: #2a1e06; border-radius: 999px; font-size: .62rem; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 3px; box-shadow: 0 0 0 2px #fff; }
/* Le menu déroulant des notifs ne doit jamais sortir de l'écran */
.header-bell .dropdown { right: 0; left: auto; width: min(300px, calc(100vw - 24px)); max-width: calc(100vw - 24px); }

/* ---------- Hero ---------- */
.hero {
    position: relative; padding: 64px 0 90px; overflow: hidden;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(200,151,63,.14), transparent 60%),
        linear-gradient(160deg, #1c6147 0%, var(--green) 45%, var(--green-dark) 100%);
    color: #fff; text-align: center;
}
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 59h60' stroke='%23ffffff10' /%3E%3C/svg%3E");
    opacity: .4;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 16ch; margin-inline: auto; }
.hero p.lead { font-size: 1.18rem; color: #e9f2ec; max-width: 52ch; margin: 0 auto 8px; }
.hero .eyebrow { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); color: #fff; padding: .4em 1em; border-radius: 999px; font-size: .85rem; font-weight: 500; margin-bottom: 18px; }

/* ---------- Sélecteur de recherche (façon site de voyage) ---------- */
.search-card {
    background: #fff; color: var(--ink); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 12px; margin: 30px auto 0; max-width: 920px;
}
.search-tabs { display: flex; gap: 6px; padding: 6px 6px 12px; flex-wrap: wrap; justify-content: center; }
.search-tab {
    border: none; background: transparent; cursor: pointer; font-family: var(--font-body);
    font-weight: 600; color: var(--muted); padding: .6em 1.1em; border-radius: 999px; font-size: .95rem;
    display: inline-flex; align-items: center; gap: .5em; transition: .15s;
}
.search-tab.active { background: var(--green); color: #fff; }
.search-tab:hover:not(.active) { background: var(--green-soft); color: var(--green); }
.search-fields { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 0; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px; }
.search-field { display: flex; flex-direction: column; padding: .5em 1.1em; border-right: 1px solid var(--line); text-align: left; min-width: 0; }
.search-field:last-of-type { border-right: none; }
.search-field label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--green); margin-bottom: 2px; }
.search-field input, .search-field select {
    border: none; background: transparent; font-family: var(--font-body); font-size: .98rem; color: var(--ink);
    padding: 0; width: 100%; outline: none; appearance: none; cursor: pointer;
}
.search-field input::placeholder { color: #aab2ac; }
.search-submit { align-self: center; }
.search-submit .btn { height: 52px; width: 52px; padding: 0; font-size: 1.2rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-listings { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: transform .18s, box-shadow .18s; position: relative; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--green-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-tag { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.94); color: var(--green); font-size: .76rem; font-weight: 700; padding: .35em .8em; border-radius: 999px; box-shadow: var(--shadow); }
.card-tag.request { color: var(--gold-dark); }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-loc { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.card-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin: 0; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--green); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }
.card-price { font-weight: 700; color: var(--green); font-size: 1.05rem; }
.card-price small { font-weight: 500; color: var(--muted); font-size: .8rem; }

/* Chips / badges */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 500; padding: .25em .7em; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.chip-gold { background: var(--gold-soft); color: var(--gold-dark); }
.chip-muted { background: #f0efea; color: var(--muted); }
.badge-role { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .2em .6em; border-radius: 6px; }
.badge-role.owner { background: var(--gold-soft); color: var(--gold-dark); }
.badge-role.pro { background: var(--green); color: #fff; }
.badge-role.rider { background: var(--info-soft); color: var(--info); }
.badge-id-verified { display: inline-flex; align-items: center; gap: 3px; font-size: .75rem; font-weight: 600; padding: .2em .65em; border-radius: 999px; background: #e8f4fd; color: #1a73e8; border: 1px solid #c3daf7; white-space: nowrap; }

/* Étoile favori */
.fav-star {
    position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.92); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow); transition: transform .15s, background .15s; z-index: 2;
}
.fav-star:hover { transform: scale(1.1); }
.fav-star svg { width: 20px; height: 20px; }
.fav-star .star-shape { fill: none; stroke: var(--muted); stroke-width: 1.6; transition: .15s; }
.fav-star.is-fav .star-shape { fill: var(--gold); stroke: var(--gold-dark); }
.fav-star.is-fav { background: #fff; }

/* ---------- Formulaires ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: clamp(24px, 4vw, 44px); }
.form-narrow { max-width: 460px; margin: 0 auto; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.input, .textarea, .select {
    width: 100%; padding: .8em 1em; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 1rem; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.textarea { resize: vertical; min-height: 130px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7B73' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1em center; padding-right: 2.5em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .95rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--green); }

/* Choix de rôle / pilules radio */
.pill-group { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-radio { position: relative; }
.pill-radio input { position: absolute; opacity: 0; }
.pill-radio label { display: block; padding: .7em 1.2em; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem; transition: .15s; }
.pill-radio input:checked + label { background: var(--green); color: #fff; border-color: var(--green); }
.pill-radio input:focus-visible + label { box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------- Alertes / flash ---------- */
.alert { padding: .9em 1.2em; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .94rem; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.alert-success { background: #E8F5EE; color: #14633e; border-color: #bfe3cd; }
.alert-error { background: var(--danger-soft); color: #8e2a1e; border-color: #f1c9c2; }
.alert-info { background: var(--info-soft); color: #1d5571; border-color: #c4e0eb; }
.flash-stack { position: fixed; top: 84px; right: 20px; z-index: 300; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.flash-stack .alert { box-shadow: var(--shadow-lg); animation: slideIn .3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } }

/* ---------- Page section title ---------- */
.page-head { padding: 40px 0 8px; }
.page-head .eyebrow { color: var(--gold-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green); }

/* ---------- Filtres ---------- */
.layout-sidebar { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 90px; }
.filters h3 { font-size: 1rem; margin-bottom: 14px; }
.filters .field { margin-bottom: 14px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .count { color: var(--muted); font-size: .92rem; }

/* ---------- Annonce détail ---------- */
.detail-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; border-radius: var(--radius-lg); overflow: hidden; }
.detail-gallery .main-photo { aspect-ratio: 3/2; }
.detail-gallery .main-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-gallery .thumbs { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; }
.detail-gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 36px; margin-top: 30px; align-items: start; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; margin: 22px 0; }
.spec { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.spec .k { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.spec .v { font-weight: 600; margin-top: 2px; }
.contact-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; position: sticky; top: 90px; }
.price-tag { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--green); }
.price-tag small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.owner-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 16px 0; }

/* ---------- Messagerie ---------- */
.msg-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 560px; background: #fff; }
.conv-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 70vh; }
.conv-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.conv-item:hover, .conv-item.active { background: var(--green-soft); }
.conv-item .who { font-weight: 600; font-size: .94rem; }
.conv-item .preview { font-size: .84rem; color: var(--muted); }
.conv-item.unread .who::after { content: "●"; color: var(--gold); margin-left: 6px; font-size: .7rem; }
.thread { display: flex; flex-direction: column; }
.thread-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.thread-body { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 52vh; background: var(--cream); }
.bubble { max-width: 70%; padding: .7em 1em; border-radius: 16px; font-size: .94rem; }
.bubble.them { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.me { background: var(--green); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble .time { display: block; font-size: .72rem; opacity: .7; margin-top: 3px; }
.thread-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.thread-form input { flex: 1; }

/* ---------- Forum ---------- */
.forum-cat { display: flex; gap: 16px; align-items: center; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: .15s; }
.forum-cat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.forum-cat .ico { font-size: 1.8rem; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: var(--green-soft); border-radius: 14px; flex: 0 0 auto; }
.forum-cat .meta { margin-left: auto; text-align: right; font-size: .84rem; color: var(--muted); }
.topic-row { display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.topic-row:hover { border-color: var(--green); }
.topic-row .stats { text-align: center; min-width: 70px; }
.topic-row .stats .n { font-weight: 700; color: var(--green); }
.topic-row .stats .l { font-size: .72rem; color: var(--muted); }

/* Post / réponse */
.post { display: grid; grid-template-columns: 160px 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.post .post-author { background: var(--green-soft); padding: 20px; text-align: center; }
.post .post-author .avatar { margin: 0 auto 8px; }
.post .post-content { padding: 20px 24px; }
.post .post-content .body { white-space: pre-wrap; }

/* ---------- Catégories d'accueil ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.cat-tile { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; display: flex; align-items: flex-end; padding: 16px; color: #fff; background: var(--green); transition: transform .18s; }
.cat-tile:hover { transform: translateY(-3px); color: #fff; }
.cat-tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0,0,0,.55)); z-index: 1; }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-tile span { position: relative; z-index: 2; font-weight: 600; font-family: var(--font-display); font-size: 1.05rem; }

/* ---------- Steps / how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.step { text-align: center; padding: 10px; }
.step .num { width: 52px; height: 52px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-dark); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin: 0 auto 14px; }

/* ---------- Bandes / CTA ---------- */
.cta-band { background: linear-gradient(120deg, var(--green), var(--green-dark)); color: #fff; border-radius: var(--radius-lg); padding: clamp(32px, 5vw, 56px); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #dceae2; max-width: 50ch; margin: 0 auto 24px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty .ico { font-size: 3rem; margin-bottom: 12px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 36px; }
.pagination a, .pagination span { padding: .5em .9em; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .9rem; background: #fff; }
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-dark); color: #cfe0d6; padding: 56px 0 28px; margin-top: 64px; }
.site-footer a { color: #cfe0d6; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { color: #fff; font-family: var(--font-body); font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: .92rem; }
.footer-brand .brand { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .85rem; color: #9fb6a8; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
    .layout-sidebar { grid-template-columns: 1fr; }
    .filters { position: static; }
    .detail-layout { grid-template-columns: 1fr; }
    .contact-box { position: static; }
    .msg-layout { grid-template-columns: 1fr; }
    .conv-list { max-height: 240px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
    .main-nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: 12px; gap: 2px; align-items: stretch; display: none; box-shadow: var(--shadow); }
    .main-nav.open { display: flex; }
    .main-nav a { padding: .8em 1em; }
    .nav-divider { display: none; }
    .nav-toggle { display: block; margin-left: auto; }
    .search-fields { grid-template-columns: 1fr; }
    .search-field { border-right: none; border-bottom: 1px solid var(--line); }
    .search-field:last-of-type { border-bottom: none; }
    .search-submit { padding: 8px; }
    .search-submit .btn { width: 100%; border-radius: 999px; }
    .detail-gallery { grid-template-columns: 1fr; }
    .detail-gallery .thumbs { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
    .post { grid-template-columns: 1fr; }
    .post .post-author { display: flex; align-items: center; gap: 12px; text-align: left; }
    .post .post-author .avatar { margin: 0; }
    .field-row, .field-row-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .cat-tiles { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Panneau de modération
   ============================================================ */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.admin-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: sticky; top: 90px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: .65em .9em; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: .94rem; }
.admin-nav a:hover { background: var(--green-soft); color: var(--green); }
.admin-nav a.active { background: var(--green); color: #fff; }
.admin-nav .count { margin-left: auto; font-size: .78rem; background: rgba(0,0,0,.08); padding: 1px 8px; border-radius: 999px; }
.admin-nav a.active .count { background: rgba(255,255,255,.22); }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 16px; margin-bottom: 26px; }
.admin-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.admin-stat .n { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--green); line-height: 1; }
.admin-stat .l { color: var(--muted); font-size: .85rem; margin-top: 6px; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th { text-align: left; padding: 12px 14px; background: var(--green-soft); color: var(--green); font-weight: 600; white-space: nowrap; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.admin-table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: var(--cream); }
.admin-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-table .row-actions form { display: inline; }
.btn-mini { padding: .35em .7em; font-size: .78rem; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; color: var(--ink); }
.btn-mini:hover { border-color: var(--green); color: var(--green); }
.btn-mini.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn-mini.danger:hover { background: var(--danger-soft); }
.btn-mini.gold { color: var(--gold-dark); border-color: var(--gold-soft); }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.cell-user .avatar { width: 32px; height: 32px; font-size: .8rem; }

@media (max-width: 820px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
    .admin-nav a { flex: 1 1 auto; justify-content: center; }
}

/* ---- Bouton signaler ---- */
.report-box { margin-top: 12px; }
.report-box summary { list-style: none; cursor: pointer; color: var(--muted); font-size: .82rem; font-weight: 600; display: inline-block; }
.report-box summary::-webkit-details-marker { display: none; }
.report-box summary:hover { color: var(--danger); }
.report-box[open] summary { color: var(--danger); margin-bottom: 8px; }
.report-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }

/* ---- Filtre recherche admin ---- */
.admin-search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-search input { flex: 1; min-width: 180px; }

/* ---- Solde / portefeuille ---- */
.wallet { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wallet .box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.wallet .box.primary { background: var(--green); color: #fff; border-color: var(--green); }
.wallet .amount { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; }
.wallet .box.primary .amount { color: #fff; }
@media (max-width: 560px) { .wallet { grid-template-columns: 1fr; } }

/* ============================================================
   Recherche par localisation (champ + autocomplétion + carte)
   ============================================================ */
.locsearch { position: relative; }
.loc-field { position: relative; display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 14px; }
.loc-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.loc-pin { flex: 0 0 auto; opacity: .8; }
.loc-input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--font-body); font-size: 1rem; padding: .55em .6em; min-width: 0; color: var(--ink); }
.loc-clear { flex: 0 0 auto; width: 28px; height: 28px; border: none; background: var(--green-soft); color: var(--green); border-radius: 50%; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.loc-clear:hover { background: #d9e6dd; }
.loc-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); list-style: none; margin: 0; padding: 6px; z-index: 200; max-height: 280px; overflow-y: auto; }
/* Empêche tout conteneur .card (overflow:hidden) de couper le menu déroulant des villes */
.card:has(.locsearch), .card:has([data-location-search]), .card:has([data-geocode]) { overflow: visible; }
.loc-suggest li { padding: .6em .8em; border-radius: 8px; cursor: pointer; font-size: .94rem; display: flex; gap: 8px; align-items: center; color: var(--ink); }
.loc-suggest li:hover { background: var(--green-soft); }
.loc-sub { color: var(--muted); font-size: .85em; }
.loc-radius-wrap { margin-top: 12px; }
.loc-radius-head { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.loc-radius-head strong { color: var(--green); }
.loc-radius { width: 100%; accent-color: var(--green); cursor: pointer; height: 6px; }
.loc-map { margin-top: 12px; height: 200px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); z-index: 1; }
.locsearch-hero .loc-field { padding: 6px 8px 6px 16px; }
.locsearch-hero .loc-input { padding: .7em .6em; font-size: 1.05rem; }
.locsearch-hero .loc-map { height: 220px; }

/* Ligne de champs du hero (localisation pleine largeur + contrôles) */
.search-hero { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.search-hero-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.search-hero-row > * { flex: 1 1 160px; }
.search-hero-row .search-submit-btn { flex: 0 0 auto; }
.search-pill { display: flex; flex-direction: column; justify-content: center; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .4em .9em; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.search-pill:hover, .search-pill:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.search-pill label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--green); margin-bottom: 1px; }
.search-pill select { border: none; background: transparent; font-family: var(--font-body); font-size: .98rem; font-weight: 500; color: var(--ink); outline: none; appearance: none; cursor: pointer; padding: 2px 20px 2px 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2314533C' stroke-width='1.8' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; }

/* ============================================================
   Sélecteur de niveau galop
   ============================================================ */
.galop-picker { position: relative; }
.galop-picker summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7em 1em; font-weight: 600; font-size: .96rem; color: var(--ink); height: 100%; }
.galop-picker summary::-webkit-details-marker { display: none; }
.galop-picker[open] summary { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.galop-picker .gp-ico { opacity: .85; }
.galop-panel { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.galop-opt { display: flex; align-items: center; gap: 10px; padding: .5em .7em; border-radius: 8px; cursor: pointer; font-size: .92rem; }
.galop-opt:hover { background: var(--green-soft); }
.galop-opt input { accent-color: var(--green); width: 16px; height: 16px; }
.galop-opt input:checked + span { color: var(--green); font-weight: 600; }

/* Leaflet : garder la carte sous les menus du site */
.leaflet-pane, .leaflet-top, .leaflet-bottom { z-index: 2 !important; }

@media (max-width: 600px) {
    .search-hero-row > * { flex: 1 1 100%; }
}

/* ============================================================
   Disponibilités & calendrier (D.P)
   ============================================================ */
.resa-box { margin-top: 26px; padding: 22px; background: var(--green-soft); border-radius: var(--radius); }
.cal-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.cal-head { text-align: center; font-weight: 700; text-transform: capitalize; margin-bottom: 10px; color: var(--green); font-family: var(--font-display); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .68rem; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: .82rem; border-radius: 8px; color: var(--ink); }
.cal-cell.empty { visibility: hidden; }
.cal-cell.avail { background: #d7ecdf; color: var(--green-dark); font-weight: 600; cursor: pointer; transition: .12s; }
.cal-cell.avail:hover { background: #bfe0cd; }
.cal-cell.off { color: #c7ccc8; }
.cal-cell.past { color: #dde0dc; text-decoration: line-through; }
.cal-cell.booked { background: #f0efea; color: #b4b2a9; text-decoration: line-through; }
.cal-cell.blocked { background: #f6e3df; color: #c79a92; text-decoration: line-through; }
.cal-cell.sel { background: var(--green) !important; color: #fff !important; font-weight: 700; }
.cal-cell.start { box-shadow: 0 0 0 2px var(--gold); }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 12px; }
.cal-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.cal-legend .dot.avail { background: #d7ecdf; } .cal-legend .dot.booked { background: #d3d1c7; } .cal-legend .dot.blocked { background: #e7c3bb; } .cal-legend .dot.sel { background: var(--green); }
.resa-summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; line-height: 1.5; }
@media (max-width: 620px) { .cal-wrap { grid-template-columns: 1fr; } }

/* Champ localisation : rectangle arrondi cohérent avec les autres champs (variante panneau) */
.locsearch-panel .loc-field { border-radius: var(--radius-sm); border: 1.5px solid var(--line); padding: 2px 6px 2px 12px; }
.locsearch-panel .loc-input { padding: .65em .5em; font-size: .98rem; }

/* Sélecteur de jours (pastilles) */
.weekday-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.wd-opt { position: relative; cursor: pointer; }
.wd-opt input { position: absolute; opacity: 0; }
.wd-opt span { display: block; padding: .5em .9em; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .85rem; transition: .15s; }
.wd-opt input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.wd-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--green-soft); }

/* Badge réduction */
.discount-badge { position: absolute; top: 12px; right: 56px; background: var(--gold); color: #2a1e06; font-size: .76rem; font-weight: 700; padding: .3em .7em; border-radius: 999px; box-shadow: var(--shadow); }

/* Bouton d'upload de fichier stylé */
.file-upload { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex-wrap: wrap; }
.file-upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-upload-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green); border: 1.5px solid var(--line); border-radius: 999px; padding: .6em 1.2em; font-weight: 600; font-size: .92rem; transition: .15s; }
.file-upload:hover .file-upload-btn { background: #dce8e0; border-color: var(--green); }
.file-upload input:focus-visible + .file-upload-btn { box-shadow: 0 0 0 3px var(--green-soft); }
.file-upload-name { font-size: .85rem; color: var(--muted); }

/* Cours de club & chevaux */
.horse-list { display: flex; flex-wrap: wrap; gap: 8px; }
.horse-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green-dark); border-radius: 999px; padding: .35em .8em; font-size: .88rem; font-weight: 600; }
.horse-del { border: none; background: rgba(0,0,0,.08); color: var(--ink); width: 18px; height: 18px; border-radius: 50%; cursor: pointer; font-size: .7rem; line-height: 1; padding: 0; }
.horse-del:hover { background: var(--danger); color: #fff; }
.course-card { padding: 0; margin-bottom: 14px; overflow: hidden; transition: box-shadow .15s; }
.course-card:hover { box-shadow: var(--shadow); }
.course-head { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.course-date { background: linear-gradient(160deg, var(--green), var(--green-dark)); color: #fff; border-radius: 14px; padding: 9px 6px 8px; text-align: center; min-width: 66px; flex: 0 0 auto; line-height: 1.05; box-shadow: 0 4px 12px rgba(20,83,60,.22); }
.course-date .dow { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; opacity: .92; }
.course-date .d { font-size: 1.85rem; font-weight: 700; font-family: var(--font-display); line-height: 1; margin: 2px 0; }
.course-date .m { font-size: .7rem; opacity: .95; }
.course-head strong { font-size: 1.08rem; line-height: 1.3; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.course-riders { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 8px; background: var(--cream); }
.rider-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .92rem; flex-wrap: wrap; }
.course-action { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 14px 16px; }
@media (max-width: 480px) {
    .course-head { gap: 10px; padding: 14px; }
    .course-date { min-width: 56px; }
    .course-date .d { font-size: 1.55rem; }
    .course-action .select-mini, .rider-row .select-mini { width: 100%; }
}
.select-mini { padding: .35em 1.8em .35em .7em; font-size: .88rem; }
.wd-btn { padding: .4em .8em; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; font-size: .82rem; cursor: pointer; color: var(--ink); transition: .15s; }
.wd-btn.on { background: var(--green); color: #fff; border-color: var(--green); }
.wd-btn:hover { border-color: var(--green); }

/* Bulle « Support » (médiation litige) */
.bubble.support { align-self: center; background: var(--gold-soft); color: var(--gold-dark); border: 1px solid #e8d4a8; max-width: 92%; text-align: center; }
.bubble.support .time { color: var(--gold-dark); opacity: .7; }

/* Notation par étoiles */
.stars { letter-spacing: 1px; white-space: nowrap; }
.star-pick { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 3px; font-size: 1.9rem; line-height: 1; }
.star-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-pick label { color: #dcd6ca; cursor: pointer; transition: color .12s; }
.star-pick label:hover, .star-pick label:hover ~ label, .star-pick input:checked ~ label { color: var(--gold); }
.star-pick input:focus-visible + label { outline: 2px solid var(--green-soft); border-radius: 4px; }

/* QR code de remise en main propre */
.qr-handover { display: inline-flex; flex-direction: column; align-items: center; }
.qr-box { width: 190px; height: 190px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: .8rem; padding: 6px; }
.qr-img { display: block; image-rendering: pixelated; border-radius: 6px; }

/* Réglages : lignes + interrupteurs à bascule */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.setting-row:last-of-type { border-bottom: none; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: #cfd6d1; border-radius: 999px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--green-soft); }
