/* Hide results wrapper initially */
#predictive-search-results-groups-wrapper {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    display: grid !important;
    grid-template-columns: 35% 65%;
    gap: 0;
}

predictive-search:not([results]) #predictive-search-results-groups-wrapper {
    display: none !important;
}

.predictive-search__results-groups {
    padding: 2rem 2.5rem;
    border-right: 1px solid #e8e8e1;
}

.predictive-search__results-groups:last-child {
    border-right: none;
}

.predictive-search__result-group {
    margin-bottom: 0;
}

.predictive-search__heading {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 1.75rem;
    color: #121212;
    text-transform: uppercase;
    padding-bottom: 0;
    border-bottom: none;
}

.predictive-search__results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.predictive-search__list-item {
    border-bottom: none;
    transition: background-color 0.15s ease;
    margin-bottom: 1.25rem;
}

.predictive-search__list-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.predictive-search__list-item:hover,
.predictive-search__list-item[aria-selected="true"] {
    background-color: transparent;
}

.predictive-search__item {
    display: block;
    padding: 0;
    text-decoration: none;
    color: #121212;
    transition: all 0.15s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.predictive-search__item:hover {
    padding-left: 0;
}

.predictive-search__item--term {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
}

.predictive-search__item-heading {
    display: block;
    font-weight: 500;
    color: #121212;
}

.predictive-search__item-heading strong {
    font-weight: 700;
    color: #000;
}

.predictive-search__item--link-with-thumbnail {
    display: flex;
    align-items: flex-start;
    padding: 0;
    margin-bottom: 1.5rem;
}

.predictive-search__item--link-with-thumbnail:hover {
    padding-left: 0;
}

.predictive-search__item--link-with-thumbnail:last-child {
    margin-bottom: 0;
}

.predictive-search__item-content {
    display: grid;
    grid-template-columns: 73px 1fr;
    grid-template-rows: 100%;
    grid-gap: 14px;
}

.predictive-search__item-content--centered {
    align-items: flex-start;
}

.predictive-search__item-image {
    width: 75px;
    height: 75px;
    object-fit: cover;
    border-radius: 0;
    flex-shrink: 0;
    border: none;
}

.predictive-search__item-details {
    flex: 1;
    display: block;
    padding-top: 25px;
}

.predictive-search__item-details .predictive-search__item-heading {
    font-size: 1rem;
    line-height: 1.5;
    text-decoration: none;
    font-weight: 400;
}

.predictive-search__item-price {
    font-size: 0.875rem;
    color: rgba(18, 18, 18, 0.75);
    font-weight: 400;
    flex: 0 0 auto;
}

.predictive-search__loading-state {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

predictive-search[loading] .predictive-search__loading-state {
    display: flex;
}

predictive-search[results] .predictive-search__loading-state {
    display: none !important;
}

.predictive-search__loading-state .spinner {
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.predictive-search__loading-state .path {
    stroke: #121212;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.predictive-search__no-results {
    padding: 3rem 2rem;
    text-align: center;
    color: rgba(18, 18, 18, 0.75);
    font-size: 0.9375rem;
    grid-column: 1 / -1;
}

.predictive-search__error {
    padding: 3rem 2rem;
    text-align: center;
    color: #c00;
    font-size: 0.9375rem;
    grid-column: 1 / -1;
}

/* Hide the live region count text */
[data-predictive-search-live-region-count-value] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive adjustments */
@media (max-width: 989px) {
    #predictive-search-results-groups-wrapper {
        grid-template-columns: 1fr;
    }
    
    .predictive-search__results-groups {
        border-right: none;
        border-bottom: 1px solid #e8e8e1;
        padding: 1.5rem 2rem;
    }
    
    .predictive-search__results-groups:last-child {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .predictive-search__results-groups {
        padding: 1.25rem 1.5rem;
    }
    
    .predictive-search__item-image {
        width: 60px;
        height: 60px;
    }
    
    .predictive-search__item-content {
        gap: 1rem;
    }
}
