/* ============================================================
   Favoris + Utilisateur — Code Promo v3
   ============================================================ */

.carte-code { position: relative; }

.btn-favori {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    z-index: 3;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    transition: transform .2s, box-shadow .2s;
    padding: 0; line-height: 1;
}
.btn-favori:hover { transform: scale(1.15); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.btn-favori.actif { background: #fff0f3; }

/* Codes exclusifs masqués */
.code-exclusif-masque {
    display: flex; flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #f8faff, #eef2ff);
    border: 1.5px dashed #a5b4fc;
    border-radius: var(--rayon, 8px);
    padding: 12px 16px;
    text-decoration: none;
    transition: background .2s, border-color .2s;
    cursor: pointer;
    margin-top: 8px;
}
.code-exclusif-masque:hover { background: #eef2ff; border-color: #6366f1; }
.code-masque { font-size: 20px; font-weight: 700; letter-spacing: 4px; color: #a5b4fc; margin-bottom: 4px; }
.code-exclusif-label { font-size: 11px; color: #6366f1; font-weight: 600; text-align: center; }

.carte-code.exclusif { border-color: #c7d2fe !important; }
.code-badge.exclusif { background: #6366f1 !important; }

/* Compteur favoris header */
.btn-favoris-header {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--fond, #f9fafb);
    border: 1.5px solid var(--bordure, #e5e7eb);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px; font-weight: 600;
    color: var(--texte, #1a1a1a);
    text-decoration: none;
    transition: border-color .2s, color .2s;
}
.btn-favoris-header:hover { border-color: var(--vert, #1a7a3c); color: var(--vert, #1a7a3c); }

#compteur-favoris-header {
    background: var(--vert, #1a7a3c);
    color: #fff;
    border-radius: 50%;
    width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}

/* Dropdown utilisateur */
.dropdown-user { position: relative; }
.btn-user-menu {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--fond, #f9fafb);
    border: 1.5px solid var(--bordure, #e5e7eb);
    border-radius: var(--rayon);
    padding: 9px 14px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    color: var(--texte, #1a1a1a);
    white-space: nowrap;
    transition: border-color .2s;
}
.btn-user-menu:hover, .dropdown-user:hover .btn-user-menu { border-color: var(--vert, #1a7a3c); }
.dropdown-menu {
    display: none;
    position: absolute; right: 0; top: calc(100% + 6px);
    background: #fff;
    border: 1.5px solid var(--bordure, #e5e7eb);
    border-radius: var(--rayon-lg, 12px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
}
.dropdown-user:hover .dropdown-menu,
.dropdown-user.ouvert .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--texte, #1a1a1a);
    text-decoration: none;
    transition: background .15s;
}
.dropdown-menu a:hover { background: var(--fond, #f9fafb); color: var(--vert, #1a7a3c); }

/* Nav sous-catégories dropdown */
.nav-chevron { font-size: 10px; margin-left: 2px; opacity: .6; }

/* Boutons header */
.btn-inscription {
    background: var(--vert, #1a7a3c);
    color: #fff !important;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}
.btn-inscription:hover { opacity: .88; }

/* Grille catégories checkboxes */
.grille-categories-check {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.cat-check {
    display: flex; align-items: center; gap: 6px;
    background: var(--fond, #f9fafb);
    border: 1.5px solid var(--bordure, #e5e7eb);
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: border-color .2s, background .2s;
    user-select: none;
}
.cat-check input { display: none; }
.cat-check:has(input:checked), .cat-check.selectionnee {
    border-color: var(--vert, #1a7a3c);
    background: #e6f4ec;
    color: var(--vert, #1a7a3c);
    font-weight: 600;
}
.cat-check:hover { border-color: var(--vert, #1a7a3c); }

/* Visuel catégorie avec image + couleur */
.bandeau-categorie-img {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    border-radius: var(--rayon, 8px);
    display: block;
}

/* ============================================================
   Codes expirés — affichage en gris
   ============================================================ */
.carte-code.code-expire-gris,
.code-expire-gris {
    opacity: .55;
    filter: grayscale(60%);
}
.carte-code.code-expire-gris .code-boite,
.code-expire-gris .code-boite {
    background: #f3f4f6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Décaler le bouton favori pour ne pas masquer les badges */

/* ============================================================
   VIP Badge commerçant
   ============================================================ */
.badge-vip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    margin-left: 6px;
    vertical-align: middle;
}
.carte-code.vip-prioritaire {
    border-color: var(--vip-couleur, #f59e0b) !important;
    box-shadow: 0 0 0 2px var(--vip-couleur, #f59e0b22);
}

/* ============================================================
   Sous-catégories dropdown navigation
   ============================================================ */
.nav-cat-wrapper {
    position: relative;
    display: inline-block;
}
.nav-sous-cats {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 180px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px 0;
}
.nav-cat-wrapper:hover .nav-sous-cats,
.nav-cat-wrapper.ouvert .nav-sous-cats {
    display: block;
}
.nav-sous-cats a {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: #1a1a1a;
    text-decoration: none;
    white-space: nowrap;
}
.nav-sous-cats a:hover {
    background: #f0fdf4;
    color: #1a7a3c;
}
