/**
 * EasyFit Coaching Shop — Frontend
 *
 * Vaiheittainen valmennusverkkokauppa. Yhdenmukainen tyyli product-fetcheriin
 * (Sofia Sans, ScoutCondItalic, samat värit, samat radius-arvot).
 *
 * Specificity-huomio: kaikki säännöt prefiksoitu .efcs-shop:lla, jotta teema
 * (Elementor-kit-37) ei voita.
 */

/* ===== Pohjat ===== */

.efcs-shop {
    font-family: "Sofia Sans", sans-serif;
    color: #3C3E3F;
    width: 100%;
    box-sizing: border-box;
}

.efcs-shop *,
.efcs-shop *::before,
.efcs-shop *::after {
    box-sizing: border-box;
}

.efcs-shop[hidden] { display: none; }

/* ===== Kehitystila-banneri (vain adminille) ===== */
.efcs-shop .efcs-dev-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff3cd;
    border: 1px solid #ffd66f;
    border-left: 4px solid #f39c12;
    color: #66481a;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.5;
}

.efcs-shop .efcs-dev-banner__icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.efcs-shop .efcs-dev-banner__text strong {
    display: block;
    color: #523305;
    margin-bottom: 2px;
}

.efcs-shop .efcs-dev-banner code {
    background: rgba(0,0,0,0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.efcs-error {
    background: #fff3cd;
    color: #66481a;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #ffd66f;
    font-size: 14px;
    line-height: 1.5;
}

.efcs-loading {
    padding: 32px;
    text-align: center;
    color: #888;
    font-size: 14px;
    grid-column: 1 / -1;
}

.efcs-visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ===== Yhteenveto ylhäällä ===== */

.efcs-shop .efcs-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #f7f7f7;
    border-radius: 14px;
    border: 1px solid #ececec;
}

.efcs-shop .efcs-summary:empty,
.efcs-shop .efcs-summary[hidden] { display: none; }

/* Piilota koko summary kun yksikään rivi ei näy */
.efcs-shop .efcs-summary:not(:has(.efcs-summary__row:not([hidden]))) {
    display: none;
}

.efcs-shop .efcs-summary__row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

.efcs-shop .efcs-summary__row[hidden] { display: none; }

.efcs-shop .efcs-summary__label {
    font-weight: 700;
    color: #3C3E3F;
}

.efcs-shop .efcs-summary__value {
    color: #555;
    flex: 1 1 auto;
}

.efcs-shop .efcs-summary__change {
    background: transparent;
    border: 0;
    color: #3C3E3F;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    font-family: inherit;
}

.efcs-shop .efcs-summary__change:hover {
    color: #E5005B;
}

/* ===== Vaiheet ===== */

.efcs-shop .efcs-step {
    margin-bottom: 32px;
    animation: efcs-fade-in 0.25s ease;
}

.efcs-shop .efcs-step[hidden] {
    display: none;
}

.efcs-shop .efcs-step__title {
    font-family: "ScoutCondItalic", "Sofia Sans", sans-serif;
    font-style: normal;
    font-weight: normal;
    font-size: 32px;
    color: #3C3E3F;
    margin: 0 0 16px;
    line-height: 1.1;
}

.efcs-shop .efcs-step__hint,
.efcs-shop .efcs-step__empty {
    font-size: 14px;
    color: #555;
    margin: 0 0 16px;
    line-height: 1.5;
}

/* ===== Admin-debug-paneeli ===== */
.efcs-shop .efcs-debug {
    margin-top: 20px;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
}

.efcs-shop .efcs-debug summary {
    cursor: pointer;
    font-weight: 700;
    color: #555;
    user-select: none;
}

.efcs-shop .efcs-debug__content {
    margin-top: 12px;
}

.efcs-shop .efcs-debug__btn {
    display: inline-block;
    padding: 8px 18px;
    background: #3C3E3F;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.efcs-shop .efcs-debug__btn:hover {
    background: #1a1a1a;
}

.efcs-shop .efcs-debug__report code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

.efcs-shop .efcs-step__pre-load {
    padding: 16px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px dashed #ddd;
    font-size: 14px;
    color: #666;
}

@keyframes efcs-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Tuotekortit ===== */

.efcs-shop .efcs-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

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

@media (max-width: 600px) {
    .efcs-shop .efcs-cards {
        grid-template-columns: 1fr;
    }
}

.efcs-shop .efcs-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #ececec;
    border-radius: 18px;
    padding: 24px 22px 22px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.efcs-shop .efcs-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: #ddd;
}

.efcs-shop .efcs-card.is-selected {
    border-color: #3C3E3F;
    box-shadow: 0 0 0 2px #3C3E3F;
}

.efcs-shop .efcs-card__name {
    font-family: "ScoutCondItalic", "Sofia Sans", sans-serif;
    font-style: normal;
    font-weight: normal;
    font-size: 28px;
    color: #3C3E3F;
    margin: 0 0 8px;
    line-height: 1.1;
}

.efcs-shop .efcs-card__price {
    font-family: "ScoutCondItalic", "Sofia Sans", sans-serif;
    font-style: normal;
    font-weight: normal;
    font-size: 36px;
    color: #3C3E3F;
    margin: 0 0 12px;
    line-height: 1;
}

.efcs-shop .efcs-card__price-currency {
    font-size: 22px;
}

.efcs-shop .efcs-card__price-from {
    display: block;
    font-family: "Sofia Sans", sans-serif;
    font-size: 13px;
    color: #888;
    margin-bottom: 2px;
    font-weight: 400;
}

.efcs-shop .efcs-card__description {
    font-family: "Sofia Sans", sans-serif;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 16px;
    flex: 1 1 auto;
}

.efcs-shop .efcs-card__select {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3C3E3F;
    color: #FFFFFF;
    border: 0;
    border-radius: 20px;
    padding: 10px 28px;
    font-family: "Sofia Sans", sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    align-self: flex-start;
    transition: background 0.15s ease;
}

.efcs-shop .efcs-card__select:hover,
.efcs-shop .efcs-card__select:focus {
    background: #1a1a1a;
}

.efcs-shop .efcs-card.is-single-product .efcs-card__name::after {
    content: '';
}

/* ===== Keskuksen valinta ===== */

.efcs-shop .efcs-center-select select {
    width: 100%;
    max-width: 480px;
    padding: 12px 16px;
    font-family: "Sofia Sans", sans-serif;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #FFFFFF;
    color: #3C3E3F;
}

.efcs-shop .efcs-center-select select:focus {
    outline: none;
    border-color: #3C3E3F;
    box-shadow: 0 0 0 3px rgba(60, 62, 63, 0.15);
}

/* ===== Valmentajakortit ===== */

.efcs-shop .efcs-trainers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.efcs-shop .efcs-trainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    border: 1px solid #ececec;
    border-radius: 14px;
    background: #FFFFFF;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.efcs-shop .efcs-trainer:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border-color: #ddd;
}

.efcs-shop .efcs-trainer.is-selected {
    border-color: #3C3E3F;
    box-shadow: 0 0 0 2px #3C3E3F;
}

.efcs-shop .efcs-trainer__photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    background: #f0f0f0;
    display: block;
}

.efcs-shop .efcs-trainer__photo--placeholder {
    background: #e8e8e8 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23bbb'><path d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>") center/65% no-repeat;
}

.efcs-shop .efcs-trainer__name {
    font-family: "Sofia Sans", sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #3C3E3F;
    margin: 0 0 8px;
    line-height: 1.2;
}

.efcs-shop .efcs-trainer__select {
    background: transparent;
    border: 1px solid #3C3E3F;
    color: #3C3E3F;
    border-radius: 16px;
    padding: 6px 18px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-top: auto;
    transition: background 0.15s ease, color 0.15s ease;
}

.efcs-shop .efcs-trainer__select:hover {
    background: #3C3E3F;
    color: #FFFFFF;
}

.efcs-shop .efcs-trainer.is-selected .efcs-trainer__select {
    background: #3C3E3F;
    color: #FFFFFF;
}

/* ===== Sopimuksen kesto ===== */

.efcs-shop .efcs-duration {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 480px;
}

.efcs-shop .efcs-duration__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    font-size: 15px;
}

.efcs-shop .efcs-duration__option:hover {
    border-color: #aaa;
}

.efcs-shop .efcs-duration__option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #3C3E3F;
    flex-shrink: 0;
}

.efcs-shop .efcs-duration__option input[type="radio"]:checked + span {
    font-weight: 700;
}

.efcs-shop .efcs-duration__option:has(input:checked) {
    border-color: #3C3E3F;
    background: #fafafa;
}

.efcs-shop .efcs-duration__months {
    margin-top: 6px;
    padding-left: 12px;
}

.efcs-shop .efcs-duration__months[hidden] {
    display: none;
}

.efcs-shop .efcs-duration__months select {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #FFFFFF;
    color: #3C3E3F;
}

.efcs-shop .efcs-duration__months select:focus {
    outline: none;
    border-color: #3C3E3F;
    box-shadow: 0 0 0 3px rgba(60, 62, 63, 0.15);
}

/* ===== Yhteenveto + osta ===== */

.efcs-shop .efcs-final {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.efcs-shop .efcs-final__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid #ececec;
    font-size: 15px;
}

.efcs-shop .efcs-final__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.efcs-shop .efcs-final__row--total {
    font-weight: 700;
    font-size: 18px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 2px solid #3C3E3F;
}

.efcs-shop .efcs-final__label {
    color: #555;
}

.efcs-shop .efcs-final__value {
    color: #3C3E3F;
    font-weight: 600;
    text-align: right;
}

.efcs-shop .efcs-buy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #E5005B;
    color: #FFFFFF;
    text-decoration: none;
    font-family: "Sofia Sans", sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    padding: 14px 36px;
    border-radius: 24px;
    border: 0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.efcs-shop .efcs-buy-button:hover,
.efcs-shop .efcs-buy-button:focus {
    color: #FFFFFF;
    background: #B5004A;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(229, 0, 91, 0.3);
    text-decoration: none;
}

.efcs-shop .efcs-buy-button.is-disabled,
.efcs-shop .efcs-buy-button[aria-disabled="true"] {
    background: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}
