/* ── WP Download Manager — Liste de téléchargements ─────────────────────── */

.wpdm-empty {
    color: #64748b;
    font-style: italic;
    padding: 16px 0;
}

/* ── Liste ───────────────────────────────────────────────────────────────── */
.wpdm-list {
    display: flex;
    flex-direction: column;
    margin: 24px 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ── Ligne ───────────────────────────────────────────────────────────────── */
.wpdm-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}
.wpdm-item:last-child  { border-bottom: none; }
.wpdm-item:hover       { background: #f8fafc; }

/* ── Icône ───────────────────────────────────────────────────────────────── */
.wpdm-item__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.wpdm-item__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.wpdm-item__icon svg {
    width: 24px;
    height: 24px;
    color: #94a3b8;
}

/* ── Corps : titre + description ─────────────────────────────────────────── */
.wpdm-item__body {
    flex: 1;
    min-width: 0;
}
.wpdm-item__title {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.3;
}
.wpdm-item__desc {
    display: block;
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.5;
}

/* ── Méta : badge + version + taille + compteur ──────────────────────────── */
.wpdm-item__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wpdm-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}
.wpdm-item__version {
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    white-space: nowrap;
}
.wpdm-item__size {
    font-size: 12px;
    font-weight: 600;
    color: #0369a1;
    white-space: nowrap;
}
.wpdm-item__count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    white-space: nowrap;
}
.wpdm-item__count svg { flex-shrink: 0; }

/* ── Bouton télécharger ──────────────────────────────────────────────────── */
.wpdm-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #2563eb;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
}
.wpdm-btn svg      { width: 14px; height: 14px; flex-shrink: 0; }
.wpdm-btn:hover    { background: #1d4ed8; transform: translateY(-1px); }
.wpdm-btn:active   { transform: translateY(0); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .wpdm-item__count { display: none; }
    .wpdm-item__meta  { gap: 8px; }
}
@media (max-width: 520px) {
    .wpdm-item        { gap: 12px; padding: 12px 16px; }
    .wpdm-item__meta  { display: none; }
    .wpdm-btn         { padding: 9px 12px; }
}

/* ── Modale « téléchargement sous condition » ────────────────────────────── */
/* CSS défensif : !important sur la mise en page. La modale est rendue hors
   du contenu de l'article, donc à l'abri des styles du thème. */
.wpdm-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    margin: 0 !important;
}
.wpdm-modal[hidden] { display: none !important; }
.wpdm-modal * { box-sizing: border-box !important; }

.wpdm-modal__overlay {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.55) !important;
}

.wpdm-modal__dialog {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    max-width: 460px !important;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: 0 !important;
    padding: 28px 26px 24px !important;
    background: #fff !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35) !important;
}

.wpdm-modal__close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 8px !important;
    background: #f1f5f9 !important;
    color: #64748b !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
}
.wpdm-modal__close:hover { background: #e2e8f0 !important; }

.wpdm-modal__head {
    margin: 0 0 20px !important;
    text-align: center;
}
.wpdm-modal__lock {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    margin: 0 0 12px !important;
    border-radius: 50%;
    background: #eff6ff;
}
.wpdm-modal__lock svg { width: 22px !important; height: 22px !important; color: #2563eb; }
.wpdm-modal__title {
    margin: 0 0 6px !important;
    padding: 0 !important;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1e293b;
}
.wpdm-modal__intro {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #64748b;
}

.wpdm-modal__form { margin: 0 !important; padding: 0 !important; }

.wpdm-modal .wpdm-field { margin: 0 0 14px !important; padding: 0 !important; }
.wpdm-modal .wpdm-field label {
    display: block !important;
    margin: 0 0 5px !important;
    padding: 0 !important;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
}
.wpdm-modal .wpdm-field input {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 0.9rem;
    line-height: 1.4;
    background: #fff;
    color: #1e293b;
}
.wpdm-modal .wpdm-field input:focus {
    outline: none;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.wpdm-modal .wpdm-consent {
    display: flex !important;
    gap: 9px;
    align-items: flex-start;
    margin: 16px 0 !important;
    padding: 0 !important;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #64748b;
}
.wpdm-modal .wpdm-consent input {
    width: auto !important;
    margin: 2px 0 0 !important;
    flex-shrink: 0;
}
.wpdm-modal .wpdm-consent a { color: #2563eb; }

.wpdm-modal__submit {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100% !important;
    margin: 0 !important;
    padding: 13px !important;
    background: #2563eb !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
    text-shadow: none;
    cursor: pointer;
}
.wpdm-modal__submit svg { width: 16px !important; height: 16px !important; flex-shrink: 0; }
.wpdm-modal__submit:hover:not(:disabled) { background: #1d4ed8 !important; }
.wpdm-modal__submit:disabled { opacity: 0.65; cursor: default; }

.wpdm-modal__note {
    margin: 12px 0 0 !important;
    padding: 0 !important;
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
}
.wpdm-modal__error {
    margin: 12px 0 0 !important;
    padding: 9px 12px !important;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #b91c1c;
}
.wpdm-modal__error[hidden] { display: none !important; }

/* Pot de miel anti-spam — invisible pour l'utilisateur */
.wpdm-modal .wpdm-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Confirmation après envoi (remplace le formulaire) */
.wpdm-modal__success {
    padding: 8px 0 !important;
    text-align: center;
}
.wpdm-modal__success-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px !important;
    height: 48px !important;
    margin: 0 0 12px !important;
    border-radius: 50%;
    background: #dcfce7;
}
.wpdm-modal__success-icon svg { width: 26px !important; height: 26px !important; color: #059669; }
.wpdm-modal__success h3 {
    margin: 0 0 6px !important;
    padding: 0 !important;
    font-size: 1.1rem;
    color: #1e293b;
}
.wpdm-modal__success p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #64748b;
}

/* Bloque le défilement de la page quand une modale est ouverte */
body.wpdm-modal-open { overflow: hidden !important; }
