/* ─── MODULAR EXPANDABLE GRID SYSTEM ─── */

.grid-wrapper {
    width: 100%;
    margin: var(--ze-space-md, 16px) 0;
}

/* 1. Grid Container & Responsiveness */
.grid-container {
    display: grid;
    gap: var(--ze-space-lg, 24px);
    grid-template-columns: repeat(var(--grid-cols-mobile, 1), minmax(0, 1fr));
}

@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(var(--grid-cols-tablet, 2), minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(var(--grid-cols-desktop, 3), minmax(0, 1fr));
    }
}

/* Auto-fill columns layout mode when columns count is empty or 0 */
.grid-container.grid-auto-cols {
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width, 280px), 1fr));
}

/* 2. Micro-Animations for Card Reveal */

/* Fade-In Animation */
@keyframes gridFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.grid-card.animate-fade-in {
    animation: gridFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide-Up Animation */
@keyframes gridSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.grid-card.animate-slide-up {
    animation: gridSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scale-Up Animation */
@keyframes gridScaleUp {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.grid-card.animate-scale-up {
    animation: gridScaleUp 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 3. Action Buttons & Styling */
.grid-show-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ze-space-sm, 8px);
    background-color: var(--ze-color-primary, #000000);
    color: var(--ze-color-on-primary, #ffffff);
    border: none;
    border-radius: var(--ze-radius-full, 9999px);
    padding: var(--ze-space-sm, 8px) var(--ze-space-xl, 32px);
    font-family: var(--ze-font-label-md-family, Geist, sans-serif);
    font-size: var(--ze-font-label-md-size, 14px);
    font-weight: var(--ze-font-label-md-weight, 600);
    line-height: var(--ze-font-label-md-line-height, 16px);
    letter-spacing: var(--ze-font-label-md-letter-spacing, 0.05em);
    cursor: pointer;
    box-shadow: var(--ze-shadow-level-1, 0px 1px 3px rgba(15, 23, 42, 0.05));
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-show-more-btn:hover {
    background-color: var(--ze-color-secondary, #006c49);
    transform: translateY(-2px);
    box-shadow: var(--ze-shadow-level-2, 0px 10px 15px -3px rgba(15, 23, 42, 0.08));
}

.grid-show-more-btn:active {
    transform: translateY(0);
}

.grid-show-more-btn span {
    font-size: 18px;
}

/* 4. Glowing Linear Loader Bar & Transitions */
.grid-wrapper {
    position: relative;
}

.grid-loader-bar {
    position: absolute;
    top: -6px; /* Align slightly above filters */
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--ze-color-secondary, #006c49) 50%, transparent 100%);
    background-size: 200% 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    border-radius: var(--ze-radius-sm, 4px);
}

.grid-wrapper.is-filtering .grid-loader-bar {
    opacity: 1;
    animation: gridLoading 1.2s infinite linear;
}

@keyframes gridLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Smooth Container Fade during filter */
.grid-container {
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-wrapper.is-filtering .grid-container {
    opacity: 0.35;
}

/* 5. No Results Style */
.grid-no-results {
    text-align: center;
    padding: var(--ze-space-2xl, 48px) var(--ze-space-md, 16px);
    color: var(--ze-color-on-surface-variant, #45464d);
    font-family: var(--ze-font-body-md-family, Inter, sans-serif);
    font-size: 16px;
    animation: gridFadeIn 0.4s ease forwards;
}

.grid-no-results span.material-symbols-outlined {
    font-size: 48px;
    display: block;
    margin-bottom: var(--ze-space-sm, 12px);
    opacity: 0.5;
    color: var(--ze-color-primary, #000000);
}

/* 6. Grid Filters Divider Styling */
.grid-filters {
    border-bottom: var(--ze-border-default, 1px solid #E2E8F0);
    padding-bottom: var(--ze-space-lg, 24px);
    margin-bottom: var(--ze-space-xl, 32px) !important;
}
