/* ════════════════════════════════════════════════════════════════════════
   Espace Pro Tire-Lait Express — Page Brochures PDF
   Cohérent avec espace_sf_form.css (mêmes tokens + Fraunces/Manrope).
   ════════════════════════════════════════════════════════════════════════ */

.esf-brochures-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 24px 80px;
}

/* ── Grille de cartes ───────────────────────────────────────────────────── */
.esf-brochures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ── Carte brochure ─────────────────────────────────────────────────────── */
.esf-brochure-card {
    background: var(--paper, #fff);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 14px 38px rgba(31, 96, 151, 0.10),
        0 2px 8px rgba(31, 96, 151, 0.04),
        0 0 0 1px rgba(31, 34, 56, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.esf-brochure-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 22px 50px rgba(31, 96, 151, 0.16),
        0 4px 14px rgba(31, 96, 151, 0.06),
        0 0 0 1px rgba(52, 134, 199, 0.10);
}

/* Aperçu / vignette ──────────────────────────────────────────────────── */
.esf-brochure-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #DDEBF6 0%, #F8F4ED 60%, #FCE7BB 100%);
    aspect-ratio: 4 / 3;
    text-decoration: none;
    transition: filter 0.2s ease;
}
.esf-brochure-preview:hover {
    filter: brightness(1.03);
}
.esf-brochure-thumb {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    background: white;
    color: #1f6097;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 18px 38px rgba(31, 96, 151, 0.25),
        0 2px 8px rgba(31, 96, 151, 0.10);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.esf-brochure-card:hover .esf-brochure-thumb {
    transform: rotate(-3deg) scale(1.04);
}
.esf-brochure-thumb svg {
    width: 56px;
    height: 56px;
}
.esf-brochure-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #E8A212 0%, #C5860A 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: 0 6px 16px -4px rgba(232, 162, 18, 0.5);
}

/* Corps de carte ─────────────────────────────────────────────────────── */
.esf-brochure-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.esf-brochure-name {
    font-family: 'Fraunces', Georgia, serif;
    font-variation-settings: 'opsz' 60;
    font-size: 19px;
    font-weight: 500;
    color: #1B2238;
    line-height: 1.25;
    letter-spacing: -0.2px;
    margin: 0;
}
.esf-brochure-desc {
    color: #4A526A;
    font-size: 13.5px;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

/* Boutons ─────────────────────────────────────────────────────────────── */
.esf-brochure-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.esf-brochure-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    border-radius: 12px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: all 0.18s ease;
}
.esf-brochure-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.esf-brochure-btn-primary {
    background: linear-gradient(135deg, #3486C7 0%, #1f6097 100%);
    color: white;
    box-shadow: 0 6px 16px -4px rgba(31, 96, 151, 0.4);
}
.esf-brochure-btn-primary:hover {
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
    box-shadow: 0 10px 22px -4px rgba(31, 96, 151, 0.5);
}
.esf-brochure-btn-secondary {
    background: white;
    color: #1f6097;
    border: 1.5px solid #DDEBF6;
}
.esf-brochure-btn-secondary:hover {
    border-color: #3486C7;
    color: #1f6097;
    text-decoration: none;
    background: #F8FBFF;
}

/* ── État vide ──────────────────────────────────────────────────────────── */
.esf-brochures-empty {
    background: white;
    border-radius: 24px;
    padding: 64px 32px;
    text-align: center;
    box-shadow:
        0 12px 32px rgba(31, 96, 151, 0.08),
        0 2px 8px rgba(31, 96, 151, 0.04);
    max-width: 560px;
    margin: 0 auto;
}
.esf-brochures-empty-icon {
    font-size: 56px;
    margin-bottom: 18px;
    line-height: 1;
}
.esf-brochures-empty h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-variation-settings: 'opsz' 60;
    font-size: 24px;
    font-weight: 500;
    color: #1B2238;
    margin: 0 0 12px;
    letter-spacing: -0.3px;
}
.esf-brochures-empty p {
    color: #4A526A;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 28px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 28px;
}

/* ── Modale d'aperçu PDF ────────────────────────────────────────────────── */
.esf-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
}
.esf-pdf-modal.is-open {
    display: flex;
    animation: esf-pdf-fade 0.18s ease-out;
}
.esf-pdf-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 34, 54, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}
.esf-pdf-card {
    position: relative;
    z-index: 1;
    background: #1B2238;
    color: white;
    border-radius: 20px;
    width: min(1100px, 100%);
    height: min(92vh, 1200px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.3);
    animation: esf-pdf-pop 0.25s cubic-bezier(.4,0,.2,1);
}

/* Header de la modale */
.esf-pdf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 22px;
    background: linear-gradient(135deg, #1B2238 0%, #1f6097 140%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.esf-pdf-title {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-variation-settings: 'opsz' 60;
    font-size: 18px;
    font-weight: 500;
    color: white;
    letter-spacing: -0.2px;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.esf-pdf-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Bouton télécharger dans le header */
.esf-pdf-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #E8A212 0%, #C5860A 100%);
    color: white;
    border-radius: 999px;
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: all 0.18s ease;
    box-shadow: 0 6px 16px -4px rgba(232, 162, 18, 0.5);
}
.esf-pdf-download:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -4px rgba(232, 162, 18, 0.6);
}
.esf-pdf-download svg {
    width: 14px;
    height: 14px;
}

/* Bouton fermer */
.esf-pdf-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    border: 0;
    cursor: pointer;
    padding: 0;
    transition: all 0.18s ease;
}
.esf-pdf-close:hover {
    background: rgba(255,255,255,0.18);
    color: white;
    transform: scale(1.05);
}
.esf-pdf-close svg {
    width: 18px;
    height: 18px;
}

/* L'iframe qui rend le PDF */
.esf-pdf-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: #2a3247;
    display: block;
}

@keyframes esf-pdf-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes esf-pdf-pop {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Responsive modale */
@media (max-width: 720px) {
    .esf-pdf-modal { padding: 0; }
    .esf-pdf-card {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .esf-pdf-head { padding: 12px 14px; }
    .esf-pdf-title { font-size: 15px; }
    .esf-pdf-download {
        padding: 8px 12px;
        font-size: 12px;
    }
    .esf-pdf-download span { display: none; }
    .esf-pdf-close {
        width: 34px;
        height: 34px;
    }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .esf-brochures-main {
        padding: 20px 16px 60px;
    }
    .esf-brochures-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .esf-brochure-thumb {
        width: 80px;
        height: 80px;
    }
    .esf-brochure-thumb svg {
        width: 44px;
        height: 44px;
    }
    .esf-brochure-actions {
        flex-direction: column;
    }
    .esf-brochure-btn {
        flex: none;
        width: 100%;
    }
    .esf-brochures-empty {
        padding: 48px 22px;
    }
}
