/*
 * Plans Cards
 *
 * Redesign of the plans table ([plusheat_plans_table]) for pages built with
 * Page Sections. Every rule is scoped to .plans-cards, the wrapper added by
 * template-parts/sections/plans-comparison-table.php, so MSM, partner and other
 * pages using the shortcode keep the old look from plans/plans-table.css.
 *
 * Markup and JS are unchanged (plans-table.php / plan-table.js); this file only
 * restyles them. Loaded after plans-table.css.
 *
 * TABLE OF CONTENTS
 * 1.0  Header
 * 2.0  Options (customer, call-out fee, payment)
 * 3.0  Cards
 * 4.0  Most popular
 * 5.0  Responsive
 * 6.0  Disclaimer and spacing
 */


/* 1.0 Header */

.plans-cards #plans_section {
    max-width: 2100px;
    margin-inline: auto;
}

/* The shortcode uses .container (1250px); match the page container the other
   sections use (.container-lg in flexible-page-template.css) so the plans line
   up with them on wide screens. */
.plans-cards .container {
    width: var(--container-lg-width);
}

@media (min-width: 992px) {
    .plans-cards .container {
        width: min(2100px, calc(100% - 40px));
    }
}

.plans-cards .plans-header {
    text-align: left;
    margin-bottom: 2.5rem;
}

.plans-cards .heading-icon {
    display: none;
}

.plans-cards .plan-section-title {
    max-width: none;
    font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
    font-weight: var(--font-semibold);
    line-height: 1.15;
    color: var(--color-heading);
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.plans-cards .plan-section-subtitle {
    max-width: 30rem;
    font-size: var(--font-sm);
    font-weight: var(--font-regular);
    line-height: 1.5;
    color: var(--color-text);
    margin: 0.75rem 0 2.25rem;
}

/* /1.0 Header */


/* 2.0 Options */

.plans-cards .options-select-wrapper {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
}

.plans-cards .select-wrapper {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
}

.plans-cards .select-wrapper > .d-col-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
}

.plans-cards .select-title-wrapper {
    margin-bottom: 0 !important;
}

.plans-cards .select-title {
    font-size: var(--font-xxs);
    font-weight: var(--font-regular);
    color: var(--color-text);
}

/* The step numbers (1, 2, 3) are not part of the new look. */
.plans-cards .select-title span {
    display: none;
}

.plans-cards .options-tooltip-icon {
    margin-left: 4px;
}

.plans-cards .select-options-wrapper {
    min-width: 0;
    max-width: none;
    gap: 2px;
    background-color: var(--color-grey-light);
    border-radius: 0.75rem;
    padding: 4px;
    margin: 0;
}

.plans-cards .option-btn {
    flex: 0 0 auto;
    height: auto;
    font-size: var(--font-xs);
    font-weight: var(--font-semibold);
    color: var(--color-heading);
    border-radius: 0.5rem;
    padding: 0.5rem 0.9rem;
}

.plans-cards .option-btn.active {
    color: var(--color-white);
    background: var(--color-heading);
    border-radius: 0.5rem;
}

/* /2.0 Options */


/* 3.0 Cards */

.plans-cards .plans-block {
    background: transparent;
    border-radius: 0;
    padding: 0;
}

/* "All plans include a FREE annual boiler service": a quiet line above the
   cards. Its jump button points at the cards directly below, so it is hidden. */
.plans-cards .plans-heading-content {
    max-width: none;
    text-align: left;
}

.plans-cards .plans-heading-content .section-subtitle {
    font-size: var(--font-sm);
    font-weight: var(--font-medium);
    line-height: 1.4;
    color: var(--color-heading);
    margin: 2rem 0 0;
}

.plans-cards .plans-heading-content .btn {
    display: none;
}

.plans-cards .plans-content {
    align-items: stretch;
    gap: 1.25rem;
    padding-top: 1.5rem;
}

.plans-cards .plusheat-plan {
    box-sizing: border-box;
    flex: 1 1 0;
    min-width: 0;
    background: var(--color-white);
    border: 2px solid transparent;
    border-radius: 1.5rem;
    box-shadow: 0 8px 30px rgba(22, 22, 22, 0.07);
    padding: 1.5rem;
}

.plans-cards .plusheat-plan > .d-col-inner {
    padding: 0;
}

/* Badge first, then name, subtitle, price, button, list, link. */
.plans-cards .plan-discount-badge {
    order: -1;
    position: static;
    align-self: flex-start;
    width: auto;
    height: auto;
    font-size: var(--font-xxxs);
    font-weight: var(--font-semibold);
    line-height: 1.2;
    color: var(--color-primary);
    background-color: var(--color-secondary);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    margin-bottom: 1.25rem;
}

.plans-cards .plan-discount-badge-image {
    width: auto;
    height: 2rem;
    background: none;
    padding: 0;
}

.plans-cards .plan-name {
    font-size: var(--font-lg);
    font-weight: var(--font-semibold);
    color: var(--color-heading);
    margin-bottom: 0.25rem;
}

.plans-cards .plan-subtitle {
    font-size: var(--font-xs);
    font-weight: var(--font-regular);
    color: var(--color-text);
    margin-bottom: 1.5rem !important;
}

.plans-cards .plan-price-wrapper {
    margin: 0 0 1.25rem !important;
}

.plans-cards .plan-price del {
    font-size: var(--font-xs);
    font-weight: var(--font-regular);
    color: var(--color-text);
}

.plans-cards .plan-total-price {
    flex-wrap: wrap;
    gap: 0 0.35rem;
    font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
    font-weight: var(--font-bold);
    line-height: 1.1;
    color: var(--color-primary);
}

.plans-cards .plan-total-price .duration {
    font-size: var(--font-sm);
    font-weight: var(--font-semibold);
}

.plans-cards .plan-total-price .duration > span {
    display: block;
    font-size: var(--font-xxxs);
    font-weight: var(--font-regular);
    opacity: 1;
}

.plans-cards .discount-tagline,
.plans-cards .price-tagline {
    font-size: var(--font-xxs);
    color: var(--color-text);
}

.plans-cards .plans-form {
    margin-bottom: 1.5rem !important;
}

.plans-cards .proceed-button,
.plans-cards .plusheat-plan .button {
    display: block;
    box-sizing: border-box;
    width: 100%;
    font-size: var(--font-sm);
    font-weight: var(--font-semibold);
    text-transform: none;
    color: var(--color-white) !important;
    background-color: var(--color-heading) !important;
    border: 0;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
}

.plans-cards .proceed-button:is(:hover, :focus) {
    background-color: var(--color-grey-dark) !important;
}

.plans-cards .proceed-button::after {
    display: none !important;
}

/* Inclusions list, under a divider. */
.plans-cards .plan-details {
    border-top: 1px solid var(--color-border-light);
    padding-top: 1.5rem;
    margin-bottom: 1.25rem !important;
}

.plans-cards .plan-details ul li {
    font-size: var(--font-xs);
    color: var(--color-heading);
}

.plans-cards .plan-details ul li:not(:last-child) {
    margin-bottom: 0.75rem;
}

.plans-cards .plan-details ul li span {
    opacity: 1;
}

.plans-cards .plan-details-free {
    font-size: var(--font-xxs);
    margin-bottom: 1.25rem !important;
}

/* "See all inclusions and exclusions" as a plain text link. */
.plans-cards .plusheat-plan .see-all {
    margin: auto 0 0;
}

.plans-cards .plusheat-plan .see-all .btn-outline {
    display: inline-block;
    width: auto;
    font-size: var(--font-xxs);
    font-weight: var(--font-semibold);
    text-align: left;
    color: var(--color-heading) !important;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
}

.plans-cards .plusheat-plan .see-all .btn-outline::after {
    content: " \2192";
}

.plans-cards .plusheat-plan .see-all .btn-outline:hover {
    color: var(--color-primary) !important;
    background: none;
}

/* /3.0 Cards */


/* 4.0 Most popular */

.plans-cards .highlighted-plan {
    background: var(--color-white);
    border-color: var(--color-primary);
}

/* The label sits on the badge row, top right of the card. */
.plans-cards .plan-label {
    top: 1.5rem;
    right: 1.5rem;
    left: auto;
    font-size: var(--font-xxxs);
    font-weight: var(--font-semibold);
    line-height: 1.2;
    background-color: var(--color-primary);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
}

/* plans-table.css turns all text in the highlighted plan white with
   `body:not(.page-single) .highlighted-plan * { color: ... !important }`.
   Inside .plans-cards everything inherits again, and each part gets its
   colour back below (a class more specific, so these win). */
.plans-cards .plusheat-plan.highlighted-plan * {
    color: inherit !important;
}

.plans-cards .plusheat-plan.highlighted-plan > .d-col-inner,
.plans-cards .plusheat-plan.highlighted-plan .plan-details ul li,
.plans-cards .plusheat-plan.highlighted-plan .see-all .btn-outline {
    color: var(--color-heading) !important;
}

.plans-cards .plusheat-plan.highlighted-plan .plan-subtitle,
.plans-cards .plusheat-plan.highlighted-plan .plan-price,
.plans-cards .plusheat-plan.highlighted-plan .plan-total-price .duration > span,
.plans-cards .plusheat-plan.highlighted-plan .discount-tagline,
.plans-cards .plusheat-plan.highlighted-plan .price-tagline {
    color: var(--color-text) !important;
}

.plans-cards .plusheat-plan.highlighted-plan .plan-total-price,
.plans-cards .plusheat-plan.highlighted-plan .plan-details-free,
.plans-cards .plusheat-plan.highlighted-plan .plan-discount-badge,
.plans-cards .plusheat-plan.highlighted-plan .see-all .btn-outline:hover {
    color: var(--color-primary) !important;
}

.plans-cards .plusheat-plan.highlighted-plan .plan-discount-badge {
    background-color: var(--color-secondary);
}

.plans-cards .plusheat-plan.highlighted-plan .plan-label,
.plans-cards .plusheat-plan.highlighted-plan .proceed-button {
    color: var(--color-white) !important;
}

body .plans-cards .plusheat-plan.highlighted-plan .plan-details ul li::before {
    filter: none;
}

body .plans-cards .plusheat-plan.highlighted-plan .proceed-button {
    background-color: var(--color-primary) !important;
}

body .plans-cards .plusheat-plan.highlighted-plan .proceed-button:is(:hover, :focus) {
    background-color: var(--color-primary-dark) !important;
}

/* /4.0 Most popular */


/* 5.0 Responsive */

/* Tablet: two cards per row. */
@media screen and (max-width: 1140px) {
    .plans-cards .plans-content {
        flex-wrap: wrap;
    }

    .plans-cards .plusheat-plan {
        flex: 1 1 calc(50% - 0.625rem);
        width: auto;
    }
}

/* Phone: options stack, cards become the existing swipe slider. */
@media screen and (max-width: 768px) {
    .plans-cards .plans-header {
        margin-bottom: 1.5rem;
    }

    .plans-cards .plan-section-title {
        text-transform: none;
    }

    .plans-cards .options-select-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    /* Label above, pills full width and equal. */
    .plans-cards .select-wrapper > .d-col-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .plans-cards .select-title-wrapper {
        justify-content: flex-start;
    }

    .plans-cards .select-options-wrapper {
        display: flex;
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
    }

    .plans-cards .option-btn {
        flex: 1 1 0;
        font-size: var(--font-xs);
    }

    .plans-cards .plans-block {
        margin-top: 0;
    }

    .plans-cards .plusheat-plan,
    .plans-cards .plusheat-plan:not(.highlighted-plan) {
        background-color: var(--color-white);
        padding: 1.25rem;
    }

    .plans-cards .plans-content.slick-slider {
        display: block;
        padding-top: 1rem;
    }

    .plans-cards .plans-block .slick-list {
        padding: 1rem 0 1.5rem;
        margin-top: -1rem;
    }

    .plans-cards .plans-block .slick-slide {
        margin-left: 0;
        margin-right: 0.75rem;
    }
}

/* /5.0 Responsive */


/* 6.0 Disclaimer and spacing */

.plans-cards {
    padding: 4rem 0 5rem;
}

.plans-cards__disclaimer {
    font-size: var(--font-xs);
    line-height: 1.5;
    color: var(--color-text);
    margin-top: 2rem;
}

.plans-cards__disclaimer p {
    margin: 0;
}

.plans-cards__disclaimer a {
    font-weight: var(--font-semibold);
    color: var(--color-heading);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.plans-cards__disclaimer a:hover {
    color: var(--color-primary);
}

@media screen and (max-width: 768px) {
    .plans-cards {
        padding: 2.5rem 0 3.5rem;
    }

    .plans-cards__disclaimer {
        margin-top: 1.25rem;
    }
}

/* /6.0 Disclaimer and spacing */
