/* Modify the existing #mca-search rule */
  #mca-search {
      /* Keep existing styles */
      background: linear-gradient(90deg, rgba(127, 53, 178, 1) 0%, rgba(99, 116, 189, 1) 50%, rgba(45, 149, 191, 1) 100%);
      padding: 4px;
      border-radius: 20px;
      margin: 30px auto;
      width: 100%;
      max-width: 800px;
  }
  
  
  /* Keep your existing #mca-filter-input styles */
  #mca-filter-input {
      width: 100%;
      padding: 15px;
      border: none;
      border-radius: 16px; /* Should be slightly less than #mca-search's radius */
      font-size: 16px;
      color: #333;
      background-color: #fff; /* White background for input */
  }
  #mca-filter-input:focus {
    outline: none; /* Remove default outline */
    /* The parent #mca-search:focus-within provides the visual indicator */
  }
  
#mca-az-filter-container {
    align-items: stretch;
    margin-right: auto;
    display: flex;
    gap: 3px;
    justify-content: center;
}
.mca-az-button,
.mca-eligibility-filter-button {
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.mca-az-button:hover,
.mca-eligibility-filter-button:hover {
    background-color: #e5e5e5;
}
.mca-az-button.active,
.mca-eligibility-filter-button.active {
    background-color: #e5e5e5; /* Example active color (WordPress blue) */
}
.filter-label {
    font-weight: bold;
    margin-right: 0.5rem; /* Space after the label */
    color: var(--bde-palette-color-1)
}
  
  .mca-filter-button {
    background-color: #f0f0f0; /* Light grey background */
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.4em 0.8em; /* Adjust padding */
    margin: 0.25rem; /* Space between buttons */
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; /* Smooth transition */
  }
  
  .mca-filter-button:hover {
    background-color: #e0e0e0; /* Slightly darker on hover */
    border-color: #bbb;
  }
  
  .mca-filter-button.active {
    background-color: #00205b; /* Use a primary color for active */
    color: #fff; /* White text for active */
    border-color: #001a4a; /* Darker border for active */
    font-weight: bold;
  }

  /* Hide mobile dropdown container by default (on desktop) */
  #mca-eligibility-filter-dropdown-container {
      display: none;
      /* Add any specific styling for the dropdown container if needed */
      /* e.g., width: 80%; margin: 0 auto; */
  }

  #mca-eligibility-filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px; /* Space between filter buttons */
    margin-top: 15px;
  }

  .mca-eligibility-account-filter {
    display: inline-block;
    position: relative;
    color: #898a8d;
    padding: 5px 30px;
  }
  .mca-eligibility-account-filter:hover {
    color: var(--bde-palette-color-1);
  }

  .mca-eligibility-account-filter.active {
    color: var(--bde-palette-color-1);
    font-weight: bold;
  }

  .mca-eligibility-account-filter.active:after,
  #mca-eligibility-filter-dropdown-container:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px; /* Adjust spacing from text */
    height: 4px; /* Height of the underline bar */
    border-radius: 10px;
    background: linear-gradient(to right, #8e2de2, #4a00e0, #00c6ff); /* Your gradient */
  }

#mca-eligibility-list-bg {
    background-color: #fafafa;
    padding: 45px;
}

/* --- Base Container and Grid --- */
#mca-filter-container {
    font-size: 14px;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    padding: 45px 45px 4px 45px;
    text-align: center;
}
#mca-filter-container h2 {
    font-size: 40px;
    color: var(--bde-palette-color-1);
}
#mca-filter-container h2, #mca-filter-container p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto
}
#mca-eligibility-list-container {
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 45px;
}
#mca-eligibility-list-container.mca-eligibility-grid {
    display: grid;
    /* Start with 3 columns */
    /* grid-template-columns: repeat(3, 1fr); */
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 45px; /* Spacing between grid items */
}

/* No Items After Filtered */
.no-items {
    text-align: center;
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
    padding: 15px;
    border-radius: 12px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Grid Item Styling --- */
.mca-eligibility-item {
    border: 2px solid #eaeaeb;
    padding: 30px;
    background-color: #fff; /* Use white background */
    border-radius: 12px;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

.mca-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Vertically center items in header */
}

/* --- Item Content Styling --- */
.mca-item-title {
    color: var(--bde-palette-color-1);
    font-weight: bold;
    margin-bottom: 0.5rem; /* Increased space below title */
    font-size: 1.1em;
    line-height: 1.3;
}

.mca-item-title-eligibility {
    display: flex;
    flex-direction: column; /* Stack title and eligibility container */
    align-items: flex-start;
}

.mca-item-eligibility {
    font-size: 0.95em; /* Slightly larger eligibility text */
    padding-top: 0.5rem; /* Add some space above eligibility */
    display: flex; /* Use flex to align icon and text */
    align-items: center; /* Vertically center icon and text */
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    gap: 0.5em;
}

/* --- Eligibility Status Specific Styles --- */

.mca-item-eligibility-container {
    margin-top: 0.5rem; /* Space above the eligibility section */
    display: flex; /* Align label and badges wrapper */
    align-items: flex-start; /* Align items to the top */
    gap: 0.5em; /* Space between label and badges */
    flex-wrap: wrap; /* Allow badges to wrap if needed */
}

.mca-eligibility-label {
    font-weight: 500;
    /* text-transform: uppercase; */ /* Optional: if you want the label uppercase */
    color: #333; /* Adjust color as needed */
    flex-shrink: 0; /* Prevent label from shrinking */
    padding-top: 4px; /* Align baseline roughly with first badge */
}

.mca-eligibility-badges-wrapper {
    display: flex;
    flex-wrap: wrap; /* Allow badges to wrap to the next line */
    gap: 5px; /* Space between badges */
}

.mca-eligibility-badge {
    display: inline-flex; /* Use inline-flex to align icon and text */
    align-items: center; /* Vertically center icon and text */
    padding: 4px 8px; /* Adjust padding for desired size */
    border-radius: 12px; /* Rounded corners */
    font-size: 12px; /* Adjust font size */
    font-weight: 500;
    line-height: 1; /* Ensure consistent height */
    gap: 0.4em; /* Space between icon and text within the badge */
    white-space: nowrap; /* Prevent text wrapping within a badge */
}

/* Eligible Badge Styles */
.mca-eligibility-badge.eligible-badge {
    background-color: #e8f5e9; /* Light green background */
    color: #1b5e20; /* Dark green text */
}
.mca-eligibility-badge.eligible-badge .fa-check {
    color: #2e7d32; /* Slightly brighter green for the checkmark */
}

/* Not Eligible Badge Styles */
.mca-eligibility-badge.not-eligible-badge {
    background-color: #ededed; /* Light orange/red background */
}
.mca-eligibility-badge.not-eligible-badge .fa-xmark {
}

/* LMN Badge Styles */
.mca-eligibility-badge.lmn-badge {
    background-color: #fff3cd; /* Light green background */
    color: #856404; /* Dark green text */
}

.mca-item-toggle {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #008fbe;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    flex-shrink: 0;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Style focus state for accessibility */
.mca-item-toggle:focus-visible {
    outline: 2px solid #008fbe;
    outline-offset: 2px;
    border-radius: 3px;
}


.mca-item-details {
    /* Hidden by default using max-height for transition */
    height: 0;
    min-height: 0;
    overflow: hidden;
    transition: min-height 0.3s ease-out, padding 0.3s ease-out, border-top-width 0.3s ease-out;
}
.mca-item-details * {
    display: none;
}
.mca-eligibility-item.expanded .mca-item-details .mca-item-actions {
    display: block;
}
.mca-eligibility-item.expanded .mca-item-details .mca-item-description {
    display: block; /* Show all children when expanded */
    margin-top: 15px;
}
.mca-eligibility-item.expanded .mca-full-details-link {
    display: block;
    font-size: 13px;
    color: var(--bde-palette-color-1);
    text-decoration: underline;
}
.mca-eligibility-item.expanded .mca-item-shop-link {
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #8035B2FF;
    background-color:#8035B2FF;
    color: #fff;
    border-radius: 999px;
    display: inline-block;
}
.mca-item-shop-link:hover,
.mca-item-details-link:hover {
    color: #8035B2FF;
    background-color:#fff;
}
.mca-item-shop-link:hover,
.mca-item-details-link:hover {
    text-decoration: none;
}

.mca-eligibility-item.expanded .mca-item-details .mca-item-details-link {
    display: flex;
    gap: 5px;
    align-items: center;
}

.mca-eligibility-item.expanded .mca-item-details {
    height: auto;
    min-height: auto;
    transition: min-height 0.4s ease-in, padding 0.4s ease-in, border-top-width 0.4s ease-in;
}

.mca-item-description {
    margin-top: 0;
    margin-bottom: 15px; /* More space after description */
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

.mca-show-more-button {
    border: 2px solid var(--bde-palette-color-1);
    color: var(--bde-palette-color-1);
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 999px;
    margin-top: 30px;
}
.mca-show-more-button:hover {
    background-color: var(--bde-palette-color-1);
    color: #fff;
    text-decoration: none;  
}


/* Ensure items in grid don't have extra bottom margin */
.mca-eligibility-grid .mca-eligibility-item {
    margin-bottom: 0;
}

/* --- Error Message Style --- */
#mca-eligibility-list-container p.error {
    color: red;
    font-weight: bold;
    border: 1px solid red;
    padding: 10px 10px 0 10px;
    background-color: #ffebeb;
    grid-column: 1 / -1; /* Make error span full width if in grid */
}

/* Style for NOT ELIGIBLE status */
.mca-item-eligibility.not-eligible,
.mca-item-eligibility.not-eligible .fa-xmark {
    color: #ff8200; /* Red color */
}

/* Style for unknown/unspecified status */
.mca-item-eligibility.unknown {
    color: #6c757d; /* Grey color */
    font-style: italic;
    gap: 0;
}
/* No icon for unknown status by default, add if needed */
/* .mca-item-eligibility.unknown::before { content: '?'; margin-right: 0.4em; } */


/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    #mca-eligibility-list-container.mca-eligibility-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #mca-eligibility-list-container.mca-eligibility-grid {
        grid-template-columns: 1fr; /* Single column */
        gap: 30px;
    }

    /* On mobile, hide the original filter buttons and the label */
    #mca-eligibility-filter-container .mca-eligibility-account-filter,
    #mca-eligibility-filter-container .filter-label {
        display: none;
    }

    /* On mobile, show the dropdown container */
    #mca-eligibility-filter-container {
        /* Keep justify-content if you want the dropdown centered */
        justify-content: center;
    }

    #mca-az-filter-container {
        flex-wrap: wrap; /* Allow alphabet buttons to wrap */
        justify-content: center; /* Center the wrapped buttons */
        gap: 3px; /* Adjust gap for wrapped buttons */
        margin-top: 15px; /* Add some space above the alphabet filter */
    }

    /* Show and style the mobile dropdown container */
    #mca-eligibility-filter-dropdown-container {
        display: block; /* Show the dropdown container */
        width: auto;
        max-width: 200px;
        margin-left: auto;
        margin-right: auto;
        position: relative;
        padding: 10px;
    }
}

/* --- Error/No Items Messages --- */
#mca-eligibility-list-container p { /* General paragraph styling within container (for no items message) */
    padding: 0;
    color: #555;
}
#mca-eligibility-list-container p.error { /* Specific error message styling */
    color: #dc3545; /* Use the same red as not-eligible */
    font-weight: bold;
    background-color: #f8d7da; /* Light red background */
    border: 1px solid #f5c6cb; /* Reddish border */
    border-radius: 4px;
}
