/* ============================================================
   Hover Card Grid Widget
   ============================================================ */

.bihc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.bihc-card {
    position: relative;
    height: 138px;
    border-radius: 20px;
    transition: box-shadow 0.25s;
}

.bihc-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.bihc-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ── Card faces ──────────────────────────────────────────── */
.bihc-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-color: #FFFFFF;
    border-radius: 20px;
    padding: 24px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bihc-face-front {
    padding-right: 60px;
    padding-bottom: 26px;
    opacity: 1;
    pointer-events: auto;
}

.bihc-card:hover .bihc-face-front {
    opacity: 0;
    pointer-events: none;
}

.bihc-card:hover .bihc-face-back {
    opacity: 1;
    pointer-events: auto;
}

/* ── Default state: icon ─────────────────────────────────── */
.bihc-default {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.bihc-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    
    border-radius: 50%;
    background-color: none;
}

.bihc-icon-wrap i,
.bihc-icon-wrap svg {
    font-size: 18px;
   width: 40px;
    height: 40px;
    min-width: 40px;
}

.bihc-arrow-circle {
    position: absolute;
    right: 24px;
    bottom: 24px;
    line-height: 0;
}

/* ── Title ───────────────────────────────────────────────── */
.bihc-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 130%;
    letter-spacing: -0.5px;
    color: #111111;
}

/* ── Back face: Know More + Get Quote ───────────────────── */
.bihc-hover-row {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    margin-top: 14px;
}

.bihc-know-more {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 130%;
    letter-spacing: -0.5px;
    color: #0485A9;
    text-decoration: underline !important;
    text-decoration-style: solid;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.bihc-get-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #0485A9;
    border-radius: 30px;
    padding: 10px 18px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.bihc-get-quote span {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 100%;
    letter-spacing: -0.5px;
    color: #FFFFFF;
}

.bihc-cta-arrow {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.bihc-get-quote:hover .bihc-cta-arrow {
    transform: translateX(3px);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    /* !important: an Elementor instance's own per-widget CSS sets this
       column count unconditionally (no media query), so it otherwise beats
       this rule on specificity alone regardless of source order. */
    .bihc-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* touch devices have no hover state to flip to the back face, so show
       a simplified row instead: icon, title, plain arrow link - no flip. */
    .bihc-card {
        height: auto;
        background-color: #F5F6F8;
    }

    .bihc-card-inner {
        height: auto;
    }

    .bihc-face {
        position: static;
        padding: 16px 20px;
    }

    /* !important on the front/back opacity+display: a tap on a touch device
       still triggers the desktop :hover state (".bihc-card:hover .bihc-face-*"
       below), which otherwise wins on specificity and hides BOTH faces at
       once - front forced to opacity:0 by :hover, back stuck at display:none
       from this same media query - leaving an empty card. */
    .bihc-face-front {
        opacity: 1 !important;
        pointer-events: auto !important;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 16px 20px;
    }

    .bihc-face-back {
        display: none !important;
    }

    .bihc-default {
        margin-bottom: 0;
    }

    .bihc-title {
        flex: 1;
    }

    .bihc-arrow-circle {
        position: static;
        flex-shrink: 0;
    }
}
