/* ==========================================================================
   Branches page (/branches/)
   Loaded only by Views/Branchs.cshtml; scoped to .krBranchesHero (banner)
   and .krBranches (page body). The branch cards / "Branch info" pop-up use
   the existing site styles in custom.css, unchanged from live.
   Breakpoints follow the site: mobile <=767, tablet 768–1024, desktop >=1025.
   ========================================================================== */

/* ---------- Banner (Figma "Find a branch" hero) ----------
   Views/Branchs.cshtml wraps the shared BannerContent partial in .krBranchesHero,
   so these rules apply to this page only. Copy comes from the existing
   heroHeading / heroSummary properties; the "View accounts" button is a
   heroSummary link with the site's "linkbgarbtn" class. */
.krBranchesHero .awards-banner {
    padding-bottom: 44px;
}

.krBranchesHero .bannerMain {
    position: relative;
    max-width: 1070px;
    margin: 0 auto;
}

.krBranchesHero .breadCrumbs {
    margin-top: 54px;
    padding-top: 52px;
}

.krBranchesHero .bannerMain h1.page-title {
    margin: 42px 0 0;
    max-width: 745px;
    font-size: 48px !important;
    line-height: 62.4px !important;
}

.krBranchesHero .bannerMain p {
    max-width: 745px;
    padding: 0;
    margin: 12px 0 0;
    font-size: 18px;
    line-height: 23.4px;
}

/* 22px gap above the button (it collapses with its wrapping paragraph's top margin) */
.krBranchesHero .bannerMain a.linkbgarbtn {
    margin-top: 22px;
    font-size: 15px;
    line-height: 21px;
}

.krBranchesHero .awards-which-badge {
    top: 119px;
    right: 0;
    width: 175px;
    height: 142px;
}

/* ---------- Page body ---------- */
.krBranches__inner {
    max-width: 1070px;
    margin: 0 auto;
}

/* Branch cards – always visible (previously only after a search) */
.krBranches__list {
    padding: 51px 0 80px;
    background: #FFFFFF;
}

/* "Where you'll find us" heading (Figma 5422-52048 / 52191 / 52319) */
.krBranches__title {
    font-family: 'FSMeWeb-Light';
    font-weight: 300;
    font-size: 32px !important;
    line-height: 48px !important;
    color: #333333;
    text-align: center;
    margin: 0 0 18px;
}

/* Branch cards typography (Figma): 24px titles, 15px address with 29px lines,
   15px "Branch info" link. Pop-up content keeps the live styles. */
.krBranches .otherBranchCards .grid {
    gap: 35px 20px; /* row, column */
}

.krBranches .otherBranchCards .card h5 {
    font-size: 24px !important;
    margin-bottom: 12px;
}

/* Figma uses a fixed 152px image height on every screen size */
.krBranches .otherBranchCards .innerCard > img {
    height: 152px;
    object-fit: cover;
}

.krBranches .otherBranchCards .innerCard > p {
    font-size: 15px;
    line-height: 29px;
    padding-top: 4px;
}

.krBranches .otherBranchCards .card .innerCard .show-more {
    font-size: 15px;
}

/* ---------- Nearest branch result (after postcode / location search) ---------- */
.krBranches__result {
    padding: 48px 0 0;
    background: #FFFFFF;
}

/* Branches.js sets display:flex on the matching card, so the layout uses flex */
.krBranches .nearBranch {
    gap: 32px;
    max-width: none;
    margin: 0;
    padding: 32px;
    background: #FFFFFF;
    border-radius: 15px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    scroll-margin-top: 120px;
}

.krBranches .nearBranch .branchDetails,
.krBranches .nearBranch .branchLocation {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
}

.krBranches .nearBranch .miles {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 16px;
    background: #B73764;
    color: #FFFFFF;
    font-family: 'FSMeWeb-Regular';
    font-size: 14px;
}

.krBranches__resultName {
    font-family: 'FSMeWeb-Light';
    font-weight: 300;
    font-size: 32px !important;
    line-height: 40px !important;
    color: #333333;
    margin: 0 0 8px;
}

.krBranches .nearBranch .brnchAddrs p {
    font-family: 'FSMeWeb-Light';
    font-size: 16px;
    line-height: 24px;
    color: #333333;
    margin: 0 0 16px;
}

.krBranches .nearBranch .brnchAddrs p span {
    margin-left: 4px;
}

.krBranches .nearBranch .branchMap,
.krBranches .nearBranch .maps {
    width: 100%;
    height: 100%;
    min-height: 360px;
    border-radius: 15px;
    overflow: hidden;
}

/* ---------- Tablet ---------- */
@media (min-width: 768px) and (max-width: 1024px) {
    .krBranchesHero .awards-banner {
        padding-bottom: 50px;
    }

    .krBranchesHero .mainNavSec {
        max-width: none;
        padding-left: 60px;
        padding-right: 60px;
    }

    .krBranchesHero .breadCrumbs {
        padding-left: 0;
        padding-top: 56px;
    }

    .krBranchesHero .bannerMain h1.page-title {
        margin-top: 14px;
        font-size: 40px !important;
        line-height: 52px !important;
    }

    .krBranchesHero .bannerMain h1.page-title,
    .krBranchesHero .bannerMain p {
        max-width: 424px;
    }

    .krBranchesHero .bannerMain p {
        margin-top: 10px;
    }

    .krBranchesHero .awards-which-badge {
        top: 72px;
    }

    .krBranches__inner {
        padding-left: 60px;
        padding-right: 60px;
    }

    .krBranches .nearBranch {
        flex-direction: column;
    }

    .krBranches__list {
        padding-top: 46px;
    }

    .krBranches__title {
        margin-bottom: 21px;
    }

    /* Live's 60px pop-up padding is sized for its wider cards; with the Figma card
       width this keeps the opening-times table on one line, as on live */
    .krBranches .otherBranchCards .card .more-content {
        padding-left: 36px;
        padding-right: 36px;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .krBranchesHero .awards-banner {
        padding-bottom: 52px;
    }

    .krBranchesHero .mainNavSec {
        max-width: none;
        padding: 0 40px !important; /* overrides a site-wide mobile !important rule */
    }

    .krBranchesHero .breadCrumbs {
        justify-content: center;
        padding: 89px 0 0 !important;
    }

    .krBranchesHero .bannerMain h1.page-title,
    .krBranchesHero .bannerMain p {
        max-width: none;
        text-align: left;
    }

    .krBranchesHero .bannerMain h1.page-title {
        margin-top: 12px;
        font-size: 40px !important;
        line-height: 52px !important;
    }

    .krBranchesHero .bannerMain p {
        margin-top: 10px;
    }

    .krBranchesHero .bannerMain p + p {
        margin-top: 8px;
    }

    .krBranchesHero .bannerMain a.linkbgarbtn {
        margin-left: 0;
        margin-right: 0;
    }

    .krBranchesHero .awards-which-badge {
        position: static !important;
        margin: 20px 0 0;
        width: 115px;
        height: 93px;
    }

    .krBranches__inner {
        padding-left: 40px;
        padding-right: 40px;
    }

    .krBranches__list {
        padding: 21px 0 48px;
    }

    .krBranches__result {
        padding-top: 32px;
    }

    .krBranches .nearBranch {
        flex-direction: column;
        gap: 24px;
        padding: 24px 16px;
    }

    .krBranches__resultName {
        font-size: 28px !important;
        line-height: 35px !important;
    }

    .krBranches .otherBranchCards .grid {
        row-gap: 7px;
    }

    /* Figma mobile keeps the 32px heading on one line */
    .krBranches__title {
        white-space: nowrap;
        margin-bottom: 22px;
    }

    .krBranches .nearBranch .branchMap,
    .krBranches .nearBranch .maps {
        min-height: 260px;
    }

    /* Live's 45px pop-up padding is sized for its 336px card; with the Figma 280px
       card this gives the opening-times table the same width as live */
    .krBranches .otherBranchCards .card .more-content {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .krBranchesHero .breadCrumbs {
    justify-content: center;
    padding: 106px 0 0 !important; /* 32px from the menu bar to the breadcrumb, as in Figma */
}
}

/* ---------- Small mobile (below 360px) ---------- */
@media (max-width: 359px) {
    .krBranches__title {
        font-size: 26px !important;
        line-height: 34px !important;
        white-space: normal;
    }
}