/**
 * EasyFit Product Fetcher — Frontend
 *
 * Tärkeää specificity:stä: teema (Elementor-kit-37) asettaa h2/h3-elementeille
 * defaultit hieman korkeammalla specificity:llä (.elementor-kit-37 h2),
 * joten omat säännöt prefiksoidaan .efpf-card:lla jotta ne voittavat.
 *
 * Tärkeää fonttirekisteröinnistä: @font-face-säännöt rekisteröidään PHP-puolella
 * (luokka EFPF_Shortcodes::ensure_assets) joka käyttää wp_upload_dir() -funktiota
 * konstruoimaan oikean URL:n myös subdirectory-installissa. Tämä CSS-tiedosto
 * vain käyttää nimettyjä fontteja (font-family).
 */

/* ===== Korttiruudukko ===== */

.efpf-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    justify-items: center;
    width: 100%;
    max-width: 1008px; /* 3 × 320 + 2 × 24 — vakioleveys gridille */
    margin-left: auto;
    margin-right: auto;
    font-family: "Sofia Sans", sans-serif;
}

.efpf-cards--kertakaynti {
    /* Sama 3-saraketteinen grid — yksittäinen kortti vasempaan sarakkeeseen */
    justify-content: start;
    justify-items: start;
}

.efpf-cards--extra {
    /* Lisätuotteet: 3-saraketteinen grid, kortit keskittyvät omissa soluissaan */
    justify-items: center;
}

/* Yksittäinen kortti extra-tabissa keskitetään koko gridin levyiseksi sarakkeeksi
 * (ei vasempaan reunaan kuten 3-saraketteinen oletus tekisi) */
.efpf-cards--extra:has(> :only-child) {
    grid-template-columns: minmax(0, 320px);
    justify-content: center;
}

@media (max-width: 900px) {
    .efpf-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobiili (max-width: 600px) -säännöt korttiriville ja tab-widgetille on
 * keskitetty yhteen blokkiin tämän tiedoston loppupuolella. */


/* ===== Yhteinen kortti ===== */

.efpf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    border-radius: 22px;
    overflow: visible;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

/* Featured-kortin wrapper: badge sijaitsee articlen sisaruselementtinä,
 * jolloin se voi olla osittain kortin takana (badge z-index < card z-index).
 * Wrap toimii grid-itemina ja matchaa muiden korttien max-width 320px.
 * Wrap on flex-column jotta sisällä oleva article venyy gridin
 * align-items: stretch -säännön mukaisesti rivin korkeuteen. */
.efpf-card-wrap {
    position: relative;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.efpf-card-wrap .efpf-card {
    position: relative;
    z-index: 2; /* kortti renderöityy badgen päälle */
    width: 100%;
    flex: 1 1 auto; /* venyy wrap-elementin korkeuteen */
}

/* "Suositus"-badge — valkoinen suorakulmio kortin yläreunan kohdalla.
 * Suuri alapadding piiloutuu kortin taakse, näkyy vain ylin osa. */
.efpf-card-wrap .efpf-card__badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%); /* keskellä vaakasuunnassa, puoliksi kortin yläpuolella */
    z-index: 1; /* kortin alapuolella */
    background: #FFFFFF;
    color: #3C3E3F;
    font-family: "Sofia Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 8px 28px 25px; /* iso pohja jää kortin taakse piiloon */
    border-radius: 8px;
    white-space: nowrap;
    line-height: 1.3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* "KAMPANJA"-ribbon — diagonaalinen banneri vasemmassa yläkulmassa.
 * Wrapper-elementti rajaa ribbon-osan kortin pyöristettyihin kulmiin
 * jotta ribbon ei näy kortin ulkopuolella. */
.efpf-card .efpf-card__corner-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    border-radius: 22px;
    z-index: 2;
}

.efpf-card .efpf-card__ribbon {
    position: absolute;
    top: 26px;
    left: -42px;
    width: 170px;
    padding: 6px 0;
    background: #E5005B;
    color: #FFFFFF;
    text-align: center;
    font-family: "ScoutCondReg", "Sofia Sans", sans-serif;
    font-style: normal;
    font-weight: normal;
    font-size: 16px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transform: rotate(-45deg);
    transform-origin: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    line-height: 1.3;
}

/* ===== Tumma kortti (kampanjat & jäsenyydet) ===== */

.efpf-card.efpf-card--dark {
    background-color: #1a1a1a;
    color: #FFFFFF;
    border-radius: 22px;
    overflow: visible;
}

/* Kampanjat: koko kortin pohjalla taustakuva.
 * border-radius clippaa background-imagen automaattisesti.
 */
.efpf-card.efpf-card--campaign {
    background-image: var(--efpf-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 22px;
}

.efpf-card.efpf-card--campaign .efpf-card__body {
    flex: 1 1 auto;
    padding: 50px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 460px;
}

/* Suosituin-kortti: 2px valkoinen kehys */
.efpf-card.efpf-card--featured.efpf-card--campaign {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), inset 0 0 0 2px #FFFFFF;
}

/* Jäsenyydet: valkoinen yläosa otsikolle, alaosassa taustakuva */
.efpf-card.efpf-card--membership .efpf-card__header,
.efpf-card.efpf-card--kertakaynti .efpf-card__header {
    background: #FFFFFF;
    padding: 26px 16px 22px;
    text-align: center;
    border-radius: 22px 22px 0 0;
}

.efpf-card.efpf-card--membership .efpf-card__body {
    flex: 1 1 auto;
    background-image: var(--efpf-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 30px 24px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 440px;
    border-radius: 0 0 22px 22px;
}

.efpf-card.efpf-card--featured.efpf-card--membership {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), inset 0 0 0 2px #FFFFFF;
}

/* Kertakäynti — header-rakenteessa otsikko menee headeriin → body matchaa membership-mittoja */
.efpf-card.efpf-card--kertakaynti {
    background-image: none; /* taustakuva nyt vain body:llä, ei koko kortilla */
    border-radius: 22px;
    overflow: hidden; /* header-pyöristys + body-pyöristys yhdessä */
}

.efpf-card.efpf-card--kertakaynti .efpf-card__body {
    background-image: var(--efpf-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 30px 24px 30px;
    min-height: 440px; /* sama kuin membership → kortit samassa korkeudessa */
    border-radius: 0 0 22px 22px;
}

/* Extra-konteksti (Online / Treeniviikko / muut lisätuotteet) — tumma variantti.
 * Sama rakenne kuin campaign: koko kortissa taustakuva, otsikko body:n sisällä. */
.efpf-card.efpf-card--extra,
.efpf-card.efpf-card--kertakaynti {
    background-image: var(--efpf-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 22px;
}

.efpf-card.efpf-card--extra .efpf-card__body,
.efpf-card.efpf-card--kertakaynti .efpf-card__body {
    flex: 1 1 auto;
    padding: 40px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 460px;
    text-align: center;
}

/* Otsikko (Basic / Plus / Premium / ...).
 * EI font-style: italic (rikkoo ScoutCondItalic-matchayksen).
 * Specificity nostettu .efpf-card-prefiksillä.
 */
.efpf-card .efpf-card__type {
    margin: 0;
    font-family: "ScoutCondensed-BoldItalic", "ScoutCondItalic", "Sofia Sans", sans-serif;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
}

.efpf-card.efpf-card--campaign .efpf-card__type {
    font-size: 32px;
    color: #FFFFFF;
    margin-bottom: -4px;
}

/* Extra (tumma): valkoinen otsikko, sama tyyli kuin campaign */
.efpf-card.efpf-card--extra .efpf-card__type,
.efpf-card.efpf-card--kertakaynti .efpf-card__body > .efpf-card__type {
    font-size: 32px;
    color: #FFFFFF;
    margin-bottom: -4px;
}

/* Extra & Kertakäynti (vaalea, otsikko body:ssa): tumma otsikko */
.efpf-card.efpf-card--white.efpf-card--extra .efpf-card__type,
.efpf-card.efpf-card--white.efpf-card--kertakaynti .efpf-card__body > .efpf-card__type {
    color: #3C3E3F;
}

/* Kertakäynti header (otsikko valkoisella header-alueella) → tumma teksti kuten Basic/Plus */
.efpf-card.efpf-card--kertakaynti .efpf-card__header .efpf-card__type {
    font-size: 32px;
    color: #3C3E3F;
}

.efpf-card.efpf-card--membership .efpf-card__type {
    font-size: 32px;
    color: #3C3E3F;
}

/* Hinta — specificity nostettu, italic pois. */
.efpf-card .efpf-card__price {
    margin: 6px 0 0;
    font-family: "ScoutCondensed-BoldItalic", "ScoutCondItalic", "Sofia Sans", sans-serif;
    font-size: 50px;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    color: #FFF265;
    text-align: center;
}

/* "Jatkossa X €/kk" / "+ Aloitusmaksu 29,90 €" */
.efpf-card .efpf-card__subprice {
    margin: 0;
    font-family: "Sofia Sans", sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #FFFFFF;
    text-align: center;
    line-height: 1.3;
}

.efpf-card.efpf-card--membership .efpf-card__subprice {
    font-size: 15px;
}

/* Bullet-lista */
.efpf-card .efpf-card__features {
    list-style: disc;
    padding: 0 0 0 18px;
    margin: 14px 0 8px;
    align-self: stretch;
    max-width: 240px;
    width: 100%;
}

.efpf-card .efpf-card__features li {
    font-family: "Sofia Sans", sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    margin: 0;
    color: #FFFFFF;
    text-align: left;
}

.efpf-card .efpf-card__features sup {
    color: #FFF265;
    margin-left: 1px;
}

/* Painike */
.efpf-card .efpf-card__cta-wrapper {
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding-top: 14px;
}

.efpf-card .efpf-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    color: #3C3E3F;
    font-family: "Sofia Sans", sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    padding: 12px 36px;
    border-radius: 20px;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    line-height: 1;
}

.efpf-card .efpf-card__cta:hover,
.efpf-card .efpf-card__cta:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    color: #3C3E3F;
    text-decoration: none;
}

/* Footer-teksti — kapeampi, keskitetty, hieman opacity */
.efpf-card .efpf-card__footer {
    margin: 14px auto 0;
    font-family: "Sofia Sans", sans-serif;
    font-size: 12px;
    line-height: 15px;
    font-weight: 400;
    color: #FFFFFF;
    text-align: center;
    max-width: 250px;
    align-self: center;
}

/* Jäsenyyskortin alaosalle pieni lisäpadding footer-tekstin alle */
.efpf-card.efpf-card--membership .efpf-card__footer,
.efpf-card.efpf-card--extra .efpf-card__footer,
.efpf-card.efpf-card--kertakaynti .efpf-card__footer {
    margin-bottom: 6px;
}

/* Vaalealla kortilla footer-teksti on tumma (riittävän kontrasti valkoisella) */
.efpf-card.efpf-card--white .efpf-card__footer {
    color: #3C3E3F;
}

/* ===== Mobile-säädöt ===== */

@media (max-width: 600px) {
    .efpf-card .efpf-card__price {
        font-size: 42px;
        white-space: nowrap; /* "15,90 €" ei rivity oudosti kapeissa korteissa */
    }
    .efpf-card.efpf-card--campaign .efpf-card__type,
    .efpf-card.efpf-card--membership .efpf-card__type,
    .efpf-card.efpf-card--extra .efpf-card__type,
    .efpf-card.efpf-card--kertakaynti .efpf-card__type {
        font-size: 28px;
    }
}

/* ===== Valkoinen kortti (kertakäynti / vaalea extra) ===== */

.efpf-card.efpf-card--white {
    background-color: #FFFFFF;
    background-image: var(--efpf-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #3C3E3F;
    border-radius: 22px;
    overflow: hidden;
    max-width: 320px;
}

.efpf-card.efpf-card--white .efpf-card__body {
    flex: 1 1 auto;
    padding: 40px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-height: 415px;
    text-align: center;
}

.efpf-card.efpf-card--white .efpf-card__price {
    margin: 0;
    font-family: "ScoutCondensed-BoldItalic", "ScoutCondItalic", "Sofia Sans", sans-serif;
    font-size: 36px;
    font-style: normal;
    font-weight: normal;
    line-height: 1.05;
    color: #3C3E3F;
}

/* Vaalea extra/kertakäynti -kortti: hinta isolla, kuten tummissa korteissa */
.efpf-card.efpf-card--white.efpf-card--extra .efpf-card__price,
.efpf-card.efpf-card--white.efpf-card--kertakaynti .efpf-card__price {
    font-size: 50px;
    margin: 6px 0 0;
    line-height: 1;
    text-align: center;
}

.efpf-card.efpf-card--white .efpf-card__subprice {
    margin: 0;
    font-family: "Sofia Sans", sans-serif;
    font-size: 20px;
    color: #3C3E3F;
}

.efpf-card.efpf-card--white .efpf-card__features {
    text-align: left;
    margin: 8px auto;
}

.efpf-card.efpf-card--white .efpf-card__features li {
    color: #3C3E3F;
}

.efpf-card.efpf-card--white .efpf-card__features sup {
    color: #3C3E3F;
}

.efpf-card.efpf-card--white .efpf-card__cta {
    background: #3C3E3F;
    color: #FFFFFF;
}

.efpf-card.efpf-card--white .efpf-card__cta:hover,
.efpf-card.efpf-card--white .efpf-card__cta:focus {
    color: #FFFFFF;
}

/* ===== PT-modaali ===== */

.efpf-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    animation: efpf-fade-in 0.2s ease;
    font-family: "Sofia Sans", sans-serif;
}

.efpf-modal.is-open {
    display: flex;
}

.efpf-modal__dialog {
    position: relative;
    background: #FFFFFF;
    color: #3C3E3F;
    border-radius: 16px;
    padding: 32px 28px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    animation: efpf-slide-up 0.25s ease;
}

.efpf-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #555;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.efpf-modal__close:hover {
    background: #f0f0f0;
    color: #000;
}

.efpf-modal .efpf-modal__title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    padding-right: 28px;
}

.efpf-modal__body {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.5;
    color: #555;
}

.efpf-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.efpf-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 20px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: 0.5px;
}

.efpf-modal__btn--primary {
    background: #3C3E3F;
    color: #FFFFFF;
}

.efpf-modal__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    color: #FFFFFF;
}

.efpf-modal__btn--secondary {
    background: transparent;
    color: #3C3E3F;
    border: 1px solid #ddd;
}

.efpf-modal__btn--secondary:hover {
    background: #f5f5f5;
    color: #3C3E3F;
}

@keyframes efpf-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes efpf-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Tyhjän markerin piilotus ===== */

.efpf-empty-marker {
    display: none;
}

/* ===== Globaalin kortin pikkusäätö ===== */
/* Globaalissa kortissa hintateksti on pitempi ("alkaen 36,90 €/kk") kuin
 * per-center kortin "20,00 €" → pienempi fontti ja word-wrap salittu. */
.efpf-card.efpf-card--global .efpf-card__price {
    font-size: 28px;
    line-height: 1.15;
    white-space: normal;
}

/* ===== Keskusvalitsin-modaali ===== */

/* ===== Keskusvalitsin-modaali =====
 * Rakenne:
 *   .efpf-center-modal             — fixed full-screen container, hoitaa overflow + scrollin
 *     .efpf-center-modal__overlay  — tumma backdrop (klikattava sulkemaan)
 *     .efpf-center-modal__dialog   — keltainen sisältöalue, flex-column, ei scrollia
 *       ::before                   — keltainen overlay taustakuvan päällä
 *       __close                    — sulje-nappi (sticky)
 *       __title                    — otsikko
 *       __list                     — keskusten lista (column-count)
 */

.efpf-center-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    /* Container hoitaa scrollin koko modaali-elementille (sisältö + paddingit) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Padding antaa tilaa dialogin ympärille, ei jää näytön reunaan kiinni */
    padding: 24px;
    box-sizing: border-box;
}

.efpf-center-modal[hidden] {
    display: none;
}

.efpf-center-modal__overlay {
    /* Tumma backdrop ulottuu koko viewport-leveydelle, pysyy paikallaan kun scrollataan */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
}

.efpf-center-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(820px, 100%);
    /* Ei max-height-rajoitusta → dialog kasvaa sisällön mukaan, .efpf-center-modal hoitaa scrollin.
     * min-height varmistaa että lyhyellä listalla modaali näyttää tasapainoiselta */
    min-height: auto;
    margin: 0 auto; /* keskitys horisontaalisesti */
    background-color: #FFE94B;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 18px;
    padding: 56px 48px 48px;
    box-sizing: border-box;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
    animation: efpf-slide-up 0.25s ease both;

    /* Overlay-asetukset — säädettävissä inline-tyylillä per modaali tai DevToolsista */
    --overlay-color: #FFE94B;
    --overlay-opacity: 0.85;
}

/* Keltainen overlay taustakuvan päällä — opacity ja väri CSS-muuttujista */
.efpf-center-modal__dialog::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--overlay-color, #FFE94B);
    opacity: var(--overlay-opacity, 0.85);
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
}

/* Sisältö overlayn päälle */
.efpf-center-modal__dialog > * {
    position: relative;
    z-index: 2;
}

.efpf-center-modal__close {
    /* Sticky: pysyy näkyvissä kun pitkää listaa scrollataan */
    position: sticky;
    top: 0;
    /* Sijoita oikeaan yläkulmaan käyttäen marginia, koska sticky ei salli top/right yhdessä luotettavasti */
    margin-left: auto;
    margin-right: -18px;
    margin-top: -42px;
    display: block;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    border-radius: 999px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #1a1a1a;
    padding: 0;
    z-index: 3;
}

.efpf-center-modal__close:hover {
    background: rgba(255, 255, 255, 0.7);
}

.efpf-center-modal__title {
    margin: -20px 0 28px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

/* List: 2 saraketta desktop/tablet, 1 mobiilissa */
.efpf-center-modal__list {
    column-count: 2;
    column-gap: 48px;
}

@media (max-width: 900px) {
    .efpf-center-modal__dialog { padding: 48px 32px 32px; }
}

@media (max-width: 600px) {
    /* Mobiili: täysleveä modaali, ei reunapaddingia, 1 sarake */
    .efpf-center-modal {
        padding: 0;
    }
    .efpf-center-modal__dialog {
        width: 100%;
        border-radius: 0; /* kun täysleveä, ei pyöristyksiä */
        padding: 56px 24px 32px;
        min-height: 100vh; /* keltainen tausta ulottuu näytön alalaitaan */
    }
    .efpf-center-modal__list {
        column-count: 1;
    }
    .efpf-center-modal__title {
        font-size: 22px;
        margin: -20px 0 18px 0;
    }
    .efpf-center-modal__close {
        margin-right: 0;
        margin-top: -42px;
    }
}

.efpf-center-modal__group {
    break-inside: avoid;
    margin-bottom: 18px;
    page-break-inside: avoid; /* legacy */
}

.efpf-center-modal__group-label {
    display: inline-block;
    background: #FFFFFF;
    color: #1a1a1a;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
}

.efpf-center-modal__centers {
    list-style: none;
    margin: 0;
    padding: 0;
}

.efpf-center-modal__centers li {
    margin: 0;
    padding: 0;
}

.efpf-center-modal__center-link {
    display: block;
    padding: 6px 0;
    color: #1a1a1a;
    font-weight: 700;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.15s ease;
}

.efpf-center-modal__center-link:hover,
.efpf-center-modal__center-link:focus {
    color: #E5005B;
}

.efpf-buy-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

html.efpf-modal-open {
    overflow: hidden;
}

/* ===== Pricing tabs (oma tab-rakenne, [efpf_pricing_tabs]) ===== */

.efpf-tabs {
    width: 100%;
    max-width: 1008px;
    margin: 0 auto;
}

/* Tab-nappien rivi */
.efpf-tabs__nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    /* Reilu tila korttien yläpuolelle */
    margin: 0 0 72px;
}

/* Yksittäinen tab-nappi (INAKTIIVINEN default):
 * - Tummempi khaki-keltainen pohja (#DBD483)
 * - VALKOINEN teksti (selkeästi vaaleampi kuin pohja → passiivinen ilme)
 */
.efpf-tabs__btn {
    appearance: none;
    border: none;
    background: #DBD483;
    color: #FFFFFF;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 14px 40px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
}

.efpf-tabs__btn:hover {
    /* Hover: hieman vaaleampi pohja, teksti säilyy valkoisena */
    background: #C9C172;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

/* AKTIIVINEN tab — VAALEA pohja, TUMMA teksti, korotettu varjo */
.efpf-tabs__btn.is-active {
    background: #F2EA99;
    color: #1a1a1a;
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.18),
        inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.efpf-tabs__btn.is-active:hover {
    background: #F2EA99;
    color: #1a1a1a;
}

.efpf-tabs__btn:focus {
    outline: none;
}

.efpf-tabs__btn:focus-visible {
    /* Saavutettavuus: hienovarainen tumma fokusvarjo, ei pinkkiä rengasta */
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.10);
}

.efpf-tabs__btn.is-active:focus-visible {
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.35),
        0 6px 16px rgba(0, 0, 0, 0.18),
        inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Tab-paneelit — vain aktiivinen näkyy */
.efpf-tabs__panel {
    display: block;
}
.efpf-tabs__panel[hidden] {
    display: none;
}

/* ============================================================
 * MOBIILILAYOUT (max-width: 600px) — refaktoroitu yksi blokki
 * ============================================================
 *
 * Käyttäytymismalli mobiilissa:
 *
 *   1. Tab-widget [efpf_pricing_tabs] ottaa aina koko näytön leveyden.
 *      Tab-pillerit ovat allekkain, kukin täysleveä (width: 100%).
 *
 *   2. Korttirivi (.efpf-cards) toimii kahdella tavalla:
 *
 *      A) MULTI-CARD (2+ korttia): horisontaalinen peek-carousel.
 *         Kortit 72% säiliön leveydestä, ~33% peek seuraavasta.
 *         CSS scroll-snap pitää kortit kohdistettuina.
 *
 *      B) SINGLE-CARD (1 kortti): keskitetty kortti max-width 320px.
 *         Tunnistus: PHP lisää `.efpf-cards--single` -luokan, mutta
 *         varmistuksena käytämme myös :has(:only-child) -selectoria.
 * ============================================================ */

@media (max-width: 600px) {

    /* --- Elementor Shortcode -widget joka sisältää tab-rakenteen --- *
     * Elementorin flex-container (.e-con-inner) antaa widgeteille flex: 0 1 auto,
     * joten widget kutistuu sisältönsä mukaan. Kun korttirivissä on yksittäinen
     * 320px-kortti, widget kutistuu sen mukana 226px:iin ja vie tab-widgetin
     * mukanaan. Pakotetaan widget täysleveyteen kun se sisältää .efpf-tabs.   */
    .elementor-widget-shortcode:has(.efpf-tabs) {
        width: 100%;
        flex: 1 1 100%;
        max-width: 100%;
    }
    .elementor-shortcode:has(.efpf-tabs) {
        width: 100%;
    }

    /* --- Tab-widget: pakota täysleveys --- */
    .efpf-tabs {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .efpf-tabs__nav {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 52px;
        width: 100%;
        align-self: stretch;
    }
    .efpf-tabs__btn {
        width: 100%;
        min-width: 0;
        padding: 14px 24px;
    }
    .efpf-tabs__panel {
        width: 100%;
        box-sizing: border-box;
    }
    /* Korttirivi tabin sisällä: pakotetaan täysleveyteen jotta scroll-area ja
     * peek-laskenta toimivat 100%-pohjalta (ei kutistuneella vanhemmalla). */
    .efpf-tabs__panel > .efpf-cards {
        width: 100%;
        box-sizing: border-box;
    }

    /* --- Korttirivi: MULTI-CARD (default) — horisontaalinen peek-carousel --- */
    .efpf-cards {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 12px;

        /* Scroll + snap */
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;

        /* Padding: tilaa Suositus-badgelle ylhäällä + peek-padding sivuilla */
        padding: 32px 4% 12px 4%;
        scroll-padding: 0 4%;

        /* Pakota täysleveys; nollaa max-width grid-tilan jälkeen */
        width: 100%;
        max-width: 100%;
        margin: 0;

        /* Nollaa grid-template-columns kaikilta varianteilta */
        grid-template-columns: none;

        /* Piilota scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .efpf-cards::-webkit-scrollbar {
        display: none;
    }

    .efpf-cards > .efpf-card,
    .efpf-cards > .efpf-card-wrap {
        flex: 0 0 72%;
        max-width: 72%;
        min-width: 72%;
        width: 72%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    /* Featured-kortin sisällä oleva article venyy wrapperin leveyteen */
    .efpf-card-wrap > .efpf-card {
        max-width: 100%;
        width: 100%;
    }

    /* Tyhjä marker ei saa ottaa tilaa */
    .efpf-cards > .efpf-empty-marker {
        flex: 0 0 0;
        display: none;
    }

    /* --- Korttirivi: SINGLE-CARD override — kortti keskitettynä 320px --- */
    .efpf-cards--single,
    .efpf-cards:has(> .efpf-card:only-child),
    .efpf-cards:has(> .efpf-card-wrap:only-child) {
        /* Vaihda layoutia: pysähtynyt keskitys, ei scrollia */
        flex-direction: column;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        overflow: visible;
        scroll-snap-type: none;
        padding: 0;
        gap: 0;
    }

    .efpf-cards--single > .efpf-card,
    .efpf-cards--single > .efpf-card-wrap,
    .efpf-cards:has(> .efpf-card:only-child) > .efpf-card,
    .efpf-cards:has(> .efpf-card-wrap:only-child) > .efpf-card-wrap {
        flex: 0 0 auto;
        max-width: 320px;
        min-width: 0;
        width: 100%;
        scroll-snap-align: none;
        margin-left: auto;
        margin-right: auto;
    }
}
