/* ============================================
   PRODUCTS GRID - Modern Uniform Cards
   ============================================ */

/* Override grid for products page - fixed card sizes */
.products-container .grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    align-items: stretch;
}

/* Uniform card sizing for products */
.products-container .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 450px;
}

/* Fixed aspect ratio for images */
.products-container .card-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
}

/* Card body takes remaining space */
.products-container .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Uniform title height */
.products-container .card-body h4 {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 12px;
    min-height: 50px;
    font-weight: 600;
    color: #1F2937;
}

/* Uniform description */
.products-container .card-body p {
    font-size: 14px;
    line-height: 1.6;
    color: #6B7280;
    flex: 1;
    margin-bottom: 0;
}

/* Card link wrapper */
.products-container .card-link {
    height: 100%;
    display: flex;
}

.products-container .card-link .card {
    width: 100%;
}

/* Responsive adjustments */
@media (min-width: 1024px) {
    .products-container .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .products-container .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .products-container .grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .products-container .card {
        min-height: 400px;
    }

    .products-container .card-img {
        height: 250px;
    }
}

/* Search results grid - same styling */
#search-results-grid.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    align-items: stretch;
}

#search-results-grid .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 450px;
}

#search-results-grid .card-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
}

#search-results-grid .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

#search-results-grid .card-body h4 {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 12px;
    min-height: 50px;
    font-weight: 600;
    color: #1F2937;
}

#search-results-grid .card-body p {
    font-size: 14px;
    line-height: 1.6;
    color: #6B7280;
    flex: 1;
    margin-bottom: 0;
}

#search-results-grid .card-link {
    height: 100%;
    display: flex;
}

#search-results-grid .card-link .card {
    width: 100%;
}

@media (min-width: 1024px) {
    #search-results-grid.grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #search-results-grid.grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    #search-results-grid.grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #search-results-grid .card {
        min-height: 400px;
    }

    #search-results-grid .card-img {
        height: 250px;
    }
}
/* ============================================
   CATEGORY PAGES - Uniform Button Alignment
   ============================================ */

/* Apply to all cards in bg-light sections (category pages) */
.bg-light .grid-3 .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bg-light .grid-3 .card-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
}

.bg-light .grid-3 .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.bg-light .grid-3 .card-body h4 {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 12px;
    font-weight: 600;
    color: #1F2937;
}

.bg-light .grid-3 .card-body p {
    font-size: 14px;
    line-height: 1.6;
    color: #6B7280;
    flex: 1;
    margin-bottom: 16px;
}

/* Button always at bottom */
.bg-light .grid-3 .card-body .btn {
    margin-top: auto;
}
