.bg-highlight {
    background-color: #F3F7F8;
    color: #252525;
}

.flex-1 {
    flex: 1;
}

.v-divider {
    width: 1px;
    background-color: #E0E0E0;
}

.f-12 {
    font-size: 12px;
}

.font-medium, .heading-italic {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.standalone-link-after {
    display: inline-block;
    text-decoration: none;
    position: relative;
}

.standalone-link-after:after {
    content: url("/dvl/v1.0/assets/images/ui/ui-chevron-right-blue.svg");
    position: absolute;
    right: -15px;;
    top: 50%;
    transform: translateY(-50%);
    display: inline-block;
    width: 6px;
    height: 10px;
    line-height: 0;
}

.standalone-link-front {
    position: relative;
    padding-left: 35px !important;
    display: inline-block;
}

.standalone-link-front:before {
    content: url(/dvl/v1.0/assets/images/ui/ui-newwindow-blue.svg);
    -webkit-transform: translate(0, 12%);
    -ms-transform: translate(0, 12%);
    transform: translate(0, 12%);
    position: absolute;
    left: 0;
    display: inline-block;
    background-size: 20px 20px;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    vertical-align: text-bottom;
}

.text-gray-1 {
    color: #4F545C;
}

/* hero section */
#hero {

    .hero-content-container {
        display: flex;
        flex-direction: row;
        gap: 30px;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        flex: 1;
        gap: 32px;
    }

    .collapse-toggle:before {
        margin-top: 8px;
    }

    .collapse-toggle:after {
        margin-top: 5px;
    }

    .choose-card {
        width: 100%;
        max-width: 400px;
        border: solid 1px #c4c8cc;
        background: rgba(255, 255, 255, 0.8);
        margin: auto;
        margin-bottom: -130px;
        padding: 15px 0;
        top: 50%;
        position: relative;
    }

    .choose-card .choose-card-button {
        height: 170px;
        background-color: #f3f4f5;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    @media screen and (max-width: 640px) {
        .hero-content-container {
            flex-direction: column;
        }

        .choose-card {
            margin-bottom: -100px;
        }
    }
}

.cc-img {
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 250px;
    height: 238px;
}

/* How do I... */
#how-do-i {
    .grid-container {
        display: flex;
        flex-wrap: wrap; /* Allows items to drop to the next line */
        gap: 30px 32px;       /* Spacing between your items */
        justify-content: center; 
    }

    .grid-item {
        flex-grow: 0;
        flex-shrink: 1;
        /* Formulates a clamp math block to handle the column ranges */
        flex-basis: clamp(
            calc((100% - (5 - 1) * 16px) / 5),  /* Maximum size: 5 columns */
            200px,                             /* Ideal breakdown size */
            calc((100% - (2 - 1) * 16px) / 2) /* Minimum size: 2 columns */
        );
        text-align: center;
        max-width: 170px;
    }

    @media screen and (max-width: 640px) {

        .grid-container {
            gap: 15px 16px;
        }

        .grid-item {
            max-width: 165px;
        }
    }
}

#documentation {
    .documentation-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 30px;
    }

    div#card-documentation-list {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    @media screen and (max-width: 640px) {
        .documentation-container {
            flex-direction: column-reverse;
        }
    }
}

#reward-yourself {
    .callout .callout-img {
        min-height: 165px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .rewards-container {
        display: flex;
        flex-direction: row;
        gap: 30px;
    }

    .rewards-item {
        flex: 1;
    }

    .petro-canada-logo {
        background-repeat: no-repeat;
        background-size: 40%;
        background-position: center;
        background-color: #F3F4F5;
    }

    .rewards-grid-moi-img {
        background: url('/credit-cards/_assets-custom/images/rewards-grid-moi-img.svg') center / 50% no-repeat, linear-gradient(180deg, #E7EEF1 25.96%, #97C6D5 100%);
    }

    @media screen and (max-width: 640px) {

        .h4 {
            font-size: 24px;
            line-height: 32px;
        }

        .rewards-container {
            flex-direction: column;
        }

        .petro-canada-logo {
            background-size: 20%;
        }

        .rewards-grid-moi-img {
            background: url('/credit-cards/_assets-custom/images/rewards-grid-moi-img.svg') center / 35% no-repeat, linear-gradient(180deg, #E7EEF1 25.96%, #97C6D5 100%);
        }
    }

}

#view-another-card {
    .perk-header {
        max-width: 1200px;
        margin: auto;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
        gap: 16px; 
    }

    .carousel-container {
        margin-left: auto;
        display: flex;
        flex-direction: row;
        gap: 30px;
        margin-left: calc((100% - 1200px) / 2) !important;
        position: relative;
    }

    .carousel-container .left {
        max-width: min(370px, 40%);
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 32px;
        position: relative;
        float: left;
        z-index: 10;
    }

    .carousel-container .left .cardholder-selector_open {
        padding: 14px 20px;
    }

    .carousel-container .right {
        position: absolute;
        left: min(430px, calc(40% + 60px));
        right: 0;
    }

    .card-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 24px;
        padding: 48px 32px 32px;
    }

    .carousel-container .right.glider-wpr .glider-scrollbar {
        margin-left: 0;
        width: calc(100% - 16px);
        height: 16px;
    }

    .glider-wpr .glider-scrollbar-thumb {
        height: 16px;
    }

    .carousel-button.inactive {
        filter: brightness(0) saturate(100%) invert(90%) sepia(0%) saturate(48%) hue-rotate(339deg) brightness(124%) contrast(76%);
    }
    
    .glider-item:first-of-type {
        margin-left: 0 !important;
    }

    @media screen and (max-width: 1200px) {
        .perk-header {
            margin-left: 15px !important;
        }

        .carousel-container {
            margin-left: 15px !important;
        }
    }

    @media screen and (max-width: 640px) {
        .perk-header {
            flex-direction: column;
            align-items: flex-start
        }

        .carousel-container {
            flex-direction: column;
            margin-left: 0 !important;
            gap: 16px;
        }

        .carousel-container .left {
            max-width: unset;
            gap: 16px;
            padding-left: 15px;
            padding-right: 15px;
        }

        .carousel-container .left.eh {
            min-height: 0 !important;
        }

        .carousel-container .right {
            position: relative;
            left: unset;
            right: unset;
            width: 100%;
        }

        .carousel-container .right.glider-wpr .glider-scrollbar {
            width: calc(100% - 32px);
            margin-left: 15px;
        }

        .card-inner {
            padding: 48px 27px 32px;
        }
    }
}

/* RBC Mobile app */

.app-mobile-container {
    display: flex;
    flex-direction: row;
    padding: 64px 85px 0px;
    position: relative;
    gap: 64px;
    border-radius: 8px;
}

.app-mobile-image-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: hidden;
}

.app-mobile-image {
	width: 100%;
    max-width: 316px;
    height: auto;
    aspect-ratio: 316 / 403;
    object-fit: contain;
}

.mobile-app-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 60px 0;
}

.mobile-app-actions {
    display: flex;
    flex-direction: row;
    gap: 32px;
}

.store-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rating-container {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex: 1;
    align-items: center;
}

.rating-rbc-logo {
	width: 72px;
	height: 72px;
	border: 1px solid white;
	border-radius: 8px;
}

.rating-content {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.rating-content>.top {
	display: flex;
	flex-direction: row;
	gap: 8px;
    text-wrap: nowrap;
}

.rating-star {
	width: 30px;
	height: 30px;
}

.rating-score {
	font-size: 24px;
	font-weight: 500;
	line-height: 32px;
}

.rating-counts {
	font-size: 12px;
	font-weight: 400;
	line-height: 16px
}

@media screen and (max-width: 1000px) {
    .app-mobile-container {
        padding: 32px 32px 0px;
    }

    .store-buttons,
    .rating-container {
        flex: 1;
    }
}

@media screen and (max-width: 768px) {
    .app-mobile-container {
        background-color: #F3F4F5;
        flex-direction: column-reverse;
        align-items: center;
        max-height: unset;
        padding: 32px 15px 0;
        gap: 24px;
    }

	.app-mobile-image {
		max-width: 270px;
		width: 100%;
	}

    .mobile-app-content {
        padding: 0;
        gap: 24px;
    }

    .mobile-app-actions {
        flex-direction: column;
        gap: 24px;
    }
}

#cta {
    .cta-container {
        display: flex;
        flex-direction: row;
        gap: 30px;
    }

    .cta-content {
        display: flex;
        flex-direction: column;
        gap: 24px;
        flex: 1;
        justify-content: center;
    }

    @media screen and (max-width: 640px) {
        .cta-container {
            flex-direction: column;
        }

        .cta-content {
            gap: 32px;
        }
    }
}

#ways-to-bank {
    .callout .callout-img {
        min-height: 290px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    p>a {
        font-weight: 400;
    }
}

/* card selector */
.modal-header .search-bar {
    margin-left: auto;
    margin-right: 35%;
    margin-top: 5px;
    display: block;
    width: 25%;
    border-left: none;
    border-right: none;
    border-top: none;
    background: url(/credit-cards/app/assets/search.png) no-repeat;
    background-position: 100% 50%;
}

@media (max-width: 639px) {
    .modal-header .search-bar {
        width: 100%;
    }
}

#cards {
    &.cards {
        max-width: 1230px;
        width: 100%;
        margin: 0 auto;
    }

    &.cards .card-box {
        text-align: center;
        display: inline-block;
        float: left;
        margin: 15px;
        width: 270px;
        height: 260px;
        border: 1px solid #D7D7D7;
        padding: 15px;
    }

    &.cards .card-box p {
        height: 50px;
        position: relative;
        vertical-align: middle;
        display: table-cell;
        width: 300px;
        line-height: 24px;
    }

    &.cards .card-box img {
        max-width: 230px;
        width: 100%;
        margin-top: 15px;
    }

    @media (max-width: 639px) {
        &.cards .card-box {
            float: none;
            width: 50%;
            margin: 0px;
            border: none;
            height: auto;
            padding-bottom: 0px;
        }

        &.cards .card-box p {
            font-size: 14px;
            line-height: 18px;
        }

        &.cards .card-box img {
            max-width: none;
            margin-top: 0px;
        }
    }
}

/* common css for the CTA buttons */
#hero,
#cta {
    .cta-actions {
        display: flex;
        flex-direction: row;
        gap: 16px;
    }

    .cta-actions > a {
        padding: 20px 32px;
        line-height: 24px;
    }

    .cta-actions > a > span.pdf-link {
        padding-left: 32px !important; /* image width set to 16px, with 16px spacing to the text */
    }

    .cta-actions > a > span.pdf-link:before {
        transform: translate(0, 0);
        width: 16px;
        filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(8%) hue-rotate(201deg) brightness(103%) contrast(103%);
    }

    @media screen and (max-width: 768px) {
        .cta-actions {
            flex-direction: column;
        }
    }
}