:root {
    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #E4E1DA;
    --primary: #1a1a1a;
    --primary-dark: #000000;
    --accent: #f97316;
    --accent-dark: #ea580c;
    --success-bg: #DCFCE7;
    --success-text: #166534;
    --error-bg: #FEE2E2;
    --error-text: #991B1B;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(28, 35, 33, 0.08), 0 1px 2px rgba(28, 35, 33, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }

.search-form {
    flex: 1;
    display: flex;
    min-width: 240px;
    max-width: 480px;
}
.search-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 0.95rem;
}
.search-form button {
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-weight: 600;
}
.search-form button:hover { background: var(--primary-dark); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.92rem;
    margin-left: auto;
}

.btn {
    padding: 9px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    display: inline-block;
}
.btn-accent {
    background: var(--accent);
    color: white !important;
}
.btn-accent:hover { background: var(--accent-dark); text-decoration: none; }

.categories-bar {
    background: var(--primary-dark);
}
.categories-bar .wrap {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 0 20px;
}
.categories-bar a {
    color: rgba(255,255,255,0.85);
    padding: 10px 14px;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
}
.categories-bar a:hover {
    color: white;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

/* Flash messages */
.flash {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 500;
}
.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }

/* Main */
.main-content { padding: 32px 20px 60px; }

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 20px;
    color: var(--primary-dark);
}

/* Carte interactive */
.carte-france-svg {
    width: 100%;
    max-width: 700px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Tuiles catégorie (accueil) */
.category-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.category-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    font-weight: 700;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.category-tile:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--accent-dark);
    text-decoration: none;
}

/* Listing grid */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.listing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28,35,33,0.12);
    text-decoration: none;
}

.listing-card-image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.listing-card-image img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-image .placeholder { color: var(--text-muted); font-size: 0.85rem; }

.listing-card-body { padding: 14px; }
.listing-card-price {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-dark);
    margin: 0 0 4px;
}
.listing-card-title {
    font-size: 0.95rem;
    color: var(--text);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* Listing detail */
.listing-detail {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
}
@media (max-width: 800px) {
    .listing-detail { grid-template-columns: 1fr; }
}

.listing-gallery-main {
    aspect-ratio: 4/3;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.listing-gallery-main img { width: 100%; height: 100%; object-fit: contain; }

.listing-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.listing-gallery-thumbs img {
    width: 70px; height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.listing-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    height: fit-content;
}
.listing-sidebar .price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-dark);
    margin: 0 0 12px;
}

/* Forms */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 560px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}
.form-group textarea { min-height: 120px; resize: vertical; }

.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.btn-submit:hover { background: var(--primary-dark); }

/* Bannière profil */
.profile-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

/* Footer */
.site-footer-rich {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.75);
    margin-top: 40px;
}
.footer-columns {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 48px 20px 32px;
}
.footer-col h4 {
    color: white;
    font-size: 0.95rem;
    margin: 0 0 14px;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col ul li {
    margin-bottom: 8px;
}
.footer-col a {
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
}
.footer-col a:hover {
    color: var(--accent);
    text-decoration: none;
}
.footer-logo {
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    margin: 0 0 10px;
}
.footer-brand p {
    font-size: 0.88rem;
    line-height: 1.6;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 18px 20px;
    font-size: 0.82rem;
}
@media (max-width: 700px) {
    .footer-columns { grid-template-columns: 1fr 1fr; }
}
