/* ==========================================================
   SEARCH
========================================================== */

.catalogue-search {

    position: relative;

    z-index: 10000;

    background: transparent;

    border-bottom: none;

}

.search-wrapper {

    position: relative;

    z-index: 10001;

    padding: 16px;

    background: rgba(255,255,255,.08);

    border: 1px solid rgba(255,255,255,.15);

    border-radius: 20px;

    backdrop-filter: blur(12px);

    -webkit-backdrop-filter: blur(12px);

}

.search-input {

    width: 100%;

    padding: 14px 18px 14px 48px;

    border-radius: var(--radius-md);

}

.search-icon {

    position: absolute;

    top: 50%;

    left: 16px;

    width: 18px;

    height: 18px;

    opacity: .5;

    transform: translateY(-50%);

}

.clear-search {

    position: absolute;

    top: 50%;

    right: 12px;

    display: none;

    border: none;

    background: transparent;

    cursor: pointer;

    transform: translateY(-50%);

}


/* ==========================================================
   FILTERS
========================================================== */

.catalogue-filters {

    display: flex;

    flex-wrap: wrap;

    gap: 16px;

    margin-top: 20px;

    margin-bottom: 32px;

    padding: 24px;

    background: #ffffff;

    border: 1px solid var(--border-color);

    border-radius: var(--radius-lg);

}

.catalogue-filters select {

    min-width: 220px;

    height: 48px;

    padding: 0 14px;

    background: #fff;

    border: 1px solid var(--border-color);

    border-radius: 10px;

}

.filter-grid {

    display: grid;

    grid-template-columns: repeat(4,1fr);

    gap: 16px;

}

.filter-wrapper {

    display: grid;

    grid-template-columns: repeat(5,minmax(180px,1fr));

    gap: 20px;

    align-items: end;

}

.filter-group {

    display: flex;

    flex-direction: column;

    gap: 8px;

}

.filter-actions {

    display: flex;

    align-items: flex-end;

}

.catalogue-filter {

    width: 100%;

}

.subcategory-filters {

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin: 24px 0;

}

.subcategory-filter {

    padding: 8px 14px;

    background: #ffffff;

    border: 1px solid var(--border-color);

    border-radius: 999px;

    cursor: pointer;

}

.subcategory-filter.active {

    background: var(--color-primary);

    color: #ffffff;

    border-color: var(--color-primary);

}


/* ==========================================================
   RESULTS SUMMARY
========================================================== */

.catalogue-summary {

    margin-bottom: 32px;

    padding-bottom: 16px;

    border-bottom: 1px solid var(--border-color);

}

.catalogue-summary-wrapper {

    display: flex;

    justify-content: space-between;

    align-items: center;

}

.catalogue-results {

    font-size: 14px;

    font-weight: 600;

}

.catalogue-last-updated {

    font-size: 14px;

    color: var(--text-secondary);

}


/* ==========================================================
   GRID LAYOUTS
========================================================== */

.entity-grid,
.product-grid,
.products-grid,
.brand-grid,
.brands-grid,
.vehicle-grid,
.vehicles-grid,
.category-grid,
.categories-grid,
#categoryGrid {

    display: grid;

    grid-template-columns: repeat(4,minmax(0,1fr));

    gap: 32px;

    width: 100%;

    max-width: 1500px;

    margin: 0 auto;

}

.brand-grid {

    position: relative;

    max-height: 720px;

    overflow: hidden;

}

.vehicle-grid {

    display: grid;

    grid-template-columns: repeat(4,1fr);

    gap: 24px;

    position: relative;

    max-height: 720px;

    overflow: hidden;

}

#vehicle-grid {

    display: grid;

    grid-template-columns: repeat(4,minmax(0,1fr));

    gap: 32px;

}


/* ==========================================================
   PAGINATION
========================================================== */

.pagination {

    display: flex;

    justify-content: center;

    gap: 8px;

    margin-top: 40px;

}

.pagination a,
.pagination button {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 40px;

    height: 40px;

    background: #ffffff;

    border: 1px solid var(--border-color);

    border-radius: var(--radius-md);

}

.pagination .active {

    background: var(--color-primary);

    color: #ffffff;

    border-color: var(--color-primary);

}

.pagination-status {

    min-width: 120px;

    text-align: center;

    font-size: 15px;

    font-weight: 600;

    color: var(--color-text);

}

.pagination-prev,
.pagination-next {

    display: flex;

    align-items: center;

    justify-content: center;

    min-width: 90px;

    height: 42px;

    padding: 0 18px;

    background: #ffffff;

    border: 1px solid #dcdcdc;

    border-radius: 8px;

    font-size: 14px;

    font-weight: 600;

    line-height: 1;

    cursor: pointer;

    transition: all .25s ease;

}

.pagination-prev:hover,
.pagination-next:hover {

    background: var(--color-primary);

    color: #ffffff;

    border-color: var(--color-primary);

}

.pagination-prev:disabled,
.pagination-next:disabled {

    opacity: .4;

    cursor: not-allowed;

}


/* ==========================================================
   STATES
========================================================== */

.no-results,
.loading-state {

    padding: 80px 20px;

    text-align: center;

}


/* ==========================================================
   BRAND DIRECTORY
========================================================== */

.brand-grid-wrapper {

    position: relative;

}

.brand-fade {

    position: absolute;

    left: 0;

    right: 0;

    bottom: 0;

    height: 90px;

    z-index: 1;

    pointer-events: none;

    background: linear-gradient(transparent,#ffffff);

}

.brands-expanded .brand-grid {

    max-height: none;

}

.brands-expanded .brand-fade {

    display: none;

    pointer-events: none;

}

.show-more-wrapper {

    position: relative;

    z-index: 2;

    margin-top: 40px;

    text-align: center;

}

.brands-expanded .show-more-wrapper {

    display: none;

}


/* ==========================================================
   POPULAR VEHICLES
========================================================== */

.popular-vehicles {

    padding: 40px 0;

}

.popular-vehicles-grid {

    display: grid;

    grid-template-columns: repeat(5,1fr);

    gap: 20px;

}

.popular-vehicle-card {

    position: relative;

    display: flex;

    justify-content: center;

    min-height: 180px;

    padding: 40px;

    overflow: hidden;

    text-align: center;

    text-decoration: none;

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 16px;

    transition: all .25s ease;

}

.popular-vehicle-card::before {

    content: "";

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 4px;

    background: #dc2626;

    transform: scaleX(0);

    transform-origin: left;

    transition: transform .25s ease;

}

.popular-vehicle-card:hover {

    transform: translateY(-4px);

    border-color: #dc2626;

    border-top: 4px solid var(--color-primary);

    box-shadow: 0 12px 30px rgba(0,0,0,.08);

}

.popular-vehicle-card:hover::before {

    transform: scaleX(1);

}

.popular-vehicle-content {

    padding: 24px;

    text-align: center;

}

.popular-vehicle-content h3 {

    margin-bottom: 12px;

    font-size: 20px;

    font-weight: 700;

    color: #0f172a;

}

.popular-vehicle-count {

    margin-bottom: 14px;

    font-size: 14px;

    color: #64748b;

}

.popular-vehicle-link {

    font-size: 14px;

    font-weight: 600;

    color: #dc2626;

}

.vehicle-name {

    font-size: 18px;

    font-weight: 700;

    color: var(--color-heading);

}


/* ==========================================================
   DIRECTORY EXPAND/COLLAPSE
========================================================== */

.directory-collapsed {

    position: relative;

    max-height: 1200px;

    overflow: hidden;

}

.directory-expanded {

    max-height: none;

}

.directory-fade {

    position: absolute;

    left: 0;

    right: 0;

    bottom: 0;

    height: 180px;

    pointer-events: none;

    background: linear-gradient(
        rgba(255,255,255,0),
        rgba(255,255,255,1)
    );

}

.directory-expanded .directory-fade {

    display: none;

}