/**
 * ═══════════════════════════════════════════════════════════
 * 🖼️ INTÉGRATION IMAGES PROFESSIONNELLES
 * Utilisation optimale des images du dossier assets/img
 * ═══════════════════════════════════════════════════════════
 */

/* ─────────────────────────────────────────────────────────── */
/* HERO SECTIONS AVEC IMAGES DE FOND - TOUTES LES PAGES       */
/* ─────────────────────────────────────────────────────────── */

/* Styles communs pour tous les hero */
.hero,
[class*="hero-"],
section.hero {
    position: relative !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: scroll !important;
    min-height: unset !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Réduire la grille interne des héros pour compacité */
.hero .hero-grid,
[class*="hero-"] .hero-grid,
section.hero .hero-grid {
    min-height: unset !important;
    max-height: none !important;
    padding: 20px 0 !important;
}

/* Éviter les hauteurs fixes des images/illustrations de héros */
.hero .hero-image,
[class*="hero-"] .hero-image,
section.hero .hero-image {
    height: auto !important;
    max-height: none !important;
}

/* Compacter toutes les sections hero (même dimensions que contact.html) */
.hero,
[class*="hero-"],
section.hero {
    padding: 40px 0 !important;
}

.hero::before,
[class*="hero-"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

/* Couches: overlay sous le contenu, badge au-dessus */
.hero .hero-overlay,
[class*="hero-"] .hero-overlay,
section.hero .hero-overlay {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
}

.hero .hero-content,
[class*="hero-"] .hero-content,
section.hero .hero-content {
    position: relative !important;
    z-index: 2 !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.hero>*,
[class*="hero-"]>* {
    position: relative;
    z-index: 1;
}

/* Center hero actions and stats */
.hero .hero-actions,
[class*="hero-"] .hero-actions,
section.hero .hero-actions {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
}

.hero .hero-cta,
[class*="hero-"] .hero-cta,
section.hero .hero-cta {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
}

.hero .hero-stats,
.hero .hero-stats-inline,
[class*="hero-"] .hero-stats,
[class*="hero-"] .hero-stats-inline,
section.hero .hero-stats,
section.hero .hero-stats-inline {
    display: flex !important;
    justify-content: center !important;
}

/* Hero badge - pas d'étirement - FORCÉ */
.hero-badge,
.hero .hero-badge,
[class*="hero-"] .hero-badge,
span.hero-badge,
div .hero-badge {
    display: inline-block !important;
    white-space: nowrap !important;
    width: auto !important;
    max-width: fit-content !important;
    flex-shrink: 0 !important;
    min-width: unset !important;
    flex-grow: 0 !important;
    align-self: center !important;
    position: relative !important;
    z-index: 3 !important;
}

/* Responsive: réduire davantage sur tablettes et mobiles */
@media (max-width: 992px) {

    .hero,
    [class*="hero-"],
    section.hero {
        min-height: unset !important;
        padding: 70px 0 !important;
    }
}

@media (max-width: 640px) {

    .hero,
    [class*="hero-"],
    section.hero {
        min-height: unset !important;
        padding: 60px 0 !important;
    }
}

/* Textes sur hero TOUJOURS BLANCS et VISIBLES */
.hero *,
[class*="hero-"] *,
.hero-content *,
section.hero * {
    color: #ffffff;
}

.hero h1,
.hero h2,
.hero h3,
.hero p,
[class*="hero-"] h1,
[class*="hero-"] h2,
[class*="hero-"] h3,
[class*="hero-"] p {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

/* Page d'accueil - Business moderne */
.hero-home,
.hero.hero-home,
body.page-index .hero {
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.80) 0%, rgba(118, 75, 162, 0.80) 100%),
        url('../img/business-8577380_1280.jpg') !important;
}

/* Page crédit personnel - Équipe professionnelle */
.hero-credit-personnel,
body.page-credit-personnel .hero {
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.80) 0%, rgba(118, 75, 162, 0.80) 100%),
        url('../img/team.jpg') !important;
}

/* Page crédit auto - Financement automobile */
.hero-credit-auto,
body.page-credit-auto .hero {
    background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.80) 0%, rgba(5, 150, 105, 0.80) 100%),
        url('../img/auto-financing.html') !important;
}

/* Page crédit immobilier - Accession propriété */
.hero-credit-immobilier,
body.page-credit-immobilier .hero {
    background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.80) 0%, rgba(37, 99, 235, 0.80) 100%),
        url('../img/home-ownership.jpg') !important;
}

/* Page assurances */
.hero-assurances,
body.page-assurances .hero {
    background-image: linear-gradient(135deg, rgba(139, 92, 246, 0.80) 0%, rgba(124, 58, 237, 0.80) 100%),
        url('../img/insurance-(Petite.html).png') !important;
}

/* Page emploi / carrières */
.hero-emploi,
.hero-careers,
body.page-emploi .hero {
    background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.80) 0%, rgba(217, 119, 6, 0.80) 100%),
        url('../img/job.html') !important;
}

/* Page à propos / équipe */
.hero-about,
.hero-equipe,
body.page-about .hero {
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.80) 0%, rgba(118, 75, 162, 0.80) 100%),
        url('../img/meeting.jpg') !important;
}

/* Page services bancaires */
.hero-services,
body.page-services .hero {
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.80) 0%, rgba(79, 70, 229, 0.80) 100%),
        url('../img/photobank.jpg') !important;
}

/* Page paiements électroniques */
.hero-paiements,
body.page-paiements .hero {
    background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.80) 0%, rgba(5, 150, 105, 0.80) 100%),
        url('../img/electronic-payments.jpg') !important;
}

/* Page cartes bancaires */
.hero-cartes,
body.page-cartes .hero {
    background-image: linear-gradient(135deg, rgba(239, 68, 68, 0.80) 0%, rgba(220, 38, 38, 0.80) 100%),
        url('../img/carte-credit.png') !important;
}

/* Page investissements */
.hero-investissements,
body.page-investissements .hero {
    background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.80) 0%, rgba(217, 119, 6, 0.80) 100%),
        url('../img/ai-generated-9116708_1280.jpg') !important;
}

/* Page entreprise / business */
.hero-entreprise,
body.page-entreprise .hero {
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.80) 0%, rgba(79, 70, 229, 0.80) 100%),
        url('../img/photobank.jpg') !important;
}

/* Page crédit travaux - Maison */
.hero-credit-travaux {
    background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.85) 0%, rgba(217, 119, 6, 0.85) 100%),
        url('../img/home-ownership.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Page investissements - Finance AI */
.hero-investments {
    background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.85) 0%, rgba(37, 99, 235, 0.85) 100%),
        url('../img/ai-generated-9116708_1280.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Page qui sommes-nous */
.hero-about {
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%),
        url('../img/employees-885338_1280.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* ─────────────────────────────────────────────────────────── */
/* SECTIONS AVEC IMAGES D'ILLUSTRATION                        */
/* ─────────────────────────────────────────────────────────── */

/* Section cartes bancaires */
.section-cards {
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95)),
        url('../img/carte-credit.png');
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;
}

/* Section assurance */
.section-insurance {
    background-image: url('../img/insurance-(Petite.html).png');
    background-size: 40%;
    background-position: right bottom;
    background-repeat: no-repeat;
}

/* Section paiements électroniques */
.section-payments {
    background-image: url('../img/electronic-payments.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
}

.section-payments::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
}

/* ─────────────────────────────────────────────────────────── */
/* IMAGES DANS LES CARDS                                      */
/* ─────────────────────────────────────────────────────────── */

.service-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

/* Image carte crédit */
.img-credit-card {
    background-image: url('../img/carte-credit.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 200px;
}

/* Image business */
.img-business {
    background-image: url('../img/business.png');
    background-size: cover;
    background-position: center;
}

/* Image meeting */
.img-meeting {
    background-image: url('../img/meeting.jpg');
    background-size: cover;
    background-position: center;
}

/* Image job */
.img-job {
    background-image: url('../img/job.html');
    background-size: cover;
    background-position: center;
}

/* Image photobank */
.img-bank {
    background-image: url('../img/photobank.jpg');
    background-size: cover;
    background-position: center;
}

/* ─────────────────────────────────────────────────────────── */
/* OPTIMISATIONS IMAGES                                        */
/* ─────────────────────────────────────────────────────────── */

/* Lazy loading pour meilleures performances */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Responsive images */
@media (max-width: 768px) {

    .hero-home,
    .hero-credit-personnel,
    .hero-credit-auto,
    .hero-credit-travaux,
    .hero-investments,
    .hero-about {
        background-attachment: scroll !important;
        background-size: cover !important;
    }

    .section-cards,
    .section-insurance {
        background-size: 80%;
        background-position: center bottom;
    }
}

/* ─────────────────────────────────────────────────────────── */
/* OVERLAYS POUR MEILLEURE LISIBILITÉ                         */
/* ─────────────────────────────────────────────────────────── */

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    z-index: 1;
}

.hero>* {
    position: relative;
    z-index: 2;
}

/* ─────────────────────────────────────────────────────────── */
/* ANIMATIONS IMAGES                                           */
/* ─────────────────────────────────────────────────────────── */

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: scale(1.1);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-home,
.hero-credit-personnel {
    animation: fadeInImage 1s ease-out;
}

/* ─────────────────────────────────────────────────────────── */
/* FALLBACKS                                                   */
/* ─────────────────────────────────────────────────────────── */

/* Si l'image ne charge pas, garder le gradient (sans !important pour ne pas écraser les mappings spécifiques) */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}