/* Desktop Search Page Fixes - Flipkart Style */
/* This file ensures desktop search results display properly in a grid layout */
/* Mobile styles are NOT affected - they remain in mobile-search-fixes.css */

/* Desktop Only - Min-width 769px to avoid affecting mobile */
@media (min-width: 769px) {

    /* Hide mobile-only Sort/Filter buttons on desktop */
    .mobile-search-actions,
    #mobileSortBtn,
    #mobileFilterBtn {
        display: none !important;
    }

    /* Hide mobile filter header (Back button and "Filters" title) on desktop */
    .mobile-filter-header,
    .mobile-filter-back,
    #closeFilterBtn {
        display: none !important;
    }

    /* Ensure filter sidebar is always visible on desktop */
    .filter-sidebar,
    #filterSidebar {
        display: block !important;
        /* position: sticky !important;
        top: 80px; */
        width: 280px;
        min-width: 280px;
    }

    /* Ensure products grid uses proper grid layout on desktop */
    .products-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 16px !important;
        width: 100% !important;
        flex-direction: row !important;
        /* Override any flex settings */
    }

    /* Product cards - vertical layout for desktop */
    .product-card {
        display: flex !important;
        flex-direction: column !important;
        border: 1px solid #f0f0f0;
        border-radius: 4px;
        padding: 16px;
        background: #fff;
        transition: all 0.2s;
        height: auto;
        min-height: auto;
    }

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

    /* Image container for desktop */
    .product-card .product-image-container,
    .product-card .product-image {
        width: 100% !important;
        height: 200px !important;
        margin-right: 0 !important;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .product-card .product-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    /* Product info section for desktop */
    .product-card .product-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 0;
        padding-right: 0;
    }

    /* Product title */
    .product-card .product-title {
        font-size: 14px;
        font-weight: 500;
        color: #212121;
        line-height: 1.4;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Rating badge */
    .product-card .mobitez-rating-badge {
        background-color: #388e3c;
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        padding: 3px 6px;
        border-radius: 3px;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        width: fit-content;
    }

    .product-card .rating-count-text {
        font-size: 13px;
        color: #878787;
        margin-left: 6px;
    }

    /* Specs list */
    .product-card .product-features-list {
        margin: 8px 0;
        padding: 0;
        list-style: none;
    }

    .product-card .product-features-list li {
        font-size: 13px;
        color: #878787;
        margin-bottom: 4px;
        display: flex;
        align-items: flex-start;
    }

    .product-card .product-features-list li::before {
        content: "•";
        color: #c2c2c2;
        margin-right: 6px;
        font-size: 10px;
    }

    /* Price section */
    .product-card .product-price-container {
        display: flex;
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: auto;
    }

    .product-card .current-price {
        font-size: 18px;
        font-weight: 500;
        color: #212121;
    }

    .product-card .original-price {
        font-size: 14px;
        color: #878787;
        text-decoration: line-through;
    }

    .product-card .discount {
        font-size: 13px;
        color: #388e3c;
        font-weight: 500;
    }

    /* Offer labels */
    .product-card .free-delivery,
    .product-card .bank-offer {
        font-size: 12px;
        margin-top: 4px;
    }

    .product-card .free-delivery {
        color: #212121;
    }

    .product-card .bank-offer {
        color: #26a541;
        font-weight: 500;
    }

    /* Responsive grid columns */
    @media (min-width: 1400px) {
        .products-grid {
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        }
    }

    @media (min-width: 1200px) and (max-width: 1399px) {
        .products-grid {
            grid-template-columns: repeat(4, 1fr) !important;
        }
    }

    @media (min-width: 992px) and (max-width: 1199px) {
        .products-grid {
            grid-template-columns: repeat(3, 1fr) !important;
        }
    }

    @media (min-width: 769px) and (max-width: 991px) {
        .products-grid {
            grid-template-columns: repeat(3, 1fr) !important;
        }
    }
}