/* Cart Icon */
.ajax-cart-container {
    position: relative;
    display: inline-block;
    background: rgba(100%, 100%, 100%, 28%);
    border-radius: 50%;
}

.ajax-cart-icon {
    position: relative;
    cursor: pointer;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    color: white;
}

.ajax-cart-icon svg {
    width: 15px;
    height: 15px;
}

.cart-count {
    position: absolute;
    top: -3px;
    right: -3px;
    background: red;
    color: white;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    font-family: poppins, sans-serif;
}

/* Sidebar */
.ajax-cart-sidebar {
    position: fixed;
    top: 0;
    padding-top: 100px;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: poppins, sans-serif;
}

.ajax-cart-sidebar.active {
    right: 0;
}

.cart-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-sidebar-header h3 {
    margin: 0;
    font-size: 20px;
}

.cart-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.cart-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Cart Items */
.cart-items {
    flex: 1;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.item-image {
    flex-shrink: 0;
}

.item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.item-price {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #f5f5f5;
}

.qty-input {
    width: 40px;
    height: 25px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.remove-item {
    position: absolute;
    top: 10px;
    right: 0;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 25px;
    height: 25px;
    line-height: 1;
    padding: 0;
}

.remove-item:hover {
    color: #e74c3c;
}

/* Cart Footer */
.cart-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn-view-cart,
.btn-checkout {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    margin-bottom: 10px;
}

.btn-view-cart {
    background: #f5f5f5;
    color: #333;
}

.btn-view-cart:hover {
    background: #e5e5e5;
}

.btn-checkout {
    background: #20a092;
    color: white;
}

.btn-checkout:hover {
    background: grey;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* Overlay */
.ajax-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ajax-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}
input#custom-product-search-field {
    padding: 10px;
    border-radius: 10px;
    border: none;
    width: 30vw;
}
/* Styling for the overall search container */
.custom-ajax-search-container {
    position: relative; /* Important for positioning results */
    margin: 0 auto; /* Center the search bar */
    z-index: 1000; /* Ensure it's above other content */
}

/* Styling for the search input field */
.custom-ajax-search-form .search-field {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    background-color: #fff; /* Ensure white background for input */
    color: #333;
}

/* Styling for the search results dropdown container */
.custom-search-results {
    position: absolute;
    top: 100%; /* Position right below the search input */
    left: 0;
    width: 100%;
    background-color: #ffffff; /* White background as requested */
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 0 0 5px 5px;
    z-index: 1001; /* Higher than search container */
    overflow-y: auto; /* Enable scrolling if many results */
    max-height: 300px; /* Limit height */
    display: none; /* Hidden by default, shown by JS */
}

/* Styling for the unordered list of results */
.custom-search-results .custom-search-suggestions {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Styling for each individual search result item */
.custom-search-results .custom-search-suggestions li {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.custom-search-results .custom-search-suggestions li:last-child {
    border-bottom: none;
}

/* Styling for the link wrapping the product image and details */
.custom-search-results .custom-search-suggestions li a {
    display: flex; /* Use flexbox for image and text next to each other */
    align-items: center; /* Vertically align items */
    text-decoration: none; /* Remove underline */
    color: #333; /* Default text color */
}

/* Styling for the product thumbnail image */
.custom-search-results .custom-search-suggestions li a .search-thumbnail {
    width: 30px;  /* Set image width */
    height: 30px; /* Set image height */
    object-fit: cover; /* Crop image to fit */
    margin-right: 10px; /* Space between image and text */
    border-radius: 3px; /* Slightly rounded corners for images */
}

/* Styling for the product name (title) */
.custom-search-results .custom-search-suggestions li a .result-details h3 {
    margin: 0;
    font-size: 14px;
    color: #000000; /* Black text for product name */
    line-height: 1.2;
    font-weight: normal; /* Adjust font weight if desired */
}

/* Styling for the price */
.custom-search-results .custom-search-suggestions li a .result-details .price {
    font-size: 12px;
    color: #666; /* Lighter color for price */
    display: block; /* New line for price */
}

/* Hover effect for search results */
.custom-search-results .custom-search-suggestions li a:hover {
    background-color: #f5f5f5; /* Light grey background on hover */
}

/* Styling for "No products found" message */
.custom-search-results .no-results,
.custom-search-results .loading-results {
    padding: 10px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ajax-cart-sidebar {
        width: 100%;
        right: -100%;
    }
}