/* Autocomplete container */
.aa-Autocomplete {
    width: 100%;
    position: relative;
}

:root {
    --aa-detached-media-query: (max-width: 0px);
    --aa-detached-modal-media-query: (min-width: 0px);
}

/* Panel styling with width transitions */
.aa-Panel {
    z-index: 99999 !important;
    transition: all 0.3s ease-in-out;
}

/* Top searches panel - width matches input field */
.aa-Panel {
    min-width: auto !important;
    max-width: 100% !important;
    transform: none !important;
}

@media (min-width: 768px) {
    .aa-Panel {
        width: 800px !important;
        transform: translateX(-36%) !important;
    }
    .aa-Panel .aa-PanelLayout { 
        height: 100%;
        display: flex;
    }
    .aa-Panel .aa-Source[data-source-id="products"] { 
        overflow-y: auto; 
    }
}

@media (min-width: 1000px) {
    .aa-Panel {
        transform: translateX(-32%) !important;
    }
}

@media (min-width: 1200px) {
    .aa-Panel {
        transform: translateX(-28%) !important;
    }
}

/* Form styling */
.aa-Form {
    flex-direction: row-reverse;
    border: 2px solid var(--bg-primary);
    border-radius: 30px;
    padding-left: 10px;
}

.aa-Form:focus-within {
    border-color: var(--bg-primary);
    box-shadow: none;
    outline: none;
}

.aa-Form button .aa-SubmitIcon {
    margin-top: 3px;
}

.aa-Form button svg {
    fill: var(--bg-primary);
}

.aa-Form button:hover {
    background-color: transparent;
}

.aa-Input {
    font-size: 13px;
}

.aa-LoadingIndicator {
    display: none !important;
}

.aa-Label {
    margin-bottom: 0 !important;
}

.aa-InputWrapperSuffix {
    padding: 0 10px 0 0;
}

.aa-ClearButton {
    padding: 0;
}

/* Layout for top searches (single column) */
.aa-Source[data-autocomplete-source-id="suggestions"] {
    width: 100%;
    padding-right: 7px;
}

.aa-PanelLayout:has(.aa-Source + .aa-Source) .aa-Source {
    border-right: 1px solid #ebeaea;
}

.aa-Source[data-autocomplete-source-id="products"] {
    border-right: none !important;
}

.aa-Source[data-autocomplete-source-id="suggestions"] .aa-List,
.aa-Source[data-autocomplete-source-id="suggestions"] .aa-Items {
    display: block;
}

.aa-Source[data-autocomplete-source-id="products"] { 
    padding-left: 7px;
}

.aa-Item {
    display: block;
    width: 100%;
}

/* Headers */
.aa-SourceHeader { 
    text-transform: uppercase; 
    letter-spacing: .5px;
    padding: 2px 7px 1px;
    font-weight: 700;
    color: #333;
    font-size: 13px;
}

/* Suggestion items */
.aa-Source[data-autocomplete-source-id="suggestions"] .aa-SuggestionItem { 
    display: flex; 
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
}

.aa-Source[data-autocomplete-source-id="suggestions"] .aa-SuggestionItem .aa-Idx {
    font-size: 13px;
    padding-right: 4px;
    min-width: 14px;
    color: #000000;
}

.aa-Source[data-autocomplete-source-id="suggestions"] .aa-SuggestionItem .aa-Label {
    flex: 1 1 auto;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 13px;
    white-space: normal; 
    word-break: break-word;
    color: #000000;
}

/* Product cards */
.aa-ProductCard { 
    display: flex; 
    gap: 10px; 
    padding: 10px 12px; 
    align-items: center; 
}

.aa-ProductCard__image { 
    width: 64px; 
    height: 64px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    background: #fff; 
    border-radius: 4px; 
    overflow: hidden; 
}

.aa-ProductCard__image img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

.aa-ProductCard__info { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.aa-ProductCard__title { 
    font-size: 13px;
    line-height: 12px;
    color: #333; 
    text-decoration: none; 
}

.aa-ProductCard__price { 
    display: flex; 
    gap: 8px; 
    align-items: baseline; 
}

.aa-Price {
    color: #434343;
}

.aa-Price--old { 
    color: #999; 
    text-decoration: line-through; 
    font-size: 12px; 
}

.aa-Price--special { 
    color: #d32f2f; 
    font-weight: 700; 
}

.aa-AddToCart {
    background-color: #3DC04E !important;
    color: #ffffff !important;
    padding: 2px 5px 3px !important;
    border-radius: 5px !important;
    margin-top: 2px !important;
    align-self: flex-start;
    font-size: 12px;
}

.aa-AddToCart:hover {
    color: #ffffff;
}

/* Links */
.aa-Panel a:hover {
    color: #000000;
}

/* See all section */
.aa-SeeAllWrapper { 
    padding: 10px 12px; 
    text-align: left; 
}

.aa-SeeAll { 
    font-size: 13px;
    color: #000000;
    font-weight: lighter;
    text-decoration: underline;
}

.aa-SeeAll:hover {
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .aa-Panel {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        height: auto !important;
        transform: none !important;
        border-radius: 0px;
    }

    .aa-PanelLayout:has(.aa-Source + .aa-Source) .aa-Source {
        border-right: none !important;
    }

    .aa-Source[data-autocomplete-source-id="suggestions"],
    .aa-Source[data-autocomplete-source-id="products"] {
        padding: 0px;
    }

    .aa-ProductCard {
        border: 1px solid #f1f1f1;
        border-radius: 5px;
    }
}