/* Search Results Page Styles - Flipkart Style */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

.search-main {
    margin-top: 112px;
    /* Header + Nav */
    padding: 24px 0;
    min-height: calc(100vh - 112px);
    background: #f1f3f6;
}

.search-container-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    padding: 0 16px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Left Sidebar - Filters (now uses filter-sidebar class from category-filters.css) */
.search-filters,
.filter-sidebar {
    width: 280px;
    min-width: 280px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px;
    position: sticky;
    top: 0px;
    flex-shrink: 0;
    overflow-y: visible;
    overflow-x: hidden;
    box-sizing: border-box;
}

.filters-title {
    font-size: 18px;
    font-weight: 500;
    color: #212121;
    font-family: 'Roboto', sans-serif;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section-title {
    font-size: 14px;
    font-weight: 500;
    color: #212121;
    font-family: 'Roboto', sans-serif;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-breadcrumb {
    font-size: 12px;
    color: #878787;
    margin-bottom: 12px;
    font-family: 'Roboto', sans-serif;
}

.filter-breadcrumb a {
    color: #0a4409;
    text-decoration: none;
}

.filter-breadcrumb i {
    font-size: 8px;
    margin: 0 4px;
    color: #878787;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #212121;
    font-family: 'Roboto', sans-serif;
    padding: 4px 0;
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox input[type="radio"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-checkbox span {
    user-select: none;
}

/* Price Filter */
.price-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    background: #ffffff;
    cursor: pointer;
}

.price-inputs span {
    font-size: 14px;
    color: #878787;
}

/* Brand Search */
.brand-search {
    margin-bottom: 12px;
}

.brand-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

.filter-more-link {
    display: inline-block;
    margin-top: 8px;
    color: #0a4409;
    text-decoration: none;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
}

.filter-more-link:hover {
    text-decoration: underline;
}

/* Right Content - Search Results */
.search-results {
    flex: 1;
    min-width: 0;
    width: 0;
    /* Force flex to respect available space */
    overflow-x: hidden;
    box-sizing: border-box;
    flex: 1;
    background: #ffffff;
    border-radius: 4px;
    padding: 20px;
}

.search-breadcrumbs {
    font-size: 12px;
    color: #878787;
    margin-bottom: 16px;
    font-family: 'Roboto', sans-serif;
}

.search-breadcrumbs a {
    color: #0a4409;
    text-decoration: none;
}

.search-breadcrumbs i {
    font-size: 8px;
    margin: 0 4px;
    color: #878787;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.results-info {
    font-size: 14px;
    color: #878787;
    font-family: 'Roboto', sans-serif;
}

.results-info #searchQueryDisplay {
    color: #212121;
    font-weight: 500;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-label {
    font-size: 14px;
    color: #878787;
    font-family: 'Roboto', sans-serif;
}

.sort-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    background: #ffffff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23212121' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    transition: all 0.2s;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    text-decoration: none; /* For cases where it's an <a> tag */
    color: inherit;
}

.desktop-product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    cursor: pointer;
    height: 100%;
}

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

.product-image {
    width: 100%;
    max-width: 100%;
    height: 200px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    border-radius: 6px;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    color: #212121;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: #212121;
    text-decoration: none;
}

.product-title a:hover {
    color: #0a4409;
}

.product-rating {
    font-size: 12px;
    color: #878787;
}

.product-rating i {
    color: #24db65;
    font-size: 12px;
}

.product-specs {
    font-size: 12px;
    color: #878787;
    line-height: 1.5;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.price-current {
    font-size: 18px;
    font-weight: 500;
    color: #212121;
    font-family: 'Roboto', sans-serif;
}

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

.discount-badge {
    font-size: 12px;
    color: #26a541;
    font-weight: 500;
}

.product-actions {
    margin-top: 8px;
}

.compare-checkbox-small {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #878787;
    font-family: 'Roboto', sans-serif;
}

.compare-checkbox-small input[type="checkbox"] {
    margin-right: 6px;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Loading Spinner */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #24db65;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.no-results i {
    font-size: 64px;
    color: #878787;
    margin-bottom: 16px;
}

.no-results h2 {
    font-size: 20px;
    font-weight: 500;
    color: #212121;
    font-family: 'Roboto', sans-serif;
    margin: 0 0 8px 0;
}

.no-results p {
    font-size: 14px;
    color: #878787;
    font-family: 'Roboto', sans-serif;
    margin: 0;
}

/* Pagination moved to style.css */


/* Responsive */
@media (max-width: 1024px) {
    .search-container-wrapper {
        flex-direction: column;
    }

    .search-filters {
        width: 100%;
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .search-main {
        margin-top: 56px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .product-image {
        height: 140px;
    }

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

/* Skeleton Loading Placeholder */
.skeleton-card {
    background: #ffffff;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 380px;
    /* match min-height of products */
    box-sizing: border-box;
}

.skeleton-animation {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-img {
    width: 100%;
    height: 200px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.skeleton-title {
    width: 85%;
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-rating {
    width: 50%;
    height: 14px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-price {
    width: 60%;
    height: 18px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    width: 100%;
}

.skeleton-btn {
    flex: 1;
    height: 32px;
    border-radius: 4px;
}