/* Algolia Search Styles */

/* Autocomplete Styles */
.siteSearch {
    color: #333 !important;
}

.autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 10000;
    padding: 5px;
    display: none;
    border: 1px solid #eee;
    overflow-x: scroll;
    max-height: 80vh;
    overflow-y: auto;
}

.autocomplete .result {
    display: flex;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #eee;
}

.autocomplete .result:hover {
    background: #eee;
}

.autocomplete .result:last-child {
    border-bottom: none;
}

.autocomplete .result img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.autocomplete .result .result-info {
    flex: 1;
}

.autocomplete .result .result-title {
    font-size: 14px;
    margin-bottom: 2px;
}

.autocomplete .result .result-price {
    font-size: 12px;
    color: #666;
}

.pagination {
    margin-top: 20px;
}

/* InstantSearch Page Styles */
.algolia-search-container {
    margin-bottom: 15px;
}

#algolia-searchbox {
    margin-bottom: 15px;
}

.algolia-searchbox-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.algolia-searchbox-submit,
.algolia-searchbox-reset {
    background: none;
    border: none;
    cursor: pointer;
}

#algolia-stats {
    font-size: 14px;
    color: #666;
    margin-left: 10px;
}

#algolia-sort-by {
    margin-left: auto;
}

.algolia-sort-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

#algolia-clear-refinements {
    margin-bottom: 20px;
}

.algolia-clear-button {
    width: 100%;
    padding: 8px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
}

.algolia-clear-button:hover {
    background-color: #e9e9e9;
}

.algolia-clear-button-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.algolia-refinement-root {
    margin-bottom: 15px;
}

.algolia-refinement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.algolia-refinement-item {
    margin: 0px;
    padding: 0px;
}

.algolia-refinement-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.algolia-refinement-checkbox {
    margin-right: 8px;
}

.algolia-refinement-count {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 10px;
}

.algolia-slider-root {
    margin: 10px 0;
}

/* Fix for the search results layout */
.results_area {
    display: flex;
    gap: 15px;
}

.sidebar {
    flex: 0 0 250px;
    max-width: 250px;
}

.sb_header_search {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.sb_content_search {
    margin-bottom: 20px;
}

.search_results {
    flex: 1;
}

.algolia-hits-root {
    width: 100%;
}

.algolia-hits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.algolia-hits-item {
    flex: 0 0 calc(25% - 8px);
    margin-bottom: 15px;
    display: flex;
}

.product_block_search {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 270px;
}

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

.product_image_search {
    position: relative;
    padding-top: 80%;
    overflow: hidden;
    height: 0;
    width: 100%;
}

.product_image_search img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.prod_promo_search {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.product_details_search {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 90px;
}

.product_details_search h3 {
    margin: 0 0 3px 0;
    font-size: 14px;
    line-height: 1.3;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.product_details_search h3 a {
    color: #333;
    text-decoration: none;
}

.product_details_search h3 a:hover {
    color: #0056b3;
}

.product_sku_search {
    font-size: 10px;
    color: #777;
    display: block;
    margin-bottom: 3px;
}

.product_price_search {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin: 0;
    display: block;
}

.view_product_search {
    display: inline-block;
    padding: 5px 10px;
    background-color: #0056b3;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.2s ease;
    text-align: center;
    margin-top: auto;
    width: 60px;
}

.view_product_search:hover {
    background-color: #003d7a;
}

.no-results {
    padding: 30px;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin: 20px 0;
}

.no-results p {
    margin: 10px 0;
}

/* Show More Button Styles */
/* .algolia-load-more {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 30px auto;
    padding: 12px 20px;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.algolia-load-more:hover {
    background-color: #003d7a;
}

.algolia-load-more-disabled {
    opacity: 0.5;
    cursor: not-allowed;
} */

.algolia-pagination-root {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.algolia-pagination-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.algolia-pagination-item {
    margin: 0 5px;
}

.algolia-pagination-link {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
}

.algolia-pagination-selected-item .algolia-pagination-link {
    background-color: #0056b3;
    color: white;
    border-color: #0056b3;
}

.algolia-pagination-disabled-item .algolia-pagination-link {
    color: #ccc;
    cursor: not-allowed;
}

.ais-Hits-item, .ais-InfiniteHits-item {
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .algolia-hits-item {
        flex: 0 0 calc(33.333% - 7px);
        display: flex;
    }
}

@media (max-width: 768px) {
    .algolia-hits-item {
        flex: 0 0 calc(50% - 5px);
        display: flex;
    }
    
    .results_area {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }
    
    .search_results {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .algolia-hits-item {
        flex: 0 0 calc(50% - 5px);
        display: flex;
    }
    
    .product_details_search {
        height: auto;
        min-height: 80px;
    }
    
    .product_block_search {
        height: 240px;
    }
    
    .product_details_search h3 {
        font-size: 13px;
        height: 34px;
        margin-bottom: 2px;
    }
    
    .product_sku_search {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .product_price_search {
        font-size: 14px;
    }
    
    .search_header {
        flex-direction: column;
    }
    
    .search_header_right {
        margin-top: 10px;
    }
    
    .product_image_search {
        padding-top: 70%;
    }
    
    .algolia-hits-list {
        gap: 8px;
    }
}

.search_header {
    margin-bottom: 15px;
}

.search_title {
    font-size: 22px;
    margin: 0;
}

/* Machine-specific styles */
.machine_item {
    border: 1px solid #e0f0ff;
    background-color: #f8fbff;
}

.machine_item .product_details_search h3 a {
    color: #0066cc;
}

.item_type_badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #0066cc;
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 500;
    z-index: 2;
}

/* Item Type Menu Styles */
.algolia-menu-root {
    margin-bottom: 15px;
}

.algolia-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.algolia-menu-item {
    margin-bottom: 5px;
}

.algolia-menu-link {
    display: block;
    padding: 5px 10px;
    text-decoration: none;
    color: #333;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.algolia-menu-link:hover {
    background-color: #f5f5f5;
}

.algolia-menu-item-selected .algolia-menu-link {
    background-color: #0066cc;
    color: white;
}

.algolia-menu-count {
    float: right;
    background-color: rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 0 8px;
    font-size: 11px;
}

.algolia-menu-item-selected .algolia-menu-count {
    background-color: rgba(255,255,255,0.2);
} 