/* Carmo Smart Search — storefront autocomplete dropdown.
   All rules scoped under .carmo-ss / .carmo-ss-anchor. */

.carmo-ss-anchor {
    position: relative;
}

.carmo-ss {
    /* Desktop / tablet (>= 768px): positioned against the form via
       .carmo-ss-anchor. Below 768px, carmo_smart_search.js sets inline
       position: fixed / left / right / top instead, because Wokiee's mobile
       search panel clips an absolutely-positioned child to its own box. */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
    font-size: 14px;
    line-height: 1.4;
}

.carmo-ss[hidden] {
    display: none;
}

.carmo-ss-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: inherit;
    text-decoration: none;
}

.carmo-ss-item:hover,
.carmo-ss-item:focus,
.carmo-ss-item.carmo-ss-active {
    background: #f5f5f5;
}

.carmo-ss-img {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
}

.carmo-ss-img img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.carmo-ss-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.carmo-ss-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.carmo-ss-model {
    color: #888;
    font-size: 12px;
}

.carmo-ss-price {
    flex: 0 0 auto;
    text-align: right;
    color: #b40000;
    font-weight: bold;
    white-space: nowrap;
}

/* The Wokiee theme styles <mark> as white text on a near-black chip
   (theme.css: `.mark, mark`), which is unreadable on our pale highlight.
   Every property it sets is restated here, colour included. */
.carmo-ss mark {
    background: #fff3b0;
    color: #191919;
    padding: 0;
    border-radius: 0;
    font-weight: 600;
}

.carmo-ss-none {
    padding: 8px 12px;
    color: #888;
}

.carmo-ss-more {
    display: block;
    padding: 8px 12px;
    text-align: center;
    color: #b40000;
    font-weight: bold;
    text-decoration: none;
    border-top: 1px solid #e9e9e9;
}

.carmo-ss-more:hover {
    background: #f5f5f5;
}

/* Hide Wokiee's own instant-search results container only while our dropdown
   is active — carmo_smart_search.js adds .carmo-ss-on to <html> exactly when
   config.enabled is not false. With autocomplete off, Wokiee's container is
   the shopper's only suggestion source and stays visible. */
html.carmo-ss-on .search-results .resultsContainer {
    display: none !important;
}

@media (max-width: 767px) {
    /* Geometry (position/left/right/top) is set inline by the JS below this
       breakpoint; this rule only makes sure the dropdown reads full-width
       even for the instant the JS has not positioned it yet. */
    .carmo-ss {
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .carmo-ss,
    .carmo-ss-item,
    .carmo-ss-more {
        transition: none !important;
    }
}

/* v1.1.0: help articles in the dropdown and above the results. */
.carmo-ss-heading {
    padding: 6px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #777;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}
.carmo-ss-help .carmo-ss-help-icon,
.carmo-ss-category .carmo-ss-help-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin-right: 10px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #555;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
}
.carmo-help {
    margin: 0 0 24px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    background: #fff;
}
.carmo-help h2.carmo-help-title {
    margin: 0;
    padding: 12px 16px;
    font-size: 18px;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid #e6e6e6;
}
.carmo-help-item + .carmo-help-item {
    border-top: 1px solid #f0f0f0;
}
.carmo-help-item summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
}
.carmo-help-answer {
    padding: 0 16px 16px;
}
.carmo-help-answer iframe {
    max-width: 100%;
}

/* Categories whose name answers the search, above the results: clickable tiles. */
.carmo-cat {
    margin: 0 0 24px;
}
.carmo-cat-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}
.carmo-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.carmo-cat .carmo-cat-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e6e6e6;
    border-left: 4px solid #f26a21;
    border-radius: 4px;
    background: #fff;
    color: #222;
    text-decoration: none;
    transition: box-shadow .15s, border-color .15s;
}
.carmo-cat .carmo-cat-link:hover,
.carmo-cat .carmo-cat-link:focus {
    border-color: #f26a21;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    color: #222;
}
.carmo-cat-img {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    object-fit: contain;
}
.carmo-cat-text {
    flex: 1 1 auto;
    min-width: 0;
}
.carmo-cat-name {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}
.carmo-cat-path {
    display: block;
    margin-top: 4px;
    color: #777;
    font-size: 12px;
}
.carmo-cat-arrow {
    flex: 0 0 auto;
    color: #f26a21;
    font-size: 28px;
    line-height: 1;
}
.carmo-cat-products-title {
    margin: 24px 0 0;
}
