/* Accessoires compatibles — styles de la section « Complétez votre appareil ».
 *
 * Fichier autonome : css/style.css n'est PAS modifié.
 * Toutes les couleurs, rayons et ombres viennent des jetons de :root.
 * Les cartes réutilisent .product-card ; on ne redéfinit ici que le contenu.
 */

/* ---------- Section ---------- */

.acc-section[hidden],
.acc-carte[hidden] {
    display: none;
}

/* La section suit immédiatement le panier : on évite d'empiler deux fois
 * 100 px de blanc, sans toucher au rythme vertical du reste de la page. */
.acc-section {
    padding-top: 0;
}

.acc-entete {
    text-align: center;
}

/* Sélecteur à deux niveaux : .zone-services .section-subtitle est déjà posé
 * dans css/style.css, il faut la même spécificité pour le resserrer. */
.acc-section .acc-intro {
    max-width: 620px;
    margin: 0 auto 44px;
}

/* ---------- Groupe (un téléphone du panier, ou les universels) ---------- */

.acc-groupe + .acc-groupe {
    margin-top: 44px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}

.acc-groupe-titre {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.acc-groupe-titre::before {
    content: "";
    flex: 0 0 auto;
    width: 5px;
    height: 22px;
    border-radius: var(--radius-sm);
    background: var(--gradient);
}

/* ---------- Grille ---------- */

.acc-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    align-items: stretch;
}

/* ---------- Carte accessoire ---------- */

.acc-carte {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    height: 100%;
    min-width: 0;
    border: 1px solid var(--border);
}

.acc-visuel {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 76px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--primary);
    font-size: 1.9rem;
}

.acc-visuel img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.acc-famille {
    align-self: center;
    background: var(--bg-soft);
    color: var(--primary);
}

.acc-carte .acc-nom {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.acc-description {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-light);
}

/* Flux en ligne (et pas flex) : sur deux lignes, la pastille reste collée au
 * texte au lieu de se décrocher sur le bord gauche de la carte. */
.acc-compat {
    display: block;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-light);
    text-align: center;
}

.acc-compat i {
    margin-right: 5px;
    color: var(--primary);
}

/* ---------- Pied de carte : prix + bouton ---------- */

.acc-pied {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 6px;
}

.acc-prix {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

/* Cible tactile : .btn-sm descend sous 44 px, on le remonte ici. */
.acc-carte .acc-ajouter,
.acc-plus {
    min-height: 44px;
    justify-content: center;
}

.acc-carte .acc-ajouter {
    width: 100%;
}

.acc-plus {
    display: inline-flex;
    margin: 22px auto 0;
}

/* ---------- Confirmation d'ajout ---------- */

.acc-flash {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 9999;
    transform: translateX(-50%);
    /* Sans « max-content », la bulle est calée sur l'espace restant à droite de
     * left: 50 % : sur un écran de 375 px elle tombait à 188 px et le message
     * partait sur trois lignes. Mesuré dans Chrome. */
    width: max-content;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 12px 22px;
    border-radius: var(--radius-lg);
    background: var(--gradient);
    color: var(--bg);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

/* ---------- Écrans étroits ---------- */

@media (max-width: 480px) {
    .acc-grille {
        grid-template-columns: 1fr;
    }

    .acc-groupe-titre {
        font-size: 1.05rem;
    }
}
