/* Search dropdown styles */

/* Prevent search form from becoming compact when dropdown is open */
body.scroll header form.has-results-open {
    width: 350px !important;
    background: transparent !important;
    cursor: default !important;
}

body.scroll header form.has-results-open input {
    opacity: 1 !important;
    right: 40px !important;
}

body.scroll header form.has-results-open button {
    opacity: 1 !important;
    right: 0 !important;
}

.search-dropdown {
    text-align: left;
    position: absolute;
    top: calc(100% + 8px);
    /* Align to the right of the input */
    right: 0;
    left: auto;
    width: 650px;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
}

body.scroll .search-dropdown {
    top: 100%;
}

.search-dropdown.has-results {
    border-top: 1px solid #ddd;
}

.search-results-container {
    display: flex;
    min-height: 100px;
}

.search-results-column {
    flex: 1;
    padding: 15px;
}

.search-result-item {
    display: block;
    text-decoration: none;
}

.pages-column {
    border-right: 1px solid #eee;
}

.column-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.total-results {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* Page items styling */
.page-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.page-item:hover {
    background-color: #f8f9fa;
}

.page-item:last-child {
    border-bottom: none;
}

.page-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.page-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Featured product styling */
.featured-product {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.featured-product:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-image-large {
    text-align: center;
    margin-bottom: 15px;
}

.product-image-large img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.product-info {
    flex-grow: 1;
}

.product-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.product-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Small product list */
.additional-products-list {
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.small-product {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.small-product:hover {
    background-color: #f8f9fa;
}

.product-image-small {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 3px;
    background-color: #f8f9fa;
}

.product-image-small img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-title-small {
    font-size: 13px;
    color: #333;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results,
.search-loading,
.search-error {
    padding: 20px 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.search-loading {
    color: #999;
}

.search-error {
    color: #d9534f;
    background-color: #fdf7f7;
}

.search-no-results {
    color: #888;
}

/* Search results page styles */
#searchInfo {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
    color: #495057;
}

#searchInfo p {
    margin: 0;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #007bff;
    background-color: #fff;
    border-radius: 4px;
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination .current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .prev,
.pagination .next {
    font-weight: bold;
}

.pagination .prev:hover,
.pagination .next:hover {
    background-color: #0056b3;
    color: white;
    border-color: #0056b3;
}

.search-results-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
}

.featured-product {
    flex: 1 1 60%;
    min-width: 300px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.featured-product:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-link {
    text-decoration: none;
    color: inherit;
}

.product-image-large {
    text-align: center;
    margin-bottom: 20px;
}

.product-image-large img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.product-info .product-title {
    font-size: 24px;
    margin: 0 0 15px 0;
    color: #333;
}

.product-description {
    color: #666;
    line-height: 1.6;
}

.additional-products {
    flex: 1 1 35%;
    min-width: 250px;
}

.additional-products h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.product-item {
    text-align: center;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    padding: 15px 10px;
    transition: all 0.3s ease;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #e0e0e0;
}

.product-image {
    margin-bottom: 10px;
}

.product-image img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.product-name {
    font-size: 14px;
    color: #333;
    margin: 0;
}

/* Responsive adjustments for search results page */
@media (max-width: 992px) {
    .search-results-container {
        flex-direction: column;
    }
    
    .featured-product,
    .additional-products {
        flex: 1 1 100%;
    }
}

@media (max-width: 576px) {
    .search-dropdown {
        top: calc(100% + 40px);
        left: -20px;
        right: -20px;
        width: calc(100% + 40px);
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .product-item {
        padding: 10px 5px;
    }
    
    .product-info .product-title {
        font-size: 20px;
    }
    
    #searchInfo {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        margin: 0 2px;
        font-size: 14px;
    }
}