/* ============================================================
   FAVORIS – Roller Grill
   Badge header + état actif coeur + Page favoris
   ============================================================ */

/* ── Badge compteur sur l'icône coeur ──────────────────────── */
.aurelien-wishlist-link {
    position: relative;
}
.rg-favoris-count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #8F1B12;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    display: none;
    pointer-events: none;
}

/* ── Coeur actif (favori) ───────────────────────────────────── */
[class*="wishlist-btn"].is-favori .clem-nouveautes__heart--empty,
[class*="wishlist-btn"].is-favori .product-image-heart--empty,
[class*="wishlist-btn"].is-favori .product-heart--empty {
    display: none;
}
[class*="wishlist-btn"] .clem-nouveautes__heart--full,
[class*="wishlist-btn"] .product-image-heart--full,
[class*="wishlist-btn"] .product-heart--full {
    display: none;
}
[class*="wishlist-btn"].is-favori .clem-nouveautes__heart--full,
[class*="wishlist-btn"].is-favori .product-image-heart--full,
[class*="wishlist-btn"].is-favori .product-heart--full {
    display: block;
}

/* Animation bounce au clic */
@keyframes rg-fav-bounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
[class*="wishlist-btn"].is-bounce svg {
    animation: rg-fav-bounce .4s ease;
}

/* ── Page favoris ───────────────────────────────────────────── */
.rg-favoris-page {
    max-width: 1200px;
    width: 100%;
    margin: 40px auto 80px;
    padding-left: 30px;
    padding-right: 30px;
    box-sizing: border-box;
}

.rg-favoris-page__title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 28px;
    color: #111;
}

/* ── Carte conteneur ────────────────────────────────────────── */
.rg-favoris-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 28px 32px;
    margin-bottom: 20px;
}

/* ── Header card ────────────────────────────────────────────── */
.rg-favoris-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.rg-favoris-card__header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin: 0;
}
.rg-favoris-card__header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Bouton "Tout ajouter" */
.rg-favoris-add-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: #F0C800;
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.rg-favoris-add-all-btn:hover { opacity: .8; }

/* Bouton "Ajouter la sélection" */
.rg-favoris-add-selection-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: #F0C800;
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, background .15s, color .15s;
}
.rg-favoris-add-selection-btn:hover:not(:disabled) { opacity: .85; }
.rg-favoris-add-selection-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
    opacity: 1;
}

/* ── Message vide ───────────────────────────────────────────── */
#rg-favoris-empty {
    text-align: center;
    padding: 48px 24px;
    color: #888;
}
#rg-favoris-empty p { margin-bottom: 16px; font-size: 15px; }
.rg-favoris-browse-link {
    display: inline-block;
    color: #111;
    font-weight: 600;
    text-decoration: underline;
    font-size: 14px;
}

/* ── Checkbox custom ────────────────────────────────────────── */
.rg-fav-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: border-color .15s, background .15s;
    margin: 0;
}
.rg-fav-check:checked {
    background: #111;
    border-color: #111;
}
.rg-fav-check:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* ── Liste produits favoris ─────────────────────────────────── */
.rg-fav-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.rg-fav-product:last-child { border-bottom: none; }

.rg-fav-product__img {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rg-fav-product__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.rg-fav-product__no-img {
    width: 100%;
    height: 100%;
    background: #eee;
}

.rg-fav-product__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.rg-fav-product__ref {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.rg-fav-product__name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rg-fav-product__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Bouton "Ajouter au devis" */
.rg-fav-add-devis {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: transparent;
    border: 1.5px solid #111;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.rg-fav-add-devis:hover {
    background: #111;
    color: #fff;
}

/* Bouton supprimer (coeur rempli → retire des favoris) */
.rg-fav-remove {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    color: #8F1B12;
    flex-shrink: 0;
    padding: 0;
    transition: transform .2s;
}
.rg-fav-remove:hover,
.rg-fav-remove:focus {
    background: transparent !important;
    border: none !important;
    transform: scale(1.15);
}

/* Cœur plein visible par défaut, vide caché */
.rg-fav-remove .rg-fav-heart--full  { display: block; }
.rg-fav-remove .rg-fav-heart--empty { display: none; }

/* Hover : swap → cœur vide visible */
.rg-fav-remove:hover .rg-fav-heart--full  { display: none; }
.rg-fav-remove:hover .rg-fav-heart--empty { display: block; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .rg-favoris-page {
        padding-left: 16px;
        padding-right: 16px;
        margin-top: 20px;
        margin-bottom: 48px;
    }
    .rg-favoris-page__title { font-size: 22px; margin-bottom: 20px; }
    .rg-favoris-card        { padding: 16px; }
    .rg-favoris-card__header { flex-direction: column; align-items: flex-start; }
    .rg-favoris-card__header-actions { flex-direction: column; width: 100%; }
    .rg-favoris-add-all-btn,
    .rg-favoris-add-selection-btn { width: 100%; justify-content: center; }

    .rg-fav-product { gap: 10px; }
    .rg-fav-product__img { width: 54px; height: 54px; }
    .rg-fav-add-devis { padding: 7px 10px; font-size: 12px; }
}
