.card-grid-section {
    width: 100%;
}

.card-grid-section.is-filtering .card-grid-wrapper {
    opacity: 0.45;
    pointer-events: none;
}

.card-grid-filter {
    margin-bottom: 28px;
}

.card-grid-filter-label {
    margin-bottom: 10px;
    color: #333333;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.card-grid-filter-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-grid-filter-dropdown {
    position: relative;
}

.card-grid-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 168px;
    height: 40px;
    padding: 0 16px 0 18px;
    border: 1px solid #d0d0d0;
    border-radius: 999px;
    background: #ffffff;
    color: #111111;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.card-grid-filter-toggle[aria-expanded="true"] {
    border-color: #bdbdbd;
}

.card-grid-filter-caret {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #111111;
}

.card-grid-filter-clear {
    height: 40px;
    padding: 0 22px;
    border: none;
    border-radius: 999px;
    background: #223244;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.card-grid-filter-clear.is-hidden {
    display: none;
}

.card-grid-filter-clear:disabled {
    opacity: 0.7;
    cursor: wait;
}

.card-grid-filter-selected {
    margin-top: 10px;
    color: #6f6f6f;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.card-grid-filter-selected.is-hidden {
    display: none;
}

.card-grid-filter-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    min-width: 280px;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.card-grid-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid #ececec;
    color: #222222;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-transform: capitalize;
    cursor: pointer;
    user-select: none;
}

.card-grid-filter-option:last-child {
    border-bottom: none;
}

.card-grid-filter-option:hover {
    background: #f8f8f8;
}

.card-grid-filter-checkbox {
    width: 15px;
    height: 15px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #0d6efd;
    cursor: pointer;
}

.card-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.card-grid-wrapper > p {
    grid-column: 1 / -1;
    margin: 0;
}

.card-grid-wrapper .card-grid-item {
    position: relative;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 250px;
    min-height: 0;
    margin: 0;
    padding: 24px 16px;
    border-radius: 24px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffffff;
    text-decoration: none;
}

.card-grid-wrapper .card-grid-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 1) 100%);
    z-index: 1;
}

.card-grid-wrapper .card-grid-item h3 {
    position: relative;
    z-index: 9;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

.card-grid-wrapper .card-grid-item.is-new {
    animation: cardGridFadeIn 0.4s ease;
}

@keyframes cardGridFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.card-grid-view-all {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.card-grid-view-all.is-hidden {
    display: none;
}

.card-grid-view-all .card-grid-view-all-btn.btn {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 140px;
    min-height: 48px;
    padding: 12px 28px !important;
    border-radius: 50px !important;
    font-weight: 500;
    line-height: 1.2;
    border: 1px solid #54843C !important;
}

.card-grid-view-all-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid rgba(84, 132, 60, 0.25);
    border-top-color: #54843C;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: cardGridSpin 0.6s linear infinite;
}

.card-grid-view-all-btn.is-loading {
    pointer-events: none;
    cursor: wait;
}

.card-grid-view-all-btn.is-loading .card-grid-view-all-text {
    visibility: hidden;
}

.card-grid-view-all-btn.is-loading::after {
    visibility: hidden;
}

.card-grid-view-all-btn.is-loading .card-grid-view-all-spinner {
    display: block;
}

@keyframes cardGridSpin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media screen and (max-width: 1200px) {
    .card-grid-wrapper {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media screen and (max-width: 990px) {
    .card-grid-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media screen and (max-width: 575px) {
    .card-grid-filter-toggle {
        min-width: 0;
        width: 100%;
    }

    .card-grid-filter-panel {
        min-width: 100%;
        right: 0;
    }

    .card-grid-wrapper {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .card-grid-wrapper .card-grid-item {
        padding: 16px 12px;
        border-radius: 16px;
    }

    .card-grid-wrapper .card-grid-item h3 {
        font-size: 14px;
    }

    .card-grid-view-all {
        margin-top: 24px;
    }
}
