/*
 * Live Search Custom Styles for Electro Child Theme
*/
.tt-menu {
    background: transparent;
}

.tt-dataset.tt-dataset-search {
    /* Positioning & Sizing */
    position: absolute !important;
    width: 100% !important; /* Match the width of the search input container */
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    z-index: 99999 !important;

    /* Appearance */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    padding: 10px;

    /* Grid Layout */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px; /* Reduced gap */
    max-height: 80vh;
    overflow-y: auto;
}

/* Individual suggestion item - styled as a compact product card */
.tt-suggestion {
    display: block;
    padding: 10px !important; /* Reduced padding */
    border: 1px solid #eee;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    background-color: #fff;
}

/* Hover state for the suggestion card */
.tt-suggestion.tt-cursor,
.tt-suggestion:hover {
    background-color: #f9f9f9 !important;
    border-color: #0088e2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* The link wrapper inside the suggestion */
.tt-suggestion a {
    display: flex;
    flex-direction: row; /* Changed to row for horizontal layout */
    align-items: center;
    text-align: left; /* Align text to the left */
    color: inherit;
    text-decoration: none;
    height: 100%;
}

/* Product image */
.tt-suggestion .media-left {
    margin: 0 10px 0 0; /* Margin to the right of the image */
}

.tt-suggestion .media-left img {
    max-width: 50px; /* Reduced image size */
    height: auto;
}

/* Product details container */
.tt-suggestion .media-body {
    flex-grow: 1;
}

/* Product title (SKU) */
.tt-suggestion .media-heading {
    font-size: 0.9em; /* Reduced font size */
    font-weight: 600;
    margin-bottom: 4px; /* Reduced margin */
    color: #333;
    white-space: normal;
    line-height: 1.3;
}

/* Container for price and stock to sit on one line */
.tt-suggestion .product-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px; /* Space between price and stock */
}

/* Price styling */
.tt-dataset-search .price-wrapper {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: rgb(18, 70, 171) !important;
    margin: 5px 0 !important;
}

.tt-suggestion .price-wrapper del {
    font-size: 0.85em;
    color: #999;
    margin-left: 4px;
}

/* Stock status styling */
.tt-suggestion .product-stock {
    font-size: 0.85em; /* Reduced font size */
}

.tt-suggestion .product-stock.in-stock {
    color: #28a745;
    font-weight: normal;
}

.tt-suggestion .product-stock.out-of-stock {
    color: #dc3545;
}

/* --- Responsive Adjustments --- */

/* Tablets */
@media (max-width: 992px) {
    .tt-dataset.tt-dataset-search {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .tt-dataset.tt-dataset-search {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
    .tt-suggestion a {
        flex-direction: row; /* Keep horizontal layout on mobile */
    }
}