/* SMAI Pametna pretraga */

/* Panel stoji na <body> sa position:fixed, van svih stacking konteksta
   headera i Elementora, pa ga nista ne moze prekriti. */
.smai-s-panel {
    position: fixed;
    z-index: 2147483000;
    background: #fff;
    color: #333;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .16);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.smai-s-panel[hidden] {
    display: none !important;
}

.smai-s-inner {
    padding: 6px 0 4px;
}

/* --- naslovi sekcija --- */
.smai-s-title {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #9a9a9a;
}

.smai-s-sec + .smai-s-sec {
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.smai-s-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.smai-s-panel li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --- zajednicko za stavke --- */
.smai-s-panel a.smai-s-item {
    display: block;
    text-decoration: none;
    color: inherit;
    box-shadow: none;
}

.smai-s-panel a.smai-s-item:hover,
.smai-s-panel a.smai-s-item.smai-s-on {
    background: #f5f7f9;
}

.smai-s-panel mark {
    background: transparent;
    color: inherit;
    font-weight: 700;
    padding: 0;
}

/* --- kategorije: cisto tekstualno --- */
.smai-s-cats a.smai-s-item {
    padding: 7px 14px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.smai-s-cat-name {
    font-size: 14px;
    font-weight: 600;
    color: #1c1c1c;
}

.smai-s-cat-path {
    font-size: 11px;
    color: #a0a0a0;
    flex: 1 1 auto;
}

.smai-s-cat-path::before {
    content: "u ";
}

.smai-s-cat-count {
    margin-left: auto;
    font-size: 11px;
    color: #b0b0b0;
    flex: 0 0 auto;
}

/* --- proizvodi --- */
.smai-s-prods a.smai-s-item {
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.smai-s-thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 5px;
    overflow: hidden;
    background: #f4f4f4;
    display: block;
}

.smai-s-thumb img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    display: block;
    border-radius: 5px;
}

.smai-s-prod-txt {
    min-width: 0;
    flex: 1 1 auto;
}

.smai-s-prod-name {
    display: block;
    font-size: 13.5px;
    color: #1c1c1c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.smai-s-prod-price {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1c1c1c;
}

.smai-s-prod-price del {
    font-weight: 400;
    opacity: .5;
    margin-right: 5px;
}

.smai-s-prod-price ins {
    text-decoration: none;
}

/* --- oznake, sitno --- */
.smai-s-title-sm {
    padding-bottom: 2px;
}

.smai-s-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 2px 14px 10px;
}

.smai-s-panel a.smai-s-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid #e6e6e6;
    border-radius: 11px;
    font-size: 11px;
    line-height: 1.6;
    color: #6a6a6a;
    background: #fafafa;
}

.smai-s-panel a.smai-s-tag:hover,
.smai-s-panel a.smai-s-tag.smai-s-on {
    background: #eef2f5;
    border-color: #d3dde4;
    color: #333;
}

.smai-s-tag-count {
    font-size: 10px;
    color: #b4b4b4;
}

/* --- svi rezultati --- */
.smai-s-panel a.smai-s-all {
    display: block;
    padding: 10px 14px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: #1c1c1c;
}

/* --- poruke --- */
.smai-s-msg {
    padding: 16px 14px;
    text-align: center;
}

.smai-s-msg-t {
    display: block;
    font-size: 13.5px;
    color: #444;
}

.smai-s-msg-s {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #a0a0a0;
}

.smai-s-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.smai-s-spin {
    width: 15px;
    height: 15px;
    border: 2px solid #dcdcdc;
    border-top-color: #7a7a7a;
    border-radius: 50%;
    animation: smai-s-spin .7s linear infinite;
    display: inline-block;
}

@keyframes smai-s-spin {
    to { transform: rotate(360deg); }
}

/* --- samostalna forma iz shortcode-a --- */
.smai-s-form {
    display: flex;
    align-items: stretch;
    max-width: 520px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.smai-s-form input[type="search"] {
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    padding: 9px 12px;
    font-size: 14px;
    background: transparent;
    box-shadow: none;
    min-width: 0;
}

.smai-s-form button {
    flex: 0 0 auto;
    border: 0;
    background: #f3f3f3;
    padding: 0 14px;
    cursor: pointer;
    color: #444;
    display: flex;
    align-items: center;
}

.smai-s-form button:hover {
    background: #e9e9e9;
}

/* --- rezerva ---
   Ako se JS iz nekog razloga ne izvrsi, bar da padajuci prozor teme
   ne zavrsi ispod headera. */
.wd-search-results,
.wd-dropdown-results {
    z-index: 100000 !important;
}

@media (max-width: 560px) {
    .smai-s-panel {
        font-size: 13.5px;
    }
    .smai-s-thumb,
    .smai-s-thumb img {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
}
