/* ============================================================
   CACAO.CI HUB - Styles principaux
   Design: B2B premium, inspiré des codes du DTC cacao/chocolat
   (grands titres éditoriaux, palette crème chaleureuse, boutons
   pilule, cartes généreuses) tout en gardant la densité
   d'information nécessaire à une marketplace professionnelle.
   ============================================================ */

:root {
    --color-primary: #6B3410;      /* Brun cacao */
    --color-primary-dark: #3E1E0B;
    --color-primary-light: #8B5A2B;
    --color-accent: #D9A62E;       /* Or / moutarde */
    --color-accent-dark: #B8860B;
    --color-success: #3A6B4F;      /* Vert sauge */
    --color-success-bg: #EAF2EB;
    --color-danger: #C0392B;
    --color-bg: #FBF7EF;           /* Crème chaleureux */
    --color-card: #FFFFFF;
    --color-text: #2B2118;
    --color-text-muted: #6B6058;
    --color-border: #EAE1D2;
    --radius: 10px;
    --radius-lg: 20px;
    --radius-pill: 999px;
    --shadow: 0 2px 6px rgba(59, 41, 22, 0.06);
    --shadow-lg: 0 12px 28px rgba(59, 41, 22, 0.14);
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    max-width: 100%;
    overflow-x: hidden; /* filet de sécurité: empêche tout élément débordant de décaler la page entière */
}
img { max-width: 100%; height: auto; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ============ EYEBROW / LABELS ÉDITORIAUX ============ */
.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
}
.eyebrow.on-dark { color: #F1D989; }

/* ============ HEADER ============ */
.site-header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.logo {
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
}
.logo > * + * { margin-left: 8px; }
.logo img { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.logo-accent { color: var(--color-accent); }
.main-nav { display: flex; align-items: center; }
.main-nav > * + * { margin-left: 26px; }
.main-nav a {
    color: var(--color-text);
    font-weight: 500;
    font-size: 15px;
}
.main-nav a:hover { color: var(--color-primary); }
.header-actions { display: flex; align-items: center; }
.header-actions > * + * { margin-left: 10px; }
.badge-count {
    background: var(--color-danger);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    padding: 1px 6px;
    margin-left: 4px;
}

/* ============ BUTTONS (pilule, façon DTC premium) ============ */
.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    text-align: center;
    transition: all 0.18s ease;
    letter-spacing: 0.2px;
}
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); color: white; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: white; }
.btn-accent { background: var(--color-accent); color: var(--color-primary-dark); }
.btn-accent:hover { background: var(--color-accent-dark); transform: translateY(-1px); }
.btn-danger { background: var(--color-danger); color: white; }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============ RUBAN DE CONFIANCE (défilement continu, façon maison
   historique — device éditorial premium) ============ */
.trust-ticker {
    background: var(--color-primary-dark);
    color: rgba(255,255,255,0.92);
    overflow: hidden;
    white-space: nowrap;
    padding: 10px 0;
    position: relative;
}
.trust-ticker-track {
    display: inline-flex;
    animation: ticker-scroll 34s linear infinite;
}
.trust-ticker-track span {
    display: inline-flex;
    align-items: center;
    padding: 0 28px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--color-accent);
}
.trust-ticker-track span::after { content: '•'; margin-left: 28px; color: rgba(255,255,255,0.35); }
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .trust-ticker-track { animation: none; }
}

/* ============ HERO (éditorial, grand titre) ============ */
.hero {
    background: radial-gradient(ellipse at top left, #7A3D14 0%, var(--color-primary-dark) 65%);
    color: white;
    padding: 88px 20px 76px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 600;
    line-height: 1.12;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}
.hero p { font-size: 18px; opacity: 0.92; max-width: 600px; margin: 0 auto 32px; }
.hero-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    background: white;
    padding: 8px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-lg);
}
.hero-search > * + * { margin-left: 8px; }
.hero-search input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    outline: none;
    border-radius: var(--radius-pill);
}
.hero-search .btn { border-radius: var(--radius-pill); }
.hero-stats {
    display: flex;
    justify-content: center;
    margin-top: 44px;
    flex-wrap: wrap;
}
.hero-stats > * { margin: 0 24px; }
.hero-stats div { text-align: center; }
.hero-stats .num { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--color-accent); }
.hero-stats .label { font-size: 13px; opacity: 0.85; }

/* ============ TRUST BADGES (icône + texte, 3 colonnes) ============ */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.trust-badge { text-align: center; padding: 8px; }
.trust-badge .icon-circle {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--color-success-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin: 0 auto 14px;
}
.trust-badge h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.trust-badge p { font-size: 13.5px; color: var(--color-text-muted); }

/* ============ STAT BLOCKS (chiffres d'impact) ============ */
.stat-blocks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.stat-block { text-align: center; }
.stat-block .num { font-family: var(--font-display); font-size: 44px; font-weight: 600; color: var(--color-primary); }
.stat-block .label { font-size: 14px; color: var(--color-text-muted); margin-top: 4px; }

/* ============ CARDS ============ */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.profile-card, .product-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.profile-card:hover, .product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.card-image {
    width: 100%;
    height: 170px;
    background: #F1E9D8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 13px;
    overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.card-meta { font-size: 13px; color: var(--color-text-muted); margin-bottom: 8px; }
.card-desc { font-size: 14px; color: var(--color-text-muted); flex: 1; margin-bottom: 12px; }
.card-price { font-size: 17px; font-weight: 700; color: var(--color-success); }
.price-converted { font-size: 0.75em; font-weight: 400; color: var(--color-text-muted); }

.currency-switcher { display: flex; background: var(--color-bg); border-radius: var(--radius-pill); padding: 3px; }
.currency-switcher > * + * { margin-left: 2px; }
.currency-switcher a { padding: 5px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.currency-switcher a.active { background: var(--color-card); color: var(--color-primary); box-shadow: var(--shadow); }
.currency-switcher a:hover { color: var(--color-primary); }

/* Menu déroulant compact (devise / langue) — remplace les rangées de
   boutons toujours visibles, qui prenaient trop de place dans l'en-tête */
.mini-dropdown { position: relative; }
.mini-dropdown-trigger {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
}
.mini-dropdown-trigger::after { content: ' ▾'; font-size: 10px; color: var(--color-text-muted); }
.mini-dropdown-trigger:hover { border-color: var(--color-primary); }
.mini-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 100px;
    padding: 4px;
    z-index: 200;
}
.mini-dropdown.open .mini-dropdown-menu { display: block; }
.mini-dropdown-menu a { display: block; padding: 7px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.mini-dropdown-menu a:hover { background: var(--color-bg); }
.mini-dropdown-menu a.active { color: var(--color-primary); background: var(--color-bg); }

.spec-preview-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 8px 0; }
.spec-preview-table td { padding: 2px 0; color: var(--color-text-muted); }

/* Ligne de bénéfices avec coches (device éditorial premium) */
.checkmark-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 32px;
    padding: 20px;
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.checkmark-strip > div { display: flex; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.checkmark-strip > div::before { content: '✓'; color: var(--color-success); font-weight: 800; margin-right: 8px; font-size: 15px; }

/* Cartes promotionnelles multiples sous le hero (façon bannières marchandes) */
.promo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.promo-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 26px 24px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    border-top: 3px solid var(--color-accent);
}
.promo-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.promo-card h4 { font-family: var(--font-display); font-size: 19px; margin-bottom: 6px; }
.promo-card p { font-size: 13.5px; color: var(--color-text-muted); margin-bottom: 14px; line-height: 1.5; }

/* Badge d'engagement en pied de page (device de confiance final) */
.footer-guarantee {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-guarantee-icon {
    font-size: 30px;
    flex-shrink: 0;
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.footer-guarantee strong { color: white; font-size: 15px; }
.footer-guarantee p { font-size: 13px; margin-top: 3px; max-width: 520px; }

/* Section visuelle d'accueil — remplacer les dégradés par de vraies photos
   dès qu'elles sont disponibles (garder .photo-tile-icon et .photo-tile-label
   en overlay, ou les retirer selon le rendu souhaité) */
.photo-showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.photo-tile {
    position: relative;
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.photo-tile-icon { width: 72px; height: 72px; color: rgba(255,255,255,0.85); }
.photo-tile-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 16px 18px;
    background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}
.spec-preview-table td:first-child { font-weight: 600; color: var(--color-text); width: 45%; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; border-radius: var(--radius); overflow: hidden; }
.spec-table td { padding: 10px 14px; border-bottom: 1px solid var(--color-border); }
.spec-table td:first-child { font-weight: 600; color: var(--color-text-muted); width: 40%; background: var(--color-bg); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}
.badge-verified { background: var(--color-success-bg); color: var(--color-success); }
.badge-featured { background: #FBF0D4; color: #92600A; }
.badge-plan-silver { background: #EFEAE0; color: #5B5044; }
.badge-plan-gold { background: #FBF0D4; color: #92600A; }
.badge-plan-platinum { background: #EDE4FF; color: #5B3A9E; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    background: var(--color-card);
}
.form-control:focus { border-color: var(--color-accent); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.form-error { font-size: 13px; color: var(--color-danger); margin-top: 4px; }
.form-row { display: flex; }
.form-row > * + * { margin-left: 16px; }
.form-row > * { flex: 1; }

.auth-card {
    max-width: 440px;
    margin: 60px auto;
    padding: 36px;
    border-radius: var(--radius-lg);
}
.auth-card h1 { font-family: var(--font-display); font-size: 26px; margin-bottom: 8px; font-weight: 600; }
.auth-card .subtitle { color: var(--color-text-muted); margin-bottom: 24px; font-size: 14px; }

/* ============ ALERTS ============ */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid #C3DEC8; }
.alert-error { background: #FBEAE8; color: var(--color-danger); border: 1px solid #F0C0BA; }
.alert-info { background: #E8F0FB; color: #1D5BA8; border: 1px solid #B9D2F0; }

/* ============ FILTERS SIDEBAR ============ */
.layout-with-sidebar { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.filters-panel { position: sticky; top: 80px; }

/* Panneau de filtres repliable (bouton + JS, même mécanisme que le menu
   mobile) : toujours affiché sur desktop, replié par défaut sur mobile pour
   ne pas cacher les résultats derrière un long formulaire sur petit écran. */
.filters-toggle-btn { display: none; }
.filter-group { margin-bottom: 20px; }
.filter-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--color-text-muted); margin-bottom: 10px; font-weight: 700; }
.filter-option { display: block; padding: 6px 0; font-size: 14px; cursor: pointer; }

/* ============ PRICING ============ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin: 40px 0;
}
.pricing-card {
    background: var(--color-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    text-align: center;
}
.pricing-card.featured { border-color: var(--color-accent); position: relative; transform: scale(1.03); box-shadow: var(--shadow-lg); }
.pricing-card .plan-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.pricing-card .plan-price { font-family: var(--font-display); font-size: 38px; font-weight: 600; color: var(--color-primary); margin: 14px 0; }
.pricing-card .plan-price small { font-size: 14px; font-weight: 400; color: var(--color-text-muted); font-family: -apple-system, sans-serif; }
.pricing-card ul { list-style: none; text-align: left; margin: 22px 0; font-size: 14px; }
.pricing-card ul li { padding: 7px 0; color: var(--color-text-muted); }
.pricing-card ul li::before { content: "✓ "; color: var(--color-success); font-weight: 700; }

/* ============ DASHBOARD ============ */
.dashboard-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; min-height: 70vh; }
.sidebar-nav { background: var(--color-card); border-radius: var(--radius-lg); padding: 16px; height: fit-content; border: 1px solid var(--color-border); }
.sidebar-nav a { display: block; padding: 10px 14px; border-radius: var(--radius-pill); font-size: 14px; color: var(--color-text); margin-bottom: 2px; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--color-bg); color: var(--color-primary); font-weight: 600; }
.stat-card { text-align: center; padding: 26px; }
.stat-card .stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--color-primary); }
.stat-card .stat-label { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

/* ============ MESSAGING ============ */
.messaging-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; height: 65vh; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-card); }
.conversations-list { border-right: 1px solid var(--color-border); overflow-y: auto; }
.conversation-item { padding: 14px 16px; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.conversation-item:hover, .conversation-item.active { background: var(--color-bg); }
.conversation-item .name { font-weight: 600; font-size: 14px; }
.conversation-item .preview { font-size: 13px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-panel { display: flex; flex-direction: column; }
.thread-messages { flex: 1; overflow-y: auto; padding: 16px; }
.message-bubble { max-width: 70%; padding: 10px 16px; border-radius: 16px; margin-bottom: 10px; font-size: 14px; }
.message-bubble.mine { background: var(--color-primary); color: white; margin-left: auto; }
.message-bubble.theirs { background: var(--color-bg); }
.thread-input { display: flex; padding: 12px; border-top: 1px solid var(--color-border); }
.thread-input > * + * { margin-left: 8px; }
.thread-input input.form-control { border-radius: var(--radius-pill); }

/* ============ FOOTER ============ */
.site-footer { background: var(--color-primary-dark); color: rgba(255,255,255,0.8); padding: 48px 20px 20px; margin-top: 60px; font-size: 14px; }
.site-footer a { color: rgba(255,255,255,0.9); }
.site-footer strong { font-family: var(--font-display); }
.footer-bottom { text-align: center; padding-top: 20px; margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.15); opacity: 0.7; font-size: 13px; }

/* ============ UTILITIES ============ */
.page-header { padding: 36px 0 22px; }
.page-header h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.gap-1 > * + * { margin-left: 8px; } .gap-2 > * + * { margin-left: 16px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }

/* ============ RESPONSIVE / MOBILE ============ */

/* Visibilité conditionnelle desktop/mobile (bascule dans la media query ci-dessous) */
.mobile-only-inline, .mobile-only-block { display: none; }
.desktop-only-inline { display: flex; }

/* Bouton hamburger (caché en desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--color-primary-dark); border-radius: 2px; margin: 3px 0; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle span:first-child { margin-top: 0; }
.nav-toggle span:last-child { margin-bottom: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; padding: 12px 16px; }
    .nav-toggle { display: flex; }
    .desktop-only-inline { display: none; }

    /* Panneau de navigation mobile: masqué par défaut, s'ouvre sous le header */
    .main-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        order: 3;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--color-border);
    }
    .main-nav.open { display: flex; }
    .main-nav > * + * { margin-left: 0; margin-top: 4px; }
    .main-nav a { padding: 10px 4px; border-radius: 6px; }
    .main-nav a:hover { background: var(--color-bg); }
    .mobile-only-inline { display: flex; margin: 8px 0; }
    .mobile-only-block { display: block; }

    /* Contenu général */
    .container, .container-narrow { padding: 0 16px; }
    .hero { padding: 48px 16px; }
    .hero h1 { font-size: 30px; line-height: 1.2; }
    .hero p { font-size: 15px; }
    .hero-search { flex-direction: column; border-radius: var(--radius-lg); }
    .hero-search input { text-align: center; }
    .hero-stats { gap: 20px; }
    .hero-stats .num { font-size: 24px; }

    /* Grilles → 1 colonne */
    .layout-with-sidebar, .dashboard-layout, .messaging-layout { grid-template-columns: 1fr; }
    .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-card.featured { transform: none; }
    .trust-badges, .stat-blocks { grid-template-columns: 1fr; }
    .photo-showcase { grid-template-columns: 1fr; }
    .promo-row { grid-template-columns: 1fr; }
    .footer-guarantee { flex-direction: column; text-align: center; }

    /* Formulaires: empiler les champs côte à côte */
    .form-row { flex-direction: column; }
    .form-row > * + * { margin-left: 0; margin-top: 16px; }
    .auth-card, .card[style*="max-width"] { max-width: 100% !important; }

    /* Tables: scroll horizontal plutôt que débordement cassé */
    table:not(.spec-preview-table) { display: block; overflow-x: auto; white-space: nowrap; }
    .spec-table, .spec-preview-table { white-space: normal; }

    /* Pages avec grilles inline à 3-4 colonnes (stats, profil, etc.) → 2 colonnes */
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }

    /* Fiche produit/RFQ: image + infos en colonne unique */
    [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }

    /* Panneau de filtres: replié par défaut sur mobile pour ne pas cacher
       les résultats, avec un bouton cliquable pour l'afficher au besoin */
    .filters-toggle-btn {
        display: block;
        width: 100%;
        text-align: left;
        cursor: pointer;
        padding: 13px 18px;
        background: var(--color-card);
        border: 1.5px solid var(--color-border);
        border-radius: var(--radius-pill);
        font-weight: 700;
        font-size: 15px;
        color: var(--color-text);
        margin-bottom: 16px;
        font-family: inherit;
    }
    .filters-summary-hint { font-weight: 400; color: var(--color-text-muted); font-size: 12.5px; }
    .filters-toggle-content { display: none; }
    .filters-toggle-content.open { display: block; margin-bottom: 16px; margin-top: -6px; }

    /* Fiche profil: avatar au-dessus du contenu plutôt que côte à côte */
    .profile-header { flex-direction: column; }
    .profile-avatar { width: 72px !important; height: 72px !important; }

    .messaging-layout { height: auto; }
    .conversations-list { max-height: 260px; }
    .thread-messages { max-height: 320px; }

    .sidebar-nav { position: static; }
}

@media (max-width: 420px) {
    .grid { grid-template-columns: 1fr; }
    [style*="grid-template-columns: repeat(2"] { grid-template-columns: 1fr !important; }
    .hero-stats { flex-wrap: wrap; }
}
