/* ===== Global sidebar (scoped) ===== */
.vi-global-sidebar .vi-card {
    background: #fff;
    border: 1px solid #E9EBED;
    border-radius: 16px;
    margin-bottom: 18px;
    padding: 25px 30px;
    box-shadow: 0 4px 16px rgba(233, 235, 237, .70), 0 1px 0 rgba(233, 235, 237, .95);
    margin-right: 5px;
}

/* Title: 16px, #021B32, semibold 600, 150% line-height, mb 5px */
.vi-global-sidebar .vi-card-cta .vi-card-title {
    font-size: 16px;
    color: #021B32 !important;
    font-weight: 600 !important;
    line-height: 1.5;
    margin: 0 0 5px;
}

/* Sub text: 12px, 150% line-height, fw 500 */
.vi-global-sidebar .vi-card-cta .vi-card-sub {
    font-size: 12px;
    line-height: 1.5;
    font-weight: 500;
    color: #5a6a7d;
    margin: 0 0 12px;
}

/* Buttons (CTA card): vertical stack with 8px gap */
.vi-global-sidebar .vi-card-cta .vi-btns {
    display: grid;
    gap: 8px;
    /* requested 8px */
}

/* Base button */
.vi-global-sidebar .vi-btn {
    display: inline-block;
    text-align: center;
    padding: 10px 14px;
    /* default (overridden for CTA buttons below) */
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid #d7dee7;
    font-weight: 600;
}

/* Apply For Visa: padding 10x24, bg #00234F, white text + hover */
.vi-global-sidebar .vi-card-cta .vi-btn-primary {
    padding: 10px 24px;
    background: #00234F;
    color: #fff;
    border-color: #00234F;
}

.vi-global-sidebar .vi-card-cta .vi-btn-primary:hover {
    background: #011b3a;
    /* slightly darker */
    border-color: #011b3a;
    filter: none;
}

/* Extend Visa: padding 10x24, bg #DDE7F3, #021B32 + hover */
.vi-global-sidebar .vi-card-cta .vi-btn-ghost {
    padding: 10px 24px;
    background: #DDE7F3;
    color: #021B32;
    border-color: #DDE7F3;
}

.vi-global-sidebar .vi-card-cta .vi-btn-ghost:hover {
    background: #cfdced;
    /* subtle darken */
    border-color: #cfdced;
    color: #021B32;
    filter: none;
}

/* ---------- Other cards (unchanged base styles) ---------- */
.vi-global-sidebar .vi-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #021B32;
}

.vi-global-sidebar .vi-card-sub {
    font-size: 13px;
    color: #5a6a7d;
    margin: 0 0 12px;
}

/* Lists */
/* Base list styles (applies to all lists) */
.vi-global-sidebar .vi-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vi-global-sidebar .vi-list-item a {
    display: block;
    /* single-column by default */
    padding: 8px 6px;
    border-radius: 10px;
    text-decoration: none;
    color: #021B32;
}

.vi-global-sidebar .vi-list-item a:hover {
    background: #f7f9fc;
}

/* Popular services (thumb + text) => 2-column grid */
.vi-global-sidebar .vi-card-popular .vi-list-item a {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 10px;
}

.vi-global-sidebar .vi-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

/* Categories (text only) stays single-column; just ensure normal wrapping */
.vi-global-sidebar .vi-card-cats .vi-list-item a {
    display: block;
    /* overrides any generic grid rule */
    white-space: normal;
    line-height: 1.5;
}

/* ----- Mobile: make sidebar CTA a floating bottom bar ----- */
@media (max-width: 992px) {

    /* Give the page some room so content isn’t hidden behind the bar */
    .vi-single-post {
        padding-bottom: 120px;
        /* adjust if your CTA is taller/shorter */
    }

}

/* Responsive tweaks (keep your existing ones if you like) */
@media (max-width: 992px) {
    .vi-spside.vi-card.vi-card-cta {
        display: none;
    }

    .vi-global-sidebar .vi-card {
        padding: 14px;
    }

    .vi-global-sidebar .vi-card-popular .vi-list-item a {
        grid-template-columns: 36px 1fr;
    }

    .vi-global-sidebar .vi-thumb {
        width: 36px;
        height: 36px;
    }
}

/* ===== Sticky sidebar column + inner scroll (desktop only) ===== */
@media (min-width: 992px) {

    /* 0) Grid ancestors must not clip overflow */
    .vi-grid,
    .vi-content-wrap,
    .vi-side {
        overflow: visible;
    }

    /* critical */

    /* 1) The column itself sticks */
    .vi-side {
        position: sticky;
        top: calc(var(--header-h, 72px) + var(--wp-admin--admin-bar--height, 0px) + 16px);
        align-self: start;
        /* grid: prevent stretching, required for sticky */
    }

    /* 2) The inner sidebar gets its own scrollbar */
    .vi-global-sidebar {
        max-height: calc(100vh - (var(--header-h, 72px) + var(--wp-admin--admin-bar--height, 0px) + 16px));
        overflow: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile: normal flow */
@media (max-width: 991.98px) {
    .vi-side {
        position: static;
        top: auto;
    }

    .vi-global-sidebar {
        max-height: none;
        overflow: visible;
    }
}