/* Page de vente publique - design inspiré du modèle l'Humanité.
   Couleurs pilotées par les variables --pv-* (configurées en admin). */

:root {
    --pv-accent: var(--pv-bouton, #e2001a);
}

/* Police des titres (issue #18) : titres, boutons et onglets. Repli sur la
   police du corps puis sur sans-serif si aucune n'est configurée. */
.pv-titre, .pv-groupe-titre, .pv-offre-titre, .pv-faq-titre,
.pv-faq-q, .pv-toggle-btn, .pv-bouton {
    font-family: var(--pv-font-titres, var(--pv-font-corps, sans-serif));
}

.pv-page {
    background: var(--pv-fond, #fbf3de);
    color: var(--pv-fond-1, #1a1a1a);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--pv-font-corps, sans-serif); /* police du texte courant (issue #18) */
    font-feature-settings: "kern";
    /* Jeux de nuances par zone (défaut : texte foncé). Surchargés par les classes
       txt-*-{clair|fonce} du body, pilotées par l'éditeur (thème). */
    --pv-fond-1: #1a1a1a;            /* texte principal sur le fond */
    --pv-fond-2: rgba(0, 0, 0, .62); /* texte secondaire sur le fond */
    --pv-card-1: #1a1a1a;            /* texte principal dans les cartes */
    --pv-card-2: #3a3a3a;            /* texte courant (bénéfices) */
    --pv-card-3: #888;               /* texte tertiaire (sous-titre, zone) */
    --pv-bouton-texte: #ffffff;      /* texte des boutons */
    --pv-toggle-texte: #1a1a1a;      /* texte du sélecteur de groupe */
}
/* Texte principal clair (fond foncé). */
.pv-page.txt-fond-clair {
    --pv-fond-1: #ffffff;
    --pv-fond-2: rgba(255, 255, 255, .8);
}
/* Texte clair dans les cartes (cartes foncées). */
.pv-page.txt-card-clair {
    --pv-card-1: #ffffff;
    --pv-card-2: rgba(255, 255, 255, .85);
    --pv-card-3: rgba(255, 255, 255, .6);
}
/* Texte des boutons : clair (blanc) ou foncé. */
.pv-page.txt-bouton-clair { --pv-bouton-texte: #ffffff; }
.pv-page.txt-bouton-fonce { --pv-bouton-texte: #1a1a1a; }
/* Texte du sélecteur de groupe : clair ou foncé. */
.pv-page.txt-toggle-clair { --pv-toggle-texte: #ffffff; }
.pv-page.txt-toggle-fonce { --pv-toggle-texte: #1a1a1a; }

/* Largeur max du contenu + marges latérales (jamais collé aux bords). */
.pv-page .container {
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Barre du haut : état de connexion, aligné à droite. */
.pv-topbar { padding: .75rem 0 0; font-size: .85rem; }
.pv-topbar .container { display: flex; justify-content: flex-end; align-items: center; }
.pv-compte { color: var(--pv-fond-2); }
.pv-connexion {
    color: var(--pv-fond-1);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.pv-connexion:hover { opacity: .75; }

/* Menu déroulant « Mon compte » (haut à droite). */
.pv-compte-menu { position: relative; }
.pv-compte-bouton {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: transparent;
    border: 1px solid var(--pv-fond-2);
    border-radius: 999px;
    color: var(--pv-fond-1);
    font-weight: 700;
    font-size: .85rem;
    padding: .35rem .85rem;
    cursor: pointer;
    line-height: 1;
}
.pv-compte-bouton:hover { opacity: .8; }
.pv-compte-chevron { font-size: .7rem; }
.pv-compte-liste {
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    min-width: 180px;
    background: #fff;
    color: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    padding: .35rem;
    z-index: 50;
}
.pv-compte-item {
    display: block;
    padding: .5rem .75rem;
    border-radius: 7px;
    color: #1a1a1a;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}
.pv-compte-item:hover { background: #f2f2f2; }
.pv-compte-item.is-active { background: #f2f2f2; color: var(--pv-accent); }
.pv-compte-sep { margin: .35rem 0; border: 0; border-top: 1px solid #eee; }
.pv-compte-deco { color: #c0392b; }

/* Espace compte : thème de boutons sobre (fond gris, texte blanc). */
.compte-page .button,
.compte-page .button.is-primary {
    background: #6b7280;
    color: #fff;
    border: 1px solid #6b7280;
    box-shadow: none;
}
.compte-page .button:hover,
.compte-page .button.is-primary:hover {
    background: #565b64;
    color: #fff;
    border-color: #565b64;
}

.pv-preview-bandeau {
    background: #ffdd57;
    color: #000;
    text-align: center;
    font-size: .85rem;
    padding: .35rem;
    font-weight: 600;
}

/* ===== En-tête ===== */
.pv-entete { padding: 3.5rem 1rem 1.5rem; }
.pv-logo { max-height: 80px; width: auto; margin-bottom: 1rem; }

/* Logo du support : grand, centré. SVG inline recoloré via couleur_logo. */
.pv-support-logo {
    display: block;
    margin: 0 auto 1.25rem;
    max-width: 320px;
    max-height: 130px;
}
.pv-support-logo svg { width: 100%; height: auto; max-height: 130px; display: block; }
.pv-support-logo svg, .pv-support-logo svg * { fill: currentColor !important; }
img.pv-support-logo { width: auto; object-fit: contain; }
.pv-titre {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--pv-fond-1);
    margin-bottom: .75rem;
}
.pv-description { max-width: 720px; margin: 0 auto; color: var(--pv-fond-2); }

/* ===== Toggle de groupes (pilules) ===== */
.pv-toggle {
    display: flex;
    width: fit-content;
    gap: .25rem;
    margin: 1.5rem auto 2.5rem;
    padding: .3rem;
    background: var(--pv-toggle-bg, rgba(0, 0, 0, .06));
    border-radius: 999px;
}
.pv-toggle-btn {
    border: 0;
    background: transparent;
    color: var(--pv-toggle-texte, #1a1a1a);
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    padding: .55rem 1.25rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
/* Pilule active : inversion texte/fond du sélecteur pour ressortir. */
.pv-toggle-btn.is-active {
    background: var(--pv-toggle-texte, #1a1a1a);
    color: var(--pv-toggle-bg, #fff);
}

/* ===== Groupes / grille de cartes ===== */
.pv-groupe { padding: 0 0 2rem; }
.pv-groupe[hidden] { display: none !important; } /* groupe non actif (toggle) */
.pv-groupe-titre {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--pv-fond-1);
    text-align: center;
    margin-bottom: 1.25rem;
}
.pv-offres {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    max-width: 1040px;
    margin: 0 auto;
    align-items: start;
}

/* ===== Carte d'offre ===== */
.pv-offre {
    position: relative;              /* ancre le badge promo (.pv-offre-badge) */
    background: var(--pv-card-bg, #fff); /* fond de carte (auto blanc, ou couleur choisie) */
    color: var(--pv-card-2);
    border-radius: 16px;
    padding: 1.5rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .07);
    text-align: center;
}
/* Texte des cartes en clair → carte foncée par défaut (sauf couleur choisie). */
.pv-page.txt-card-clair .pv-offre { background: var(--pv-card-bg, #1f1f1f); }

/* Mise en gras (strong/b) : couleur principale de la zone (contraste max), qui
   s'adapte au thème clair/foncé — au lieu du gris sombre par défaut de Bulma.
   Sur le fond → --pv-fond-1 ; dans les cartes → --pv-card-1. */
.pv-entete strong, .pv-entete b,
.pv-description strong, .pv-description b { color: var(--pv-fond-1); }
.pv-offre strong, .pv-offre b,
.pv-faq strong, .pv-faq b { color: var(--pv-card-1); }
.pv-offre-tete { min-height: 3.2rem; }
.pv-offre-titre {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--pv-card-1);    /* suit le texte des cartes (foncé/clair) */
    letter-spacing: .01em;
}
.pv-offre-soustitre {
    font-size: .8rem;
    color: var(--pv-card-3);
    font-weight: 600;
}
.pv-offre-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
}
.pv-offre-prix {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--pv-card-1);
    line-height: 1;
}
.pv-offre-prix-euro { font-size: 1.1rem; font-weight: 700; }
/* Prix barré (ancien prix) + badge de réduction. */
.pv-offre-prix-barre {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pv-card-3);
    text-decoration: line-through;
    margin-right: .4rem;
}
/* Pastille de réduction : rond superposé au coin haut-droit de la carte, incliné
   vers la droite. */
.pv-offre-reduction {
    position: absolute;
    top: -1.5rem;
    right: -1.2rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    background: #e62b4a;
    color: #fff;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    transform: rotate(12deg);            /* incliné vers la droite */
    box-shadow: 0 4px 10px rgba(0, 0, 0, .22);
}
/* Badge promotionnel : ruban affiché en haut de la card. */
.pv-offre-badge {
    position: absolute;
    top: -.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: #e62b4a;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    padding: .35rem .75rem;
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
}
/* Description (texte d'intro de la card), distincte des bénéfices. */
.pv-offre-description {
    font-size: .9rem;
    color: var(--pv-card-2);
    line-height: 1.45;
}

.pv-bouton {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--pv-bouton, #ffd400);
    color: var(--pv-bouton-texte, #1a1a1a);
    border: 0;
    border-radius: 8px;
    padding: .8rem 1rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: .85rem;
    letter-spacing: .03em;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s;
}
.pv-bouton:hover { filter: brightness(.95); }
.pv-bouton[disabled] { opacity: .6; cursor: default; }

/* Bénéfices : liste à coches */
.pv-benefices {
    list-style: none;
    margin: .25rem 0 0;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.pv-benefices li {
    position: relative;
    padding-left: 1.6rem;
    font-size: .85rem;
    color: var(--pv-card-2);
    line-height: 1.35;
}
.pv-benefices li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--pv-accent);
    font-weight: 800;
}

.pv-offre-zone {
    margin-top: auto;
    font-size: .72rem;
    color: var(--pv-card-3);
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Mention (légales/conditions) en bas de card. */
.pv-offre-mention {
    margin-top: .5rem;
    font-size: .68rem;
    line-height: 1.35;
    color: var(--pv-card-3);
}
/* Sans zone, la mention occupe la zone basse pour rester collée au pied de card. */
.pv-offre-zone + .pv-offre-mention { margin-top: .35rem; }
.pv-offre > .pv-offre-mention:last-child { margin-top: auto; padding-top: .5rem; }

/* ===== Liens (cards bas de page) ===== */
.pv-liens-groupe { max-width: 1040px; margin: 1.5rem auto 0; padding-bottom: 1rem; }
.pv-liens-titre {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--pv-fond-1);
    text-align: center;
    margin-bottom: 1.25rem;
}
.pv-liens {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
/* Layout « liste » : une colonne, cards horizontales (image à gauche). */
.pv-liens.is-liste { grid-template-columns: 1fr; }
.pv-liens.is-liste .pv-lien-card { flex-direction: row; align-items: stretch; }
.pv-liens.is-liste .pv-lien-image { width: 200px; height: auto; flex: 0 0 auto; }
.pv-liens.is-liste .pv-lien-corps { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 540px) {
    .pv-liens.is-liste .pv-lien-card { flex-direction: column; }
    .pv-liens.is-liste .pv-lien-image { width: 100%; height: 160px; }
}
.pv-lien-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--pv-card-2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .07);
    transition: transform .15s, box-shadow .15s;
}
.pv-lien-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0, 0, 0, .12); }
.pv-page.txt-card-clair .pv-lien-card { background: #1f1f1f; }
.pv-lien-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.pv-lien-corps { padding: 1.1rem 1.25rem; }
.pv-lien-titre {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pv-card-1);
    margin-bottom: .35rem;
}
.pv-lien-desc {
    font-size: .9rem;
    color: var(--pv-card-2);
    line-height: 1.4;
}

/* ===== FAQ (accordéon, bas de page) ===== */
.pv-faq { max-width: 760px; margin: 2rem auto 0; padding-bottom: 1rem; }
.pv-faq-titre {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--pv-fond-1);
    text-align: center;
    margin-bottom: 1.25rem;
}
.pv-faq-item {
    background: var(--pv-card-bg, #fff);
    border-radius: 12px;
    margin-bottom: .65rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    overflow: hidden;
}
.pv-page.txt-card-clair .pv-faq-item { background: var(--pv-card-bg, #1f1f1f); }
.pv-faq-q {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: var(--pv-card-1);
    list-style: none;
    position: relative;
    padding-right: 2.5rem;
}
.pv-faq-q::-webkit-details-marker { display: none; }
.pv-faq-q::after {
    content: "+";
    position: absolute;
    right: 1.25rem;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--pv-accent);
}
.pv-faq-item[open] .pv-faq-q::after { content: "−"; }
.pv-faq-r {
    padding: 0 1.25rem 1.1rem;
    color: var(--pv-card-2);
}

/* ===== Modale de souscription ===== */
.pv-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.pv-modal[hidden] { display: none; }
.pv-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}
.pv-modal-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    height: min(90vh, 760px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    overflow: hidden;
}
.pv-modal-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.pv-modal-close {
    position: absolute;
    top: .4rem; right: .6rem;
    z-index: 2;
    background: rgba(0, 0, 0, .06);
    border: 0;
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
}
.pv-modal-close:hover { background: rgba(0, 0, 0, .12); }

.pv-vide { padding: 3rem 0; }
.pv-footer { margin-top: auto; padding: 2.5rem 1rem; opacity: .8; color: var(--pv-fond-1); }

@media (max-width: 480px) {
    .pv-titre { font-size: 1.6rem; }
}
