/* Eco Home Configurator - Stable v2.9.2 */

/* Button Text Strategy: Keep it simple and safe */
button.ehc-force-sync {
    position: relative !important;
    color: transparent !important;
}

button.ehc-force-sync::after {
    content: "Recevoir les détails par mail";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    font-size: initial;
    font-weight: 600;
    pointer-events: none;
}

/* Localized SEO style reset */
.ehc-heading-replacement {
    display: block;
    margin-block-start: 1em;
    margin-block-end: 1em;
    font-weight: bold;
}

#eco-home-configurator-widget {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

#eco-home-configurator-widget img {
    object-fit: cover !important;
}

/* Fix: modal overlay doit passer au-dessus du header fixe (z-index: 1000) */
#eco-home-configurator-widget .z-50 {
    z-index: 1001 !important;
}

/* ── MOBILE RESPONSIVE FIXES ─────────────────────────────────────────────── */

/* 1. Barre sticky : coller sous le header du thème, pas derrière */
#eco-home-configurator-widget .sticky {
    top: var(--header-h) !important;
}

/* 2. Modal overlay : scrollable verticalement */
#eco-home-configurator-widget .fixed.inset-0 {
    overflow-y: auto !important;
}

/* 3. Modal card : max-height pour ne pas dépasser l'écran */
#eco-home-configurator-widget .max-w-3xl {
    max-height: calc(100dvh - var(--header-h) - 2rem);
    overflow-y: auto;
}

@media (max-width: 768px) {
    /* Modal aligné en haut sur mobile (pas centré, trop long) */
    #eco-home-configurator-widget .fixed.inset-0 {
        align-items: flex-start !important;
        padding-top: calc(var(--header-h) + 8px) !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-bottom: 8px !important;
    }

    /* Modal card : pleine hauteur disponible sur mobile */
    #eco-home-configurator-widget .max-w-3xl {
        max-height: calc(100dvh - var(--header-h) - 16px);
        width: 100% !important;
        border-radius: 16px;
    }

    /* Grille : 1 colonne sur petits écrans */
    #eco-home-configurator-widget .grid {
        grid-template-columns: 1fr !important;
    }

    /* Filtre finition : s'assurer qu'il scroll horizontalement */
    #eco-home-configurator-widget .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #eco-home-configurator-widget .overflow-x-auto::-webkit-scrollbar {
        display: none;
    }
}