/* Site-wide fixes over the exported theme, loaded after every page's own styles. */

/*
 * The theme's page wrapper had overflow: hidden, which makes it a scroll container that never scrolls: every
 * position: sticky inside (the checkout and renewal summaries) scrolled away. clip cuts the same overflow without that.
 */
html body .btPageWrap {
    overflow: clip;
}

/*
 * The old theme's kit (.elementor-kit-3665) turns a hovered link green and leaves a clicked button grey: on the site's
 * green buttons that hid the text and changed the color depending on the page. "html body" outranks the kit's selectors
 * while the light and outline variants of tienda.css (three classes) still win over this.
 */
html body .sdg-store-button:not(.sdg-store-button-light):not(.sdg-store-button-outline):hover,
html body .sdg-store-button:not(.sdg-store-button-light):not(.sdg-store-button-outline):focus,
html body .sdg-store-button:not(.sdg-store-button-light):not(.sdg-store-button-outline):active {
    border-color: #096d00;
    background: #096d00;
    color: #fff;
}

html body .sdg-store-button:focus-visible {
    outline: 3px solid rgba(76, 162, 11, .45);
    outline-offset: 2px;
}

html body .sdg-store-button:disabled {
    cursor: not-allowed;
    opacity: .6;
}

/*
 * The contact form's button is the site's green button too: the theme's color schemes paint it black or grey with
 * !important (.bt_bb_color_scheme_5 .wpcf7-form .wpcf7-submit), so this needs !important and one more class.
 */
html body .btContent .wpcf7-form input.wpcf7-submit {
    padding: 12px 28px;
    border: 2px solid #4ca20b !important;
    border-radius: 4px !important;
    background: #4ca20b !important;
    color: #fff !important;
    font: 600 16px/1.3 'Roboto', sans-serif;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}

html body .btContent .wpcf7-form input.wpcf7-submit:hover,
html body .btContent .wpcf7-form input.wpcf7-submit:focus,
html body .btContent .wpcf7-form input.wpcf7-submit:active {
    border-color: #096d00 !important;
    background: #096d00 !important;
    color: #fff !important;
}

/* Home «Las últimas noticias»: the blog's covers at one size so the cards line up */
html body .sdg-home-news .bt_bb_latest_posts_item_image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/*
 * Footers: four columns (Nosotros, Productos, Políticas, Noticias) with the news last and widest. The theme's 2_4 and
 * Elementor's col-20 widths assumed five columns, so the widths are set here from the width where they sit side by side.
 */
.sdg-footer-cols > * > :nth-child(1),
.sdg-footer-cols > * > :nth-child(2) {
    --footer-col: 18%;
}

.sdg-footer-cols > * > :nth-child(3) {
    --footer-col: 26%;
}

.sdg-footer-cols > * > :nth-child(4) {
    --footer-col: 38%;
}

/* Elementor puts its columns side by side from 768 px, the theme's from 992 px */
@media (min-width: 768px) {
    html body .sdg-footer-cols > .elementor-container > .elementor-column {
        flex: 0 0 var(--footer-col);
        width: var(--footer-col);
        max-width: var(--footer-col);
    }
}

@media (min-width: 992px) {
    html body .sdg-footer-cols > .bt_bb_row_holder > .bt_bb_column {
        flex: 0 0 var(--footer-col);
        width: var(--footer-col);
        max-width: var(--footer-col);
    }
}

/* Below that they stack: the home's columns (only col-xl-3) otherwise went two by two and squeezed the news */
@media (max-width: 991px) {
    html body .sdg-footer-cols > .bt_bb_row_holder > .bt_bb_column {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
}

/* Stacked on a phone, the Elementor columns had no space between one menu and the next heading */
@media (max-width: 767px) {
    .sdg-footer-cols > .elementor-container > .elementor-column + .elementor-column {
        margin-top: 28px;
    }
}

/* Footers: the latest articles of the blog, a compact list that takes the footer's own text color */
.sdg-footer-news {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* The old recent-posts widget that held the list pulled it 23 px to the left: on a phone that cut off its first letters */
html body .elementor-widget-container:has(> .sdg-footer-news) {
    margin: 0 !important;
}

/* The green footers (Elementor template 5329 and the theme's accent section) paint only their own links light */
.elementor-5329 .sdg-footer-news,
.bt_bb_background_overlay_solid_accent .sdg-footer-news {
    color: #f5f5f7;
}

html body .sdg-footer-news a.sdg-footer-news-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

html body .sdg-footer-news a.sdg-footer-news-item:hover,
html body .sdg-footer-news a.sdg-footer-news-all:hover {
    color: inherit;
}

html body .sdg-footer-news a.sdg-footer-news-item:hover .sdg-footer-news-title {
    text-decoration: underline;
}

.sdg-footer-news-thumb {
    flex: none;
    width: 88px;
    height: 66px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, .25);
}

.sdg-footer-news-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sdg-footer-news-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sdg-footer-news-summary {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.4;
    opacity: .85;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sdg-footer-news-date {
    font-size: 12px;
    opacity: .8;
}

html body .sdg-footer-news a.sdg-footer-news-all {
    color: inherit;
    font-size: 14px;
    font-weight: 600;
}

/*
 * Call-to-action band shared by the FAQ, the news page and every article: a photo on the right that fades into the
 * site's green, a kicker, the headline, short points and two buttons. Self-contained (content pages don't load
 * tienda.css) and with its own button classes, so the site-wide .sdg-store-button hover above never repaints them.
 */
.sdg-cta {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: 300px;
    padding: 44px 48px;
    overflow: hidden;
    border-radius: 16px;
    background: #0b4f05;
    box-shadow: 0 18px 40px rgba(11, 79, 5, .22);
    color: #fff;
}

.sdg-cta::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    z-index: -2;
    width: 60%;
    background: var(--cta-image) var(--cta-position, center) / cover no-repeat;
}

.sdg-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, #0b4f05 0%, #0b4f05 40%, rgba(11, 79, 5, .82) 54%, rgba(11, 79, 5, .25) 78%, rgba(11, 79, 5, 0) 100%);
}

.sdg-cta-content {
    max-width: 580px;
}

html body .sdg-cta .sdg-cta-kicker {
    margin: 0 0 10px;
    color: #b9e698;
    font: 600 13px/1.2 'Roboto', sans-serif;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

html body .sdg-cta .sdg-cta-title {
    margin: 0 0 12px;
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

html body .sdg-cta .sdg-cta-text {
    margin: 0 0 20px;
    color: #e1f2d6;
    font-size: 16px;
    line-height: 1.55;
}

html body .sdg-cta ul.sdg-cta-checks {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 10px 28px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
}

html body .sdg-cta .sdg-cta-checks li {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 15px;
    line-height: 1.3;
}

.sdg-cta-checks li::before {
    content: none;
}

.sdg-cta-checks i {
    color: #8fdc5c;
    font-size: 17px;
}

.sdg-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

html body .sdg-cta a.sdg-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border: 2px solid #fff;
    border-radius: 6px;
    background: #fff;
    color: #0b4f05;
    font: 600 16px/1.2 'Roboto', sans-serif;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, color .2s;
}

html body .sdg-cta a.sdg-cta-button:hover,
html body .sdg-cta a.sdg-cta-button:focus {
    border-color: #e6f5da;
    background: #e6f5da;
    color: #0b4f05;
}

html body .sdg-cta a.sdg-cta-button.sdg-cta-button-outline {
    background: transparent;
    color: #fff;
}

html body .sdg-cta a.sdg-cta-button.sdg-cta-button-outline:hover,
html body .sdg-cta a.sdg-cta-button.sdg-cta-button-outline:focus {
    border-color: #fff;
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

html body .sdg-cta a.sdg-cta-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .6);
    outline-offset: 2px;
}

/* On a phone the photo is a strip on top and the text sits below it on solid green */
@media (max-width: 768px) {
    .sdg-cta {
        display: block;
        min-height: 0;
        padding: 176px 22px 26px;
    }

    .sdg-cta::before {
        inset: 0 0 auto 0;
        width: auto;
        height: 190px;
    }

    .sdg-cta::after {
        background: linear-gradient(180deg, rgba(11, 79, 5, 0) 0, rgba(11, 79, 5, .35) 110px, #0b4f05 190px);
    }

    html body .sdg-cta .sdg-cta-title {
        font-size: 24px;
    }

    html body .sdg-cta ul.sdg-cta-checks {
        grid-template-columns: 1fr;
    }

    html body .sdg-cta a.sdg-cta-button {
        flex: 1 1 100%;
    }
}
