/* Search Suggestions Styles */
.JS-search-suggestions {
    position: absolute;
    top: 100%;
    left: -24%;
    right: -24%;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 600px;
    overflow-y: auto;
    display: none;
    width: 100%;
    min-width: 1000px; /* Wider window for 3 sections */
}

/* 3-column layout container */
.suggestions-container {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr; /* Categories | Top Product | Other Products */
    gap: 20px;
    padding: 20px;
}

/* Section headers */
.suggestion-section {
    border-right: 1px solid #eee;
    padding-right: 20px;
}

.suggestion-section:last-child {
    border-right: none;
    padding-right: 0;
}

.suggestion-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category items */
.suggestion-categories .suggestion-item-category {
    margin-bottom: 10px;
}

.suggestion-item-category a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.suggestion-item-category a:hover {
    background-color: #f5f5f5;
}

.category-image-wrapper {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.category-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.category-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 20px;
}

.category-info {
    flex: 1;
}

.category-name {
    display: block;
    font-weight: 500;
}

.category-count {
    display: block;
    font-size: 12px;
    color: #666;
}

/* Top Product section */
.suggestion-top-product {
    text-align: center;
}

.suggestion-top-product .suggestion-item.top-product-item a img {
    width: 150px;
    height: auto;
    margin: auto;
}

.top-product-badge {
    display: inline-block;
    background: #ff6b00;
    color: white;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.top-product-item img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 10px;
    display: block;
}

.top-product-item .product-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.top-product-item .product-details {
    color: #7A7A7A !important;
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 1rem !important;
    font-size: 14px;
    font-weight: 400;
}

.top-product-item .product-price {
    display: block;
    font-size: 18px;
    color: #00688D;
    font-weight: 700;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    text-decoration: none !important;
}

.top-product-item .product-price * {
    margin: 0;
    padding: 0;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Specific WooCommerce price styling fixes */
.top-product-item .woocommerce-Price-amount,
.top-product-item .custom-price-with-vat,
.top-product-item .custom-price-without-vat {
    text-decoration: none !important;
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
}

.top-product-item .woocommerce-Price-amount del,
.top-product-item .woocommerce-Price-amount ins {
    text-decoration: none !important;
}

/* Products section */
.suggestion-products {
    max-height: 400px;
    overflow-y: auto;
}

.suggestion-item-product {
    margin-bottom: 10px;
}

.suggestion-item-product a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.suggestion-item-product a:hover {
    background-color: #f5f5f5;
}

.suggestion-item-product img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
}

.top-product-item .product-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0;
    padding: 0;
}

.top-product-item .product-info > * {
    margin: 0;
    padding: 0;
}

.top-product-item .product-info .product-name {
    margin-bottom: 8px;
}

.top-product-item .product-info .product-details {
    margin-bottom: 8px !important;
}

.top-product-item a {
    text-decoration: none !important;
    color: inherit;
    border: none !important;
}

.top-product-item a:hover {
    text-decoration: none !important;
}

.top-product-item a:focus {
    text-decoration: none !important;
    outline: none;
}

.suggestion-item {
    border: none !important;
    border-bottom: none !important;
}

.suggestion-item.top-product-item {
    border: none !important;
    border-bottom: none !important;
}

.product-name {
    display: block;
    font-weight: 500;
}

/* Loading state */
.suggestion-loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* Empty state */
.suggestion-empty {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* All results link */
.suggestion-item-all {
    grid-column: 1 / -1;
    text-align: center;
    padding: 15px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.suggestion-item-all a {
    color: #ff6b00;
    text-decoration: none;
    font-weight: 600;
}

.suggestion-item-all a:hover {
    text-decoration: underline;
}

/* Active/hover state for keyboard navigation */
.suggestion-item.suggestion-active {
    background-color: #f5f5f5;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .JS-search-suggestions {
        min-width: 100%;
        max-width: 100%;
        position: fixed;
        top: 60px; /* Adjust based on your header height */
        left: 0;
        right: 0;
        bottom: 0;
        max-height: none;
        border: none;
        border-radius: 0;
    }
    
    .suggestions-container {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }
    
    .suggestion-section {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 15px;
    }
    
    .suggestion-section:last-child {
        border-bottom: none;
    }
    
    .suggestion-section h3 {
        margin-bottom: 10px;
    }
    
    /* Collapsible sections on mobile */
    .suggestion-section.collapsed .suggestion-categories,
    .suggestion-section.collapsed .suggestion-top-product,
    .suggestion-section.collapsed .suggestion-products {
        display: none;
    }
    
    .suggestion-section h3 {
        cursor: pointer;
        position: relative;
        padding-right: 20px;
    }
    
    .suggestion-section h3::after {
        content: '▼';
        position: absolute;
        right: 0;
        top: 0;
        font-size: 12px;
        transition: transform 0.2s;
    }
    
    .suggestion-section.collapsed h3::after {
        transform: rotate(-90deg);
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .top-product-item img {
        width: 80px;
        height: 80px;
    }
    
    .suggestion-item-product img {
        width: 40px;
        height: 40px;
    }
    
    .category-image-wrapper {
        width: 30px;
        height: 30px;
    }
}