/* ============================================================
   TRIPACKS : vitrine (section #paywall), sélecteur sur mesure,
   toast et pastilles de pack dans la grille.

   Parti pris : fond blanc, couleurs franches posées À PLAT
   (pas de dégradés), typo Outfit/Bricolage, ombres dures
   décalées comme le reste du site. Une couleur d'accent par
   pack, tirée de la palette « cosy » du projet.
   ============================================================ */

/* ── Grille des packs ── */
.pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
    text-align: left;
}
@media (min-width: 900px) { .pack-grid { grid-template-columns: repeat(3, 1fr); } }

.pack-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1.5px solid #E7E2DA;
    border-radius: 18px;
    overflow: hidden;
    font-family: 'Outfit', system-ui, sans-serif;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.pack-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--acc) 45%, #E7E2DA);
    box-shadow: 0 14px 28px -18px rgba(15, 23, 42, 0.25);
}

/* Une couleur franche par pack (palette cosy du projet) */
.pack-card[data-pack="decouverte"] { --acc: #2B5B44; --acc-soft: #E7F1EA; }
.pack-card[data-pack="langues"]    { --acc: #C5344D; --acc-soft: #FBEAEE; }
.pack-card[data-pack="sciences"]   { --acc: #2B4C7E; --acc-soft: #E9EFF7; }
.pack-card[data-pack="asie"]       { --acc: #B4532A; --acc-soft: #F8ECE5; }
.pack-card[data-pack="custom"]     { --acc: #791998; --acc-soft: #F4E9F7; }

.pack-head {
    position: relative;
    padding: 18px 18px 10px;
    border-top: 4px solid var(--acc);
    overflow: hidden;
}
.pack-ghost {
    position: absolute; right: 2px; top: -14px;
    font-size: 76px; font-weight: 900; line-height: 1;
    color: var(--acc);
    opacity: 0.07;
    pointer-events: none; user-select: none;
}
.pack-kicker {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--acc);
    background: var(--acc-soft);
    padding: 4px 10px; border-radius: 999px; margin-bottom: 9px;
}
.pack-kicker svg { width: 12px; height: 12px; }
.pack-name {
    font-family: 'Bricolage Grotesque', 'Outfit', sans-serif;
    font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
    color: #1E293B; position: relative;
}
.pack-fiches { font-size: 12px; font-weight: 600; color: #64748B; position: relative; margin-top: 2px; }

/* Petit drapeau merchandising (ex. « Le plus choisi » sur Sciences) */
.pack-flag {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    background: var(--acc); color: #fff;
    font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px;
}

.pack-body { display: flex; flex-direction: column; gap: 12px; padding: 12px 18px 18px; flex: 1; }
.pack-subjects { display: flex; flex-wrap: wrap; gap: 6px; }
.pack-subject {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 700; color: #334155;
    background: #F8FAFC; border: 1px solid #E2E8F0;
    padding: 4px 10px; border-radius: 999px;
}
.pack-subject svg { width: 11px; height: 11px; color: var(--acc, #2B5B44); }

.pack-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.pack-price { font-size: 27px; font-weight: 900; color: #0F172A; letter-spacing: -0.02em; }
.pack-price-note { font-size: 11px; font-weight: 700; color: #94A3B8; }
.pack-price-free { font-size: 23px; font-weight: 900; color: #2B5B44; }

.pack-buy-btn, .pack-free-btn, .pack-custom-toggle-btn {
    width: 100%;
    border: none; cursor: pointer;
    border-radius: 13px; padding: 12px 14px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 14px; font-weight: 800; color: #fff;
    background: var(--acc);
    box-shadow: 0 3px 0 color-mix(in srgb, var(--acc) 70%, #000);
    transition: transform 0.1s ease, filter 0.1s ease, box-shadow 0.1s ease;
}
.pack-buy-btn:hover:not(:disabled), .pack-free-btn:hover, .pack-custom-toggle-btn:hover { filter: brightness(1.08); }
.pack-buy-btn:active:not(:disabled), .pack-free-btn:active, .pack-custom-toggle-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--acc) 70%, #000);
}
.pack-buy-btn:disabled {
    cursor: default; color: #64748B;
    background: #F1F5F9; box-shadow: none;
}

.pack-card.is-owned { border-color: #569E60; }
.pack-card.is-owned::after {
    content: 'À toi';
    position: absolute; top: 12px; right: 12px; z-index: 3;
    background: #2B5B44; color: #fff;
    font-size: 10px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px;
}
.pack-card.is-owned .pack-flag { display: none; }

/* ── Titre : surligneur « marqueur » au lieu du jaune sur rose ── */
.pw-hl {
    background: #FFE9A8;
    padding: 0 10px;
    border-radius: 8px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* ── « Comment ça marche » : 3 étapes sobres ── */
.pack-steps {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px;
    margin: 0 auto 30px;
    font-family: 'Outfit', system-ui, sans-serif;
}
.pack-step { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #475569; }
.pack-step b { color: #1E293B; font-weight: 800; }
.pack-step-n {
    width: 22px; height: 22px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 999px;
    background: #1E293B; color: #fff;
    font-size: 11px; font-weight: 900;
}

/* ── Sélecteur sur mesure ── */
#pack-custom-picker { border-top: 1.5px dashed #E2E8F0; padding-top: 12px; }
#pack-custom-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pack-chip {
    border: 1.5px solid #E2E8F0; background: #fff; cursor: pointer;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 11.5px; font-weight: 700; color: #334155;
    padding: 6px 11px; border-radius: 999px;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.pack-chip:hover:not([disabled]) { border-color: #791998; color: #791998; }
.pack-chip.is-selected {
    background: #791998;
    border-color: #791998; color: #fff;
}
.pack-chip.is-owned, .pack-chip[disabled] { opacity: 0.45; cursor: default; }
.pack-custom-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#pack-custom-count { font-size: 12px; font-weight: 900; color: #791998; }

/* ── Badges paiement ── */
.pack-pay-badges { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pack-pay-twint {
    display: inline-flex; align-items: center;
    background: #000; color: #fff;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 11px; font-weight: 900; letter-spacing: 0.12em;
    padding: 4px 12px; border-radius: 7px;
}

/* ── Boutons fermer / compte sur fond blanc ── */
#paywall-close {
    position: absolute; top: 16px; left: 16px; z-index: 20;
    width: 44px; height: 44px; border: 1.5px solid #E2E8F0; cursor: pointer;
    border-radius: 999px; background: #fff;
    color: #64748B; display: grid; place-items: center;
    transition: border-color 0.15s ease, color 0.15s ease;
}
#paywall-close:hover { border-color: #C5344D; color: #C5344D; }
#paywall-close svg { width: 20px; height: 20px; }

/* ── Toast ── */
#mk-pack-toast {
    position: fixed; left: 50%; bottom: 18px;
    transform: translateX(-50%) translateY(150%);
    z-index: 99999; max-width: 92vw; width: 460px;
    background: #0F172A; color: #fff;
    border-radius: 15px; padding: 13px 16px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 13px; line-height: 1.4;
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), opacity 0.35s;
}
#mk-pack-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#mk-pack-toast.is-ok { background: #2B5B44; }
#mk-pack-toast strong { color: #FFE9A8; }

/* ── Pastille pack dans les en-têtes de sections de la grille ── */
.yt-pack-chip {
    display: inline-flex; align-items: center; gap: 5px;
    border: none; cursor: pointer;
    margin-top: 7px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em;
    padding: 4px 11px; border-radius: 999px;
    background: #0F172A; color: #fff;
    box-shadow: 0 2px 0 rgba(15, 23, 42, 0.35);
    transition: transform 0.12s ease, filter 0.12s ease;
    white-space: nowrap;
}
.yt-pack-chip:hover { transform: translateY(-1px); filter: brightness(1.15); }
.yt-pack-chip svg { width: 11px; height: 11px; flex: 0 0 auto; }
.yt-pack-chip.is-owned { background: #2B5B44; cursor: default; }
.yt-pack-chip.is-owned:hover { transform: none; filter: none; }
.yt-pack-chip.is-free { background: #0D9488; }

/* CTA tripacks dans le hero de la grille */
.packs-cta {
    margin-top: 20px;
    margin-left: 8px;
    background: #0f172a !important;
    color: #fff !important;
    border-color: transparent !important;
}
