/* ── Grid ── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 280px);
    grid-auto-rows: 1fr;
    gap: 20px;
    justify-content: center;
    justify-items: center;
    align-items: stretch;
    max-width: calc(280px * 4 + 20px * 3);
    margin-inline: auto;
}

/* ── Card ── */
.card {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--secondary-color);
    border-radius: 16px;
    padding: 24px 20px;
    width: 100%;
    height: 100%;
    text-align: center;
    background: #fff;
    transition: transform 0.2s;
    box-sizing: border-box;
}

.card:hover {
    transform: translateY(-4px);
}

.card--featured {
    background: var(--secondary-color);
    color: var(--text-color);
}

/* ── Icon (optional) ── */
.card-icon {
    margin-bottom: 8px;
    min-height: 2rem;
}

/* ── Badge (optional) ── */
.card-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

/* ── Content ── */
.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.25;
    margin: 0 0 12px;
    color: inherit;
    /* clamp to 2 lines, reserve the space, ellipsis overflow */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.card-value {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.1;
    margin: auto 0 16px;
    color: var(--text-color);
    overflow-wrap: anywhere;
    min-height: 2.2rem;
}

.card--featured .card-value {
    color: var(--text-color);
}

.card-label {
    font-size: 1.25rem;
    opacity: 0.6;
    margin: 4px 0 16px;
    color: inherit;
}

/* ── Description (optional) ── */
.card-desc {
    font-size: 0.875rem;
    opacity: 0.7;
    line-height: 1.4;
    margin: 0 0 12px;
    /* clamp to 3 lines, reserve the space, ellipsis overflow */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.2em;
}

.card--featured .button--cancel {
    background-color: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* ── Responsive ── */
@media screen and (max-width: 750px) {
    .cards-grid {
    grid-template-columns: 1fr;
    }

    .card {
    width: 100%;
    max-width: 300px;
    transition: none;
    }

    .card:hover {
    transform: none;
    }

    .cards-carousel {
    --carousel-height: 26rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    max-width: none;
    height: var(--carousel-height);
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    }

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

    .cards-carousel > .card {
    flex: 0 0 auto;
    width: min(85vw, 320px);
    height: 100%;
    max-width: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    }
}
@media (hover: none) {
    .card {
    transition: none;
    }

    .card:hover {
    transform: none;
    }
}

.section--disabled {
    opacity: 0.45;
}
