/* File: public-bff/public/css/wanted-card.css
 * Patrick 2026-05-30 — Source UNIQUE du style de la carte Wanted.
 * Design canonique = template /wanted catalogue validé par Patrick :
 *   - Image (ratio 4:3, fond doux quand placeholder)
 *   - Badge "Recherché" rouge coin haut-gauche
 *   - Breadcrumb complet (1-2 lignes)
 *   - Titre gras
 *   - Alerte jaune "Peu de vendeurs actifs actuellement" (variant A/B/.../J)
 *   - Pill gris "Demandé récemment"
 *   - Triple CTA (Je veux / Je vends côte à côte, Sourcer en dessous)
 *
 * Le partial vit dans resources/views/partials/wanted-card.blade.php
 * et est appelé depuis home v3 + /wanted catalogue.
 *
 * La carte est size-agnostic : width:100%; height:100%. Le conteneur parent
 * définit ses dimensions :
 *   - home rail : <li> avec flex sizing 6 colonnes
 *   - /wanted   : grid auto-fill 220px (frontend-wanted-index.css)
 *
 * Compagnon : public/css/wanted-cta.css (boutons triple CTA).
 */

/* ============================================================
   CARD CHROME — flex column, fill parent
   ============================================================ */
.hwr-card {
    width: 100%;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    transition: transform .15s ease, box-shadow .15s ease;
}
.hwr-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(11, 61, 145, .12);
}

/* ============================================================
   MEDIA — image ou placeholder + badge "Recherché"
   ============================================================ */
.hwr-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #dbeafe;            /* bleu très clair quand pas d'image */
    overflow: hidden;
    flex-shrink: 0;
}
.hwr-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hwr-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b3d91;
    font-size: 40px;
}

/* Badge rouge "Recherché" coin haut-gauche */
.hwr-card-signal {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ef4444;
    color: #fff;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}
.hwr-card-signal i { font-size: 10px; }

/* ============================================================
   BODY — flex column, bas pinned via .hwr-card-bottom
   ============================================================ */
.hwr-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Haut : breadcrumb + titre (variable selon longueur) */
.hwr-card-top { flex: 0 0 auto; }

.hwr-card-cat {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
    line-height: 1.35;
}

.hwr-card-name {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

/* ============================================================
   BAS pinned-bottom : alerte + recent + triple CTA
   margin-top:auto consomme le white space restant → tout ce bloc
   reste plaqué contre le bas du body, identique entre toutes les cards.
   ============================================================ */
.hwr-card-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

/* Alerte jaune "Peu de vendeurs actifs" (variant A/B/.../J) */
.hwr-card-msg {
    font-size: 12px;
    color: #b45309;
    font-weight: 600;
    background: #fef3c7;
    border-radius: 6px;
    padding: 6px 9px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.35;
}
.hwr-card-msg i {
    font-size: 12px;
    flex-shrink: 0;
}

/* Pill gris "Demandé récemment" */
.hwr-card-recent {
    display: inline-flex;
    align-self: flex-start;          /* ne prend que sa largeur naturelle */
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 9px;
    border-radius: 99px;
    margin-bottom: 14px;
    line-height: 1.3;
}
.hwr-card-recent i { font-size: 10px; }

/* ============================================================
   TOGGLE RÔLE (Patrick 2026-05-30) — Vous êtes : Acheteur / Vendeur
   1 seule ligne, pills compactes, default = Vendeur (intent flywheel).
   ============================================================ */
.hwr-role-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 11px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.hwr-role-label {
    color: #6b7280;
    font-weight: 600;
    flex-shrink: 0;
}
.hwr-role-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    cursor: pointer;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: #9ca3af;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
    flex-shrink: 0;
    font-family: inherit;
}
.hwr-role-tag:hover {
    border-color: #9ca3af;
    color: #374151;
}
/* États actifs — couleurs alignées sur le CTA contextuel correspondant */
.hwr-role-tag.is-active[data-role="buyer"] {
    background: #022d94;             /* navy = couleur acheteur */
    border-color: #022d94;
    color: #fff;
}
.hwr-role-tag.is-active[data-role="seller"] {
    background: #ffb700;             /* jaune = couleur vendeur */
    border-color: #f0c800;
    color: #111827;
}

/* ============================================================
   SLOTS CTA contextuels — un seul visible selon le rôle actif
   ============================================================ */
.hwr-cta-slot { display: none; }
.hwr-cta-slot.is-visible { display: flex; flex-direction: column; gap: 8px; }

/* Hint sous chaque CTA */
.hwr-cta-hint {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    margin-top: -2px;
    line-height: 1.4;
}

/* Variante "block" du CTA — 100% largeur de la carte (vs inline-flex par défaut) */
.hwr-cta-block {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 14px;
}

/* La grille triple CTA (.hwr-cta-grid) historique est définie dans wanted-cta.css
   mais N'EST PLUS UTILISÉE par ce partial — les 3 sorties sont distribuées via
   le toggle ci-dessus. Conservée au cas où une vue tierce l'utilise encore. */

/* ============================================================
   VARIANTE "embedded" — Patrick 2026-05-30
   Surfaces SECONDAIRES qui rendent du Wanted en complément de leur
   contenu principal (page catégorie, deals, search, products).
   Largeur ALIGNÉE sur /wanted (280px min).
   ============================================================ */
.wanted-grid--embedded {
    width: 100%;
    padding: 0 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .wanted-grid--embedded {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 18px;
    }
}
