/* ================================================================
   LIGHTWEIGHT AFFILIATE BUTTONS — CSS 1.0.0
   Un bouton par marchand, à sa couleur, avec le nom de la destination.
   ================================================================ */

/* ---------------------------------------------------------------
   Base commune
   --------------------------------------------------------------- */
.afb-btn {
    --afb-bg: #141a33;
    --afb-bg-hover: #2b3563;
    --afb-fg: #fff;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--afb-bg);
    color: var(--afb-fg) !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    vertical-align: middle;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.afb-btn:hover,
.afb-btn:focus-visible {
    background: var(--afb-bg-hover);
    color: var(--afb-fg) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
    outline: none;
}

.afb-btn:active { transform: translateY(0); }

/* Icône */
.afb-btn .afb-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.afb-btn .afb-ico svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.afb-btn .afb-label {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Variantes de taille / largeur */
.afb-btn--sm { min-height: 38px; padding: 0 16px; font-size: 13px; }
.afb-btn--lg { min-height: 52px; padding: 0 26px; font-size: 15px; }
.afb-btn--block { display: flex; width: 100%; }
.afb-btn--ghost {
    background: transparent;
    border: 1px solid var(--afb-bg);
    color: var(--afb-bg) !important;
}
.afb-btn--ghost:hover {
    background: var(--afb-bg);
    color: #fff !important;
}

/* ---------------------------------------------------------------
   Couleurs par marchand
   --------------------------------------------------------------- */
.afb-amazon      { --afb-bg: #232f3e; --afb-bg-hover: #131a24; --afb-fg: #fff; }
.afb-aliexpress  { --afb-bg: #ff4747; --afb-bg-hover: #e03232; --afb-fg: #fff; }
.afb-ebay        { --afb-bg: #0064d2; --afb-bg-hover: #0053ad; --afb-fg: #fff; }
.afb-cdiscount   { --afb-bg: #e30613; --afb-bg-hover: #bd050f; --afb-fg: #fff; }
.afb-fnac        { --afb-bg: #e1a925; --afb-bg-hover: #c9921a; --afb-fg: #1d1d1b; }
.afb-rakuten     { --afb-bg: #bf0000; --afb-bg-hover: #990000; --afb-fg: #fff; }
.afb-walmart     { --afb-bg: #0071ce; --afb-bg-hover: #005ba4; --afb-fg: #fff; }
.afb-etsy        { --afb-bg: #f1641e; --afb-bg-hover: #d25217; --afb-fg: #fff; }
.afb-temu        { --afb-bg: #fb7701; --afb-bg-hover: #d96601; --afb-fg: #fff; }
.afb-shein       { --afb-bg: #111111; --afb-bg-hover: #000000; --afb-fg: #fff; }
.afb-alibaba     { --afb-bg: #ff6a00; --afb-bg-hover: #d95a00; --afb-fg: #fff; }
.afb-decathlon   { --afb-bg: #0082c3; --afb-bg-hover: #006ba0; --afb-fg: #fff; }
.afb-boulanger   { --afb-bg: #f26b21; --afb-bg-hover: #d95a16; --afb-fg: #fff; }
.afb-leroymerlin { --afb-bg: #78be20; --afb-bg-hover: #649f18; --afb-fg: #12240a; }
.afb-darty       { --afb-bg: #e2001a; --afb-bg-hover: #bd0016; --afb-fg: #fff; }
.afb-generic     { --afb-bg: #141a33; --afb-bg-hover: #2b3563; --afb-fg: #fff; }

/* ---------------------------------------------------------------
   Badge marchand (optionnel, si le libellé ne contient pas le nom)
   --------------------------------------------------------------- */
.afb-merchant-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: none;
}

.afb-fnac .afb-merchant-chip,
.afb-leroymerlin .afb-merchant-chip { background: rgba(0, 0, 0, .12); }

/* ---------------------------------------------------------------
   Ajustements dans une boucle produit / carte deal
   --------------------------------------------------------------- */
.afb-btn.afb-in-card {
    display: flex;
    width: 100%;
    margin-top: 10px;
}

/* Respecte les préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .afb-btn { transition: none !important; }
    .afb-btn:hover { transform: none; }
}

@media (max-width: 480px) {
    .afb-btn { min-height: 42px; padding: 0 16px; font-size: 13px; }
}
