/* ============================================================
   EriFaye TV PATCH V5.7
   - Fix lien Retour aux formules sur /subscription_intent
   - Catalogue : recherche compacte, gros bloc recherche masqué
   - Catalogue : réduction margin title/subtitle -> contenu
   ============================================================ */

:root {
    --ef-v57-red: #f20c18;
    --ef-v57-red-dark: #bb0710;
    --ef-v57-bg: #070910;
    --ef-v57-card: rgba(255,255,255,0.055);
    --ef-v57-border: rgba(255,255,255,0.14);
    --ef-v57-text: #ffffff;
    --ef-v57-muted: rgba(255,255,255,0.74);
}

/* Le bloc de recherche original du catalogue reste dans le DOM pour garder la logique existante,
   mais il n'est plus affiché. */
body.ef-v57-catalog-page .ef-v57-hidden-original-search {
    display: none !important;
}

body.ef-v57-catalog-page .ef-v57-catalog-search {
    width: min(100%, 1180px);
    margin: 0 auto 16px auto;
    padding: 0 15px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 4;
}

body.ef-v57-catalog-page .ef-v57-catalog-search-toggle {
    min-height: 42px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #ffffff !important;
    padding: 9px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

body.ef-v57-catalog-page .ef-v57-catalog-search-toggle:hover,
body.ef-v57-catalog-page .ef-v57-catalog-search-toggle:focus {
    background: rgba(242,12,24,0.13);
    border-color: rgba(242,12,24,0.65);
    box-shadow: 0 0 0 4px rgba(242,12,24,0.13);
    color: #ffffff !important;
    outline: none;
    transform: translateY(-1px);
}

body.ef-v57-catalog-page .ef-v57-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #ffffff !important;
    font-size: 18px;
    line-height: 1;
}

body.ef-v57-catalog-page .ef-v57-search-label {
    color: #ffffff !important;
}

body.ef-v57-catalog-page .ef-v57-catalog-search-input {
    width: 0;
    min-width: 0;
    max-width: min(330px, calc(100vw - 96px));
    height: 42px;
    border: 1px solid rgba(255,255,255,0.0);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #ffffff !important;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    outline: none;
    transition: width 0.22s ease, opacity 0.18s ease, padding 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

body.ef-v57-catalog-page .ef-v57-catalog-search-input::placeholder {
    color: rgba(255,255,255,0.64) !important;
}

body.ef-v57-catalog-page .ef-v57-catalog-search.is-open .ef-v57-catalog-search-input {
    width: min(330px, calc(100vw - 96px));
    padding: 0 16px;
    opacity: 1;
    pointer-events: auto;
    border-color: rgba(255,255,255,0.18);
}

body.ef-v57-catalog-page .ef-v57-catalog-search.is-open .ef-v57-catalog-search-input:focus {
    border-color: rgba(242,12,24,0.70);
    box-shadow: 0 0 0 4px rgba(242,12,24,0.12);
}

/* Réduction nette du vide entre le title/subtitle et le bloc catalogue. */
body.ef-v57-catalog-page .ef-page-title,
body.ef-v57-catalog-page .ef-page-header,
body.ef-v57-catalog-page .ef-hero-mini,
body.ef-v57-catalog-page .page-title,
body.ef-v57-catalog-page .page-title-area,
body.ef-v57-catalog-page .page-header,
body.ef-v57-catalog-page .inner-banner,
body.ef-v57-catalog-page .breadcrumb-area,
body.ef-v57-catalog-page .pq-breadcrumb,
body.ef-v57-catalog-page section[class*="breadcrumb" i],
body.ef-v57-catalog-page section[class*="page-title" i] {
    margin-bottom: 8px !important;
    padding-bottom: 14px !important;
    min-height: 0 !important;
}

body.ef-v57-catalog-page .ef-page-title + section,
body.ef-v57-catalog-page .ef-page-header + section,
body.ef-v57-catalog-page .ef-hero-mini + section,
body.ef-v57-catalog-page .page-title + section,
body.ef-v57-catalog-page .page-title-area + section,
body.ef-v57-catalog-page .page-header + section,
body.ef-v57-catalog-page .inner-banner + section,
body.ef-v57-catalog-page .breadcrumb-area + section,
body.ef-v57-catalog-page .pq-breadcrumb + section {
    margin-top: 0 !important;
    padding-top: 8px !important;
}

body.ef-v57-catalog-page section[class*="catalog" i],
body.ef-v57-catalog-page section[class*="movie" i],
body.ef-v57-catalog-page section[class*="video" i],
body.ef-v57-catalog-page section[class*="portfolio" i],
body.ef-v57-catalog-page .catalog,
body.ef-v57-catalog-page .catalogue,
body.ef-v57-catalog-page .movie,
body.ef-v57-catalog-page .videos,
body.ef-v57-catalog-page .pq-movie,
body.ef-v57-catalog-page .pq-movies {
    padding-top: 8px !important;
    margin-top: 0 !important;
}

/* Sécurité : éviter les gros boutons qui débordent encore sur mobile. */
@media (max-width: 767.98px) {
    body.ef-v57-catalog-page .ef-v57-catalog-search {
        justify-content: flex-end;
        margin-bottom: 10px;
        padding-left: 12px;
        padding-right: 12px;
    }

    body.ef-v57-catalog-page .ef-v57-catalog-search-toggle {
        min-height: 39px;
        padding: 8px 12px;
        font-size: 13px;
    }

    body.ef-v57-catalog-page .ef-v57-catalog-search.is-open {
        justify-content: space-between;
    }

    body.ef-v57-catalog-page .ef-v57-catalog-search.is-open .ef-v57-catalog-search-input {
        width: min(100%, calc(100vw - 92px));
        max-width: calc(100vw - 92px);
    }

    body.ef-v57-catalog-page .ef-page-title,
    body.ef-v57-catalog-page .ef-page-header,
    body.ef-v57-catalog-page .ef-hero-mini,
    body.ef-v57-catalog-page .page-title,
    body.ef-v57-catalog-page .page-title-area,
    body.ef-v57-catalog-page .page-header,
    body.ef-v57-catalog-page .inner-banner,
    body.ef-v57-catalog-page .breadcrumb-area,
    body.ef-v57-catalog-page .pq-breadcrumb,
    body.ef-v57-catalog-page section[class*="breadcrumb" i],
    body.ef-v57-catalog-page section[class*="page-title" i] {
        margin-bottom: 4px !important;
        padding-top: 20px !important;
        padding-bottom: 8px !important;
    }

    body.ef-v57-catalog-page .ef-page-title + section,
    body.ef-v57-catalog-page .ef-page-header + section,
    body.ef-v57-catalog-page .ef-hero-mini + section,
    body.ef-v57-catalog-page .page-title + section,
    body.ef-v57-catalog-page .page-title-area + section,
    body.ef-v57-catalog-page .page-header + section,
    body.ef-v57-catalog-page .inner-banner + section,
    body.ef-v57-catalog-page .breadcrumb-area + section,
    body.ef-v57-catalog-page .pq-breadcrumb + section {
        padding-top: 4px !important;
    }
}
