/* Base Styles */

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.custom-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.custom-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
}

/* Product Card Styling */
.fruite-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.fruite-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.fruite-img {
    height: 240px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.fruite-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.fruite-item:hover .fruite-img img {
    transform: scale(1.05);
}

.fruite-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 2;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.product-sku {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #2a2a2a;
    margin-bottom: 15px;
}

/* Updated button colors to #205781 */
.view-details-btn {
    border: 2px solid #205781;
    color: #205781;
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
    padding: 8px 15px;
    border-radius: 20px;
    text-align: center;
    white-space: nowrap;
}

.view-details-btn:hover {
    background: #205781;
    color: white;
}

.mobile-filter-btn {
    border: 2px solid #205781;
    color: #205781;
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
}

.mobile-filter-btn:hover {
    border: none;
    background: #205781;
    color: white;
}

/* Subcategory styling */
.subcategory-list {
    padding-left: 20px;
    margin-top: 5px;
    display: none;
}

.subcategory-list.show {
    display: block;
}

.category-toggle {
    cursor: pointer;
}

.category-toggle i {
    transition: transform 0.3s ease;
}

.category-toggle.active i {
    transform: rotate(90deg);
}

/* Modal for full image view */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

/* Mobile-specific styles */
@media (max-width: 767.98px) {
    .fruite-item {
        margin-bottom: 20px;
    }

    .fruite-img {
        height: 220px;
    }

    .input-group {
        margin-bottom: 15px;
    }

    #sort-select {
        width: 100%;
    }

    .mobile-filter-btn {
        border-radius: 8px;
        padding: 12px 15px;
        font-weight: 600;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }

    .mobile-filter-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .mobile-filter-btn i {
        margin-right: 8px;
    }

    .clear-filters-container {
        position: sticky;
        bottom: 20px;
        z-index: 10;
        background: white;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
        margin-top: 20px;
    }

    .clear-filters-btn {
        width: 100%;
        border-radius: 8px;
        padding: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        color: #205781;
        border: 2px solid #205781;
        transition: all 0.3s ease;
    }

    .clear-filters-btn:hover {
        background: #205781;
        color: white;
        transform: translateY(-2px);
    }
}

/* Desktop styles */
@media (min-width: 768px) {
    .product-listing-row {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }

    .clear-filters-container {
        margin-top: 20px;
    }

    .clear-filters-btn {
        width: 100%;
        padding: 10px;
        border-radius: 8px;
    }
}

/* Active filter item */
.fruite-categorie li.active {
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #205781;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Pagination styling */
.pagination-wrapper {
    margin-top: 40px;
}

.page-item.active .page-link {
    background-color: #205781;
    border-color: #205781;
}

.page-link {
    color: #205781;
    font-weight: 500;
}

/* Category Images */
.category-img-container {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-img-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.toggle-icon {
    width: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.category-toggle.active .toggle-icon {
    transform: rotate(90deg);
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .category-img-container {
        width: 25px;
        height: 25px;
    }

    .category-img-placeholder i {
        font-size: 0.8rem;
    }

    .toggle-icon {
        font-size: 0.8rem;
    }
}

/* Add this to your existing styles */
.star-rating {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
}

.star-rating i {
    margin-right: 2px;
}

.product-rating {
    margin-bottom: 10px;
    min-height: 24px;
    /* Ensure consistent spacing even when no reviews */
}

/* For smaller screens */
@media (max-width: 767.98px) {
    .star-rating {
        font-size: 14px;
    }
}