/* BV Search Autocomplete CSS */

/* Autocomplete Container */
.bv-woo-autocomplete-container {
    position: absolute;
    top: 100%;
    left: -20%;
    right: -20%;
    background: white;
    border: 2px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 500px;
    overflow-y: auto;
    margin-top: 8px;
    display: none;
}

/* Show autocomplete when visible */
.bv-woo-autocomplete-container.show {
    display: block;
}

/* Autocomplete Items */
.bv-woo-autocomplete-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 4px;
}

.bv-woo-autocomplete-item:hover {
    background-color: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bv-woo-autocomplete-item.selected {
    background-color: #f5f5f5;
}

/* Product Image Container */
.bv-woo-autocomplete-item .product-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    margin-right: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #f0f0f0;
}

.bv-woo-autocomplete-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info Container */
.bv-woo-autocomplete-item .product-info {
    flex: 1;
    min-width: 0;
}

/* Product Title */
.bv-woo-autocomplete-item .product-title {
    font-weight: 700;
    color: #333;
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-wrap: break-word;
    max-height: 2.8em; /* 2 lines * 1.4 line-height */
}

/* Product Price */
.bv-woo-autocomplete-item .product-price {
    color: #333;
    font-weight: 700;
    font-size: 18px;
}

/* Scrollbar Styling */
.bv-woo-autocomplete-container::-webkit-scrollbar {
    width: 8px;
}

.bv-woo-autocomplete-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.bv-woo-autocomplete-container::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.bv-woo-autocomplete-container::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* View All Button */
.bv-view-all-button {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 12px 16px;
    cursor: pointer;
    color: #333;
    position: sticky;
    bottom: 0;
}

.bv-view-all-button:hover {
    background: #e9ecef;
    color: #000;
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .bv-woo-autocomplete-container {
        left: -10%;
        right: -10%;
        max-height: 400px;
    }
    
    .bv-woo-autocomplete-item {
        padding: 12px 16px;
    }
    
    .bv-woo-autocomplete-item .product-image {
        width: 60px;
        height: 60px;
        margin-right: 12px;
    }
    
    .bv-woo-autocomplete-item .product-title {
        font-size: 14px;
    }
    
    .bv-woo-autocomplete-item .product-price {
        font-size: 16px;
    }
}

/* Mobile Full Page Search */
@media (max-width: 480px) {
    .bv-mobile-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        z-index: 9999;
        display: none;
        /* Prevent body scroll when keyboard is open */
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }
    
    .bv-mobile-search-overlay.show {
        display: block;
    }
    
    .bv-mobile-search-header {
        background: #ffffff;
        color: white;
        padding: 15px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .bv-mobile-search-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
    }
    
    .bv-mobile-search-close {
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .bv-mobile-search-close-top {
        position: absolute;
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.7);
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        padding: 8px;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        z-index: 10001;
    }
    
    .bv-mobile-search-close-top:hover {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .bv-mobile-search-input {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
    }
    
    .bv-mobile-search-input input {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        font-size: 16px;
        background: #f8f9fa;
    }
    
    .bv-mobile-search-input input:focus {
        outline: none;
        border-color: #333;
        background: white;
    }
    
    .bv-mobile-search-results {
        flex: 1;
        overflow-y: auto;
        padding: 10px 20px 80px 20px;
        /* Prevent scroll issues with keyboard */
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
        -webkit-overflow-scrolling: touch;
    }
    
    .bv-mobile-search-results .bv-woo-autocomplete-item {
        padding: 16px 20px;
        margin-bottom: 8px;
        border-radius: 8px;
        border: 1px solid #f0f0f0;
    }
    
    .bv-mobile-search-results .product-image {
        width: 70px;
        height: 70px;
        margin-right: 16px;
    }
    
    .bv-mobile-search-results .product-title {
        font-size: 16px;
    }
    
    .bv-mobile-search-results .product-price {
        font-size: 18px;
    }
    
    .bv-mobile-search-results .bv-view-all-button {
        position: fixed;
        bottom: 10px;
        left: 20px;
        right: 20px;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        padding: 16px 20px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        border-radius: 8px;
        font-weight: 600;
        color: #333;
        font-size: 16px;
        z-index: 10000;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .bv-mobile-search-results .bv-view-all-button:hover {
        background: #e9ecef;
        color: #000;
    }
    

} 