/* assets/css/products.css - Products page styling */

/* Filter and sort controls */
.filter-controls {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-controls .form-label {
    font-weight: 600;
    color: #333;
}

.filter-controls .form-select {
    border-radius: 8px;
    padding: 10px;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px 0;
}

/* Product card styling */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.product-info {
    padding: 10px;
}

.product-title {
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.product-price {
    color: #0d6efd;
    font-weight: 600;
}

/* Pagination styling */
.pagination {
    margin-top: 20px;
}

.page-link {
    color: #0d6efd;
    border-radius: 8px;
    margin: 0 2px;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px 20px;
}

.no-results i {
    color: #6c757d;
}

/* Responsive adjustments */
@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .filter-controls {
        display: flex;
        gap: 15px;
        align-items: end;
    }
    
    .filter-controls .mb-3 {
        margin-bottom: 0 !important;
        flex: 1;
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* For larger screens */
@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Custom Dropdown Styles */

.filters-container {

    display: flex;

    gap: 1rem;

    flex-wrap: wrap;

    position: relative;

    z-index: 1001; /* Ensure filters are above product cards */

}



.gem-dropdown {

    position: relative;

    font-family: 'Inter', sans-serif;

}



.gem-dropdown-toggle {

    background-color: #fff;

    border: 1px solid #dee2e6;

    border-radius: 0.5rem;

    padding: 0.75rem 1rem;

    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 240px;

    cursor: pointer;

    transition: all 0.2s ease-in-out;

    box-shadow: 0 1px 3px rgba(0,0,0,0.04);

}



.gem-dropdown.open .gem-dropdown-toggle, .gem-dropdown-toggle:hover {

    border-color: #a3c7ff;

    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);

}



.gem-dropdown-toggle .toggle-icon {

    margin-right: 0.75rem;

    color: #0d6efd;

}



.gem-dropdown-toggle .toggle-text {

    font-weight: 500;

    color: #343a40;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}



.gem-dropdown-chevron {

    transition: transform 0.25s ease-in-out;

    color: #6c757d;

}



.gem-dropdown.open .gem-dropdown-chevron {

    transform: rotate(180deg);

}



.gem-dropdown-menu {

    position: absolute;

    top: calc(100% + 6px);

    left: 0;

    width: 280px; /* Wider for better spacing */

    background-color: #fff;

    border-radius: 0.75rem; /* Slightly larger radius */

    border: 1px solid #e9ecef;

    box-shadow: 0 10px 30px rgba(0,0,0,0.1);

    opacity: 0;

    transform-origin: top center;

    transform: scale(0.98) translateY(-10px);

    visibility: hidden;

    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;

    z-index: 1000;

    overflow: hidden;

}



.gem-dropdown.open .gem-dropdown-menu {

    opacity: 1;

    transform: scale(1) translateY(0);

    visibility: visible;

}



.gem-dropdown-search-wrapper {

    padding: 0.5rem;

    border-bottom: 1px solid #f0f2f5;

    position: relative;

}



.gem-dropdown-search-wrapper .bi-search {

    position: absolute;

    top: 50%;

    left: 1.25rem;

    transform: translateY(-50%);

    color: #adb5bd;

    pointer-events: none; /* Make icon non-interactive */

}



#category-search {

    width: 100%;

    padding: 0.75rem 1rem 0.75rem 2.5rem;

    border: none;

    border-radius: 0.5rem;

    font-size: 0.95rem;

    background-color: #f8f9fa;

    transition: background-color 0.2s, box-shadow 0.2s;

}



#category-search:focus {

    background-color: #fff;

    outline: 0;

    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);

}



.gem-dropdown-options {

    list-style: none;

    padding: 0.5rem;

    margin: 0;

    max-height: 280px;

    overflow-y: auto;

}



/* Modern scrollbar */

.gem-dropdown-options::-webkit-scrollbar {

    width: 6px;

}

.gem-dropdown-options::-webkit-scrollbar-track {

    background: transparent;

}

.gem-dropdown-options::-webkit-scrollbar-thumb {

    background: #dce0e5;

    border-radius: 3px;

}

.gem-dropdown-options::-webkit-scrollbar-thumb:hover {

    background: #ced4da;

}



.gem-dropdown-options li {

    padding: 0.75rem 1rem;

    cursor: pointer;

    transition: background-color 0.2s ease, transform 0.2s ease;

    border-radius: 0.375rem; /* Rounded corners for items */

    margin-bottom: 2px; /* Space between items */

}



.gem-dropdown-options li:last-child {

    margin-bottom: 0;

}



.gem-dropdown-options li:hover {

    background-color: #f1f3f5;

    transform: translateX(4px);

}



.gem-dropdown-options li.selected {

    background-color: #e9f2ff;

    font-weight: 600;

    color: #0c63e4;

}



.gem-dropdown-options li.selected .option-title {

    font-weight: 600;

}



.option-content {

    display: flex;

    align-items: center;

}



.option-content .bi {

    margin-right: 0.85rem;

    font-size: 1.2rem;

    color: #495057;

    width: 20px; /* Align titles */

}



.gem-dropdown-options li.selected .option-content .bi {

    color: #0c63e4;

}



.option-title {

    font-weight: 500;

}







.badge {

    background-color: #e9ecef;

    color: #212529;

    padding: 0.25em 0.5em;

    border-radius: 0.375rem;

    font-size: 0.8em;

    font-weight: 600;

    margin-left: auto; /* Push badge to the right */

    align-self: center;

}



.gem-dropdown-options li.selected .badge {

    background-color: #0d6efd;

    color: #fff;

}



/* Active Filters */

#active-filters-container {

    display: flex;

    gap: 0.75rem;

    flex-wrap: wrap;

}



.filter-tag {

    display: flex;

    align-items: center;

    background-color: #e9f2ff;

    color: #0d6efd;

    padding: 0.5rem 0.75rem;

    border-radius: 2rem;

    font-size: 0.85rem;

    font-weight: 500;

    transition: all 0.3s ease;

    box-shadow: 0 1px 2px rgba(0,0,0,0.05);

}



.filter-tag .remove-tag {

    margin-left: 0.5rem;

    background: none;

    border: none;

    color: #0d6efd;

    cursor: pointer;

    padding: 0;

    font-size: 1.1rem;

    line-height: 1;

    opacity: 0.7;

}



.filter-tag .remove-tag:hover {

    color: #0a58ca;

    opacity: 1;

}



/* Backdrop for mobile */

.dropdown-backdrop {

    position: fixed;

    top: 0;

    left: 0;

    right: 0;

    bottom: 0;

    background: rgba(0,0,0,0.3);

    z-index: 999;

    opacity: 0;

    visibility: hidden;

    transition: opacity 0.3s ease, visibility 0.3s ease;

}



.dropdown-backdrop.show {

    opacity: 1;

    visibility: visible;

}



/* Mobile adjustments */

@media (max-width: 576px) {

    .filters-container {

        flex-direction: column;

    }

    .gem-dropdown-toggle {

        width: 100%;

    }

    .gem-dropdown-menu {

        width: 95vw;

        max-width: 400px;

        left: 50%;

        transform: translateX(-50%) scale(0.98) translateY(-10px);

        transform-origin: top center;

    }

    .gem-dropdown.open .gem-dropdown-menu {

        transform: translateX(-50%) scale(1) translateY(0);

    }

}
