/* ==========================================================================
   1. BASE Styles & Utils
   ========================================================================== */

/* Custom Range Slider Styles */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
}

input[type=range]:focus {
    outline: none;
}

/* Hide the native track */
input[type=range]::-webkit-slider-runnable-track {
    background: transparent;
    border: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: all;
    width: 20px;
    height: 20px;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    margin-top: -16px;
}

input[type=range]::-moz-range-thumb {
    pointer-events: all;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    margin-top: -16px;
}

/* Gradient card backgrounds */
.gradient-card {
    color: white;
}

.card-chase {
    background: linear-gradient(135deg, #1040C1 0%, #002685 100%);
}

.card-amex {
    background: linear-gradient(135deg, #94A3B8 0%, #64748B 100%);
}

.card-platinum {
    background: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%);
    color: #1F2937;
}

.card-gold {
    background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
    color: #78350F;
}

.card-capital-one {
    background: linear-gradient(135deg, #002D5C 0%, #001529 100%);
}

.card-citi {
    background: linear-gradient(135deg, #004C97 0%, #002C5F 100%);
}

.card-default {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
}

/* ==========================================================================
   2. PAGE LAYOUT
   ========================================================================== */

.main-content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.page-header {
    margin-bottom: 2.5rem;
}

.header-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.header-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}

.header-count {
    font-size: 1rem;
    font-weight: 600;
    color: #94A3B8;
}

.header-subtitle {
    color: #64748B;
    font-size: 1.125rem;
    margin: 0;
}

/* Main Grid Structure */
.main-grid-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
}

.cards-content-column {
    min-width: 0;
}

.cards-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Search Bar */
.search-bar-container {
    margin-bottom: 2rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 0 !important;
    height: 100% !important;
    color: #94A3B8;
    font-size: 24px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    line-height: 1;
    margin: 0 !important;
    padding: 0 !important;
    padding-bottom: 12px !important;
}

.search-input {
    width: 100%;
    height: 56px;
    padding: 0 1.25rem 0 4rem;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    font-size: 1rem;
    outline: none;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Category Pills */
.category-pills-container {
    margin-bottom: 2rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-pill-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-pill-active {
    border: none;
}

.category-pill-inactive {
    border: 1px solid #E2E8F0;
    background: white;
    color: #64748B;
}

/* ==========================================================================
   3. SIDEBAR & FILTERS
   ========================================================================== */

.filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.mobile-filter-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}

.close-filter-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #64748B;
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.filter-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.filter-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #6366F1;
}

.filter-subtitle {
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748B;
    margin: 0 0 1.25rem 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Range Slider */
.range-slider-container {
    position: relative;
    height: 4px;
    background: #E2E8F0;
    border-radius: 2px;
    margin-bottom: 1rem;
}

.range-slider-track {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background: #6366F1;
    border-radius: 2px;
}

.range-input {
    position: absolute;
    width: calc(100% + 40px);
    height: 100%;
    -webkit-appearance: none;
    pointer-events: none;
    margin: 0;
    top: 0;
    left: -20px;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.range-input:focus,
.range-input:active {
    outline: none;
    border: none;
    box-shadow: none;
}

.range-input::-webkit-slider-thumb:focus,
.range-input::-webkit-slider-thumb:active {
    outline: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    /* Keep shadow but remove default outlines */
}

.range-input::-moz-range-thumb:focus,
.range-input::-moz-range-thumb:active {
    outline: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin: 0;
}

.range-label-text {
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 500;
}

.range-label-text:first-child {
    /* transform: translateX(0); default */
}

.range-label-text:last-child {
    /* transform: translateX(0); default */
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    min-height: 24px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    border: 2px solid #E2E8F0;
    border-radius: 4px;
    cursor: pointer;
    accent-color: #6366F1;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-text {
    font-size: 0.9375rem;
    color: #475569;
    font-weight: 600;
    line-height: 1.2;
    padding-top: 2px;
}

.reset-filters-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94A3B8;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
}

.mobile-show-results-btn {
    display: none;
    width: 100%;
    background: #0F172A;
    color: white;
    padding: 1rem;
    border-radius: 16px;
    font-weight: 600;
    margin-top: auto;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.filter-overlay-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   4. CONTROLS (Sort, View Toggle, Compare)
   ========================================================================== */

.desktop-controls-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.mobile-controls-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid #E2E8F0;
    padding: 0.625rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #0F172A;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
}

/* View Toggle */
.view-toggle-wrapper {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 4px;
    display: flex;
    align-items: center;
}

.view-toggle-btn {
    padding: 0.5rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #94A3B8;
    transition: all 0.2s;
}

.view-toggle-btn.active {
    background: #F1F5F9;
    color: #0F172A;
}

/* Sort Dropdown */
.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94A3B8;
    letter-spacing: 0.05em;
}

.sort-select-container {
    position: relative;
}

.sort-select {
    appearance: none;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    height: 48px !important;
    padding: 0 2.5rem 0 1rem;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1F2937;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    line-height: 48px;
    box-sizing: border-box !important;
    display: block !important;
    margin-top: 0 !important;
    position: relative !important;
    top: 6px !important;
}

.sort-chevron {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 20px;
    pointer-events: none;
}

.header-sort-row {
    flex-wrap: wrap;
}

/* Compare Bar */
.compare-bar-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #0F172A;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
}

.compare-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.compare-circles {
    display: flex;
    margin-left: 10px;
}

.compare-text {
    color: white;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9375rem;
}

.compare-action-btn {
    background: #3B82F6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.compare-action-btn:hover {
    background: #2563EB;
}

/* ==========================================================================
   5. CARD COMPONENT (Grid View / Default)
   ========================================================================== */

/* Main Card Container */
.explore-card {
    background: white;
    border-radius: 20px;
    border: 1px solid #F1F5F9;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    min-height: auto;
}

.explore-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #E2E8F0;
}

.explore-card.in-wallet {
    opacity: 0.6;
    filter: grayscale(100%);
}

/* Top Visual Section */
.card-visual-container {
    width: 100%;
    height: auto;
    min-width: auto;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #F1F5F9;
}

.card-visual-container img {
    width: 100%;
    height: auto;
    aspect-ratio: 1.586;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Gradient Card Fallback inside visual container */
.card-visual-container .gradient-card {
    width: 100%;
    aspect-ratio: 1.586;
    height: auto;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Gradient Card Internal Text */
.card-issuer-text {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
}

.card-chip-small {
    width: 40px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    margin-bottom: 0.75rem;
    backdrop-filter: blur(4px);
}

.card-number-text {
    font-family: monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-name-text {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.card-logo-placeholder {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
}

.logo-circle {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.logo-circle.overlap {
    margin-left: -8px;
}

/* Right/Bottom Content Section */
.card-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Header: Name + Match Score */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
    line-height: 1.4;
}

.issuer-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Match Badge */
.match-badge {
    background: #ECFDF5;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.match-score {
    font-size: 0.75rem;
    font-weight: 800;
    color: #16A34A;
}

.match-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #16A34A;
    letter-spacing: 0.05em;
}

/* Annual Fee Row */
.card-fee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 1rem 0;
    border-top: 1px solid #F1F5F9;
    border-bottom: 1px solid #F1F5F9;
    margin-bottom: 1rem;
}

.fee-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94A3B8;
    letter-spacing: 0.05em;
}

.fee-value {
    font-size: 1rem;
    font-weight: 800;
    color: #1F2937;
}

/* View Details Button */
.view-details-btn {
    width: 100%;
    background: white;
    color: #1F2937;
    padding: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.view-details-btn .material-icons {
    font-size: 16px;
}

/* Compare Select Button */
.compare-select-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.compare-select-btn .material-icons {
    font-size: 18px;
    color: #64748B;
}

/* Empty State */
.empty-state-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 2rem;
}

.empty-icon {
    font-size: 5rem;
    color: #E2E8F0;
    margin-bottom: 1.5rem;
}

.empty-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1F2937;
}

.empty-text {
    color: #64748B;
    font-size: 1.125rem;
}

.load-more-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.load-more-btn {
    background: white;
    border: 1px solid #E2E8F0;
    padding: 0.875rem 2rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

.remaining-count-badge {
    background: #F1F5F9;
    color: #64748B;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

/* ==========================================================================
   6. LIST VIEW MODE
   ========================================================================== */

/* Container becomes the "Card" in list view */
#cards-scroll-container.list-view-active {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    padding-bottom: 0;
    margin-bottom: 2rem;
    width: 100%;
}

/* Grid Layout overrides for Header inside Container */
#cards-scroll-container.list-view-active #list-header {
    display: grid !important;
    grid-template-columns: 80px 2fr 100px 2.5fr 80px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #F1F5F9;
    align-items: center;
    gap: 1rem;
    min-width: 900px;
}

.list-view-header {
    color: #94A3B8;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Header Column Alignments */
.col-card {
    padding-left: 0;
}

.col-fee {
    text-align: right;
}

.col-rewards {
    padding-left: 0;
}

.col-action {
    text-align: center;
}

/* List Grid Layout */
.view-grid.list-view {
    display: block !important;
    gap: 0 !important;
    padding: 0;
}

/* List Item (Card Row) */
.view-grid.list-view .explore-card {
    display: grid;
    grid-template-columns: 80px 2fr 100px 2.5fr 80px;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #F1F5F9;
    background: transparent;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: none;
    margin-bottom: 0;
    min-width: 900px;
    transition: background 0.2s;
}

.view-grid.list-view .explore-card:last-child {
    border-bottom: none;
}

.view-grid.list-view .explore-card:hover {
    background: #F8FAFC;
    transform: none;
}

/* List Visual (Icon) Logic */
.view-grid.list-view .card-visual-container {
    width: auto;
    flex: auto;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0;
    justify-content: flex-start;
    gap: 1rem;
    display: flex;
    align-items: center;
}

/* Fix "Injogged Randomly" alignment issue - Enforce Left Alignment */
.view-grid.list-view .card-visual-container {
    justify-content: flex-start !important;
    padding-left: 0 !important;
    width: 100% !important;
}

/* Ensure Logo / Gradient is small and circular/rectangular */
.view-grid.list-view .card-visual-container img,
.view-grid.list-view .card-visual-container .gradient-card {
    width: 64px !important;
    height: auto !important;
    aspect-ratio: 1.586 !important;
    border-radius: 4px !important;
    object-fit: cover !important;
    box-shadow: none !important;
    border: 1px solid #E2E8F0 !important;
    padding: 0 !important;
    flex-shrink: 0;
}

/* Hide extra gradient card elements in list view */
.view-grid.list-view .gradient-card>div {
    display: none;
}

/* List Card Info Text */
.view-grid.list-view .list-card-info {
    display: block !important;
}

.list-card-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
    line-height: 1.25;
}

.list-card-issuer {
    font-size: 0.75rem;
    color: #64748B;
    font-weight: 500;
}

/* Default state: Hide list-only elements in Grid layout */
.list-checkbox-col,
.list-card-info,
.list-fee-col,
.list-rewards-col,
.list-action-col {
    display: none;
}

/* Hide Grid Only Elements */
.view-grid.list-view .card-content,
.view-grid.list-view .compare-select-btn {
    display: none !important;
}

/* List Columns Display */
.view-grid.list-view .list-checkbox-col,
.view-grid.list-view .list-fee-col,
.view-grid.list-view .list-rewards-col,
.view-grid.list-view .list-action-col {
    display: flex !important;
    align-items: center;
}

.list-checkbox-col {
    width: auto;
    justify-content: flex-start;
    padding-left: 0.5rem;
}

.list-fee-col {
    width: auto;
    justify-content: flex-end;
}

.list-rewards-col {
    flex: auto;
    padding-left: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* Action Col with Full Height Fill */
.view-grid.list-view .list-action-col {
    width: auto;
    justify-content: center;
    align-self: stretch !important;
    margin: -1rem -1.5rem -1rem 0;
    width: calc(100% + 1.5rem) !important;
    height: auto !important;
    min-height: 100% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
}

/* Match Column is GONE */
.view-grid.list-view .list-match-col {
    display: none !important;
}

/* Checkbox Style */
.list-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.list-checkbox.checked {
    background: #3B82F6;
    border-color: #3B82F6;
}

.list-checkbox.checked span {
    color: white !important;
}

/* Reward Pills */
.reward-pill {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.reward-rate {
    font-weight: 700;
    color: #0F172A;
    font-size: 0.75rem;
}

.reward-cat {
    color: #64748B;
    font-size: 0.75rem;
    font-weight: 500;
}

/* List View Trigger Button */
.list-view-trigger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748B;
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: 'Outfit', sans-serif;
}

.view-grid.list-view .list-view-trigger-btn {
    width: 100%;
    height: auto;
    border-radius: 0;
    margin: 0;
    border: none;
    background: transparent;
    border-left: 1px solid #F1F5F9;
    transition: background 0.2s;
    justify-content: center;
}

.view-grid.list-view .list-view-trigger-btn:hover {
    background: #F8FAFC !important;
}

/* ==========================================================================
   7. RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .desktop-sort {
        display: none !important;
    }

    .mobile-controls {
        display: flex !important;
    }

    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        max-width: 320px;
        height: 100dvh;
        background: white;
        z-index: 50;
        padding: 1.5rem;
        transition: left 0.3s ease;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
    }

    .filters-sidebar.active {
        left: 0;
    }

    .mobile-filter-header {
        display: flex !important;
        flex-shrink: 0;
        width: 100%;
        position: relative;
        z-index: 50;
        background: white;
        padding-bottom: 1rem;
        border-bottom: 1px solid #F1F5F9;
        margin-bottom: 1rem;
        justify-content: space-between;
        align-items: center;
    }

    .filters-scroll-content {
        margin: 0 !important;
        padding: 0 1.5rem !important;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .mobile-apply-btn {
        display: block !important;
    }

    /* LIST VIEW MOBILE SCROLL */
    #cards-scroll-container.list-view-active {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
        width: 100%;
        margin-right: -2rem;
    }

    #cards-scroll-container.list-view-active #list-header,
    #cards-scroll-container.list-view-active .explore-card {
        min-width: 900px !important;
        width: 100%;
    }

    .view-grid.list-view {
        display: block !important;
        grid-template-columns: none !important;
        gap: 1rem !important;
    }

    .view-grid.list-view .explore-card {
        margin-bottom: 1rem;
        display: flex;
        flex-direction: row;
    }

    #cards-scroll-container.list-view-active #list-header {
        display: flex !important;
    }

    /* GRID VIEW MOBILE STACK */
    .view-grid:not(.list-view) {
        grid-template-columns: 1fr !important;
    }

    .view-grid:not(.list-view) .explore-card {
        flex-direction: column;
        padding: 0 0 0 0 !important;
        height: auto;
        min-height: auto;
        align-items: stretch;
        border-radius: 20px;
        border: 1px solid #F1F5F9;
        overflow: hidden;
    }

    .view-grid:not(.list-view) .card-visual-container {
        width: 100%;
        min-width: auto;
        flex: none;
        border-bottom: 1px solid #F1F5F9;
        background: white;
        padding: 2rem;
        justify-content: center;
        gap: 0;
    }

    .view-grid:not(.list-view) .card-visual-container img {
        width: 100%;
        height: auto;
        aspect-ratio: 1.586;
        box-shadow: none;
        filter: none;
    }

    .view-grid:not(.list-view) .gradient-card>div {
        display: block;
    }

    .view-grid:not(.list-view) .gradient-card {
        width: 100%;
        height: auto;
        aspect-ratio: 1.586;
        padding: 1rem;
    }

    .view-grid:not(.list-view) .compare-select-btn {
        display: flex;
    }

    .view-grid:not(.list-view) .list-card-info,
    .view-grid:not(.list-view) .list-checkbox-col,
    .view-grid:not(.list-view) .list-fee-col,
    .view-grid:not(.list-view) .list-rewards-col,
    .view-grid:not(.list-view) .list-match-col,
    .view-grid:not(.list-view) .list-action-col {
        display: none !important;
    }

    .view-grid:not(.list-view) .card-content {
        display: flex;
        padding: 1.5rem;
    }

    #cards-grid {
        grid-template-columns: 1fr !important;
    }

    .explore-card {
        flex-direction: column;
        min-height: auto;
    }

    .card-visual-container {
        width: 100%;
        min-width: auto;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid #F1F5F9;
        padding: 2rem;
    }

    .card-visual-container img {
        max-height: 180px;
    }

    .view-grid:not(.list-view) .card-content {
        padding: 1.5rem !important;
    }

    .view-toggle-wrapper {
        display: none !important;
    }

    .sort-select {
        top: 0 !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 768px) {
    .view-grid:not(.list-view) {
        grid-template-columns: 1fr !important;
    }

    .main-content-wrapper {
        padding: 0;
    }

    .category-pills-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin: 0 -1.25rem 2rem -1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
    }

    .category-pills-container::-webkit-scrollbar {
        display: none;
    }

    .category-pill-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .mobile-controls-bar {
        margin-bottom: 1.5rem;
        padding: 0 0.25rem;
        height: 48px;
    }

    .mobile-filter-btn {
        height: 48px;
        box-sizing: border-box;
    }

    .mobile-sort-container {
        display: flex;
        align-items: center;
        height: 48px;
    }

    .mobile-sort-container .sort-select {
        height: 48px;
        box-sizing: border-box;
        display: block;
        padding: 0 2rem 0 0.75rem;
        font-size: 0.875rem;
        width: 100%;
        line-height: 48px;
        margin: 0;
        background-position: right 0.75rem center !important;
    }

    .mobile-sort-container .view-toggle-wrapper {
        height: 48px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
    }

    .mobile-sort-container .sort-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .filters-sidebar {
        max-width: 100%;
        border-radius: 0;
    }

    .view-grid:not(.list-view) .explore-card {
        padding: 0 !important;
    }

    .filters-sidebar {
        padding: 1rem;
    }
}

.filters-scroll-content {
    flex: 1;
    overflow-y: auto;
    margin: 1rem -1rem;
    /* Negative margin to allow full width scroll bars if needed, or just visual spacing */
    padding: 0 1rem;
    /* Hide scrollbar for cleaner look but keep functionality */
    scrollbar-width: thin;
}