/* Smartweb Smart Search — type-ahead so živými náhľadmi. */

.sws {
    --sws-accent: var(--rfx-orange, #0064b1);
    --sws-accent-dark: var(--rfx-orange-dark, #00548f);
    --sws-text: var(--rfx-text, #1f2937);
    --sws-border: var(--rfx-border, #e5e7eb);
    position: relative;
    width: 100%;
}

.sws-form { position: relative; display: flex; width: 100%; }

.sws-lens {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--sws-accent);
    color: #fff;
    pointer-events: none;
    z-index: 2;
}
.sws-lens .sws-ic { width: 16px; height: 16px; }

div.sws input.sws-input {
    width: 100%;
    height: 46px;
    padding: 12px 44px 12px 50px;
    border: 1px solid var(--sws-border);
    border-radius: var(--rfx-radius-pill, 999px);
    font-size: 16px; /* 16px bráni auto-zoomu iOS Safari pri fokuse */
    background: #fff;
    outline: none;
}
div.sws input.sws-input:focus {
    border-color: var(--sws-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sws-accent) 18%, transparent);
}
div.sws input.sws-input::-webkit-search-cancel-button,
div.sws input.sws-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
@media (min-width: 768px) {
    div.sws input.sws-input { font-size: .9rem; }
}

.sws-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(0, 0, 0, .4);
    cursor: pointer;
    z-index: 2;
}
.sws-clear:hover { background: rgba(0, 0, 0, .06); color: var(--sws-text); }
.sws-clear .sws-ic { width: 15px; height: 15px; }

.sws-ic { width: 14px; height: 14px; flex: 0 0 auto; }
.sws-accent { color: var(--sws-accent); }

/* ---------- dropdown ---------- */

.sws-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, calc(100vw - 24px));
    z-index: 1050;
    background: #fff;
    border: 1px solid var(--sws-border);
    border-radius: 14px;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .28);
    overflow: hidden;
    font-size: .875rem;
    color: var(--sws-text);
    text-align: left;
}

/* ---------- história ---------- */

.sws-history { border-bottom: 1px solid var(--sws-border); }

.sws-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, .03);
}
.sws-group-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .55);
}
.sws-history-clear {
    border: 0;
    background: none;
    font-size: 11px;
    color: rgba(0, 0, 0, .5);
    cursor: pointer;
    padding: 0;
}
.sws-history-clear:hover { color: var(--sws-text); text-decoration: underline; }

.sws-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.sws-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 999px;
    background: #fff;
    padding: 4px 6px 4px 12px;
    transition: border-color .15s;
}
.sws-chip:hover { border-color: var(--sws-accent); }
.sws-chip-term {
    border: 0;
    background: none;
    padding: 0;
    font-size: 13px;
    color: var(--sws-text);
    cursor: pointer;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sws-chip-term:hover { color: var(--sws-accent); }
.sws-chip-x {
    border: 0;
    background: none;
    padding: 0;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: rgba(0, 0, 0, .4);
    cursor: pointer;
}
.sws-chip-x:hover { background: rgba(0, 0, 0, .1); color: var(--sws-text); }
.sws-chip-x .sws-ic { width: 11px; height: 11px; }

/* ---------- výsledky ---------- */

.sws-loading { padding: 18px; text-align: center; color: rgba(0, 0, 0, .55); }

.sws-empty {
    padding: 24px;
    text-align: center;
    color: rgba(0, 0, 0, .55);
    display: grid;
    justify-items: center;
    gap: 8px;
}
.sws-empty .sws-ic { width: 20px; height: 20px; }

.sws-link {
    border: 0;
    background: none;
    padding: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--sws-accent);
    cursor: pointer;
}
.sws-link:hover { text-decoration: underline; }

.sws-split { display: grid; }
@media (min-width: 768px) {
    .sws-split { grid-template-columns: 300px 1fr; }
}

.sws-left { max-height: 480px; overflow-y: auto; }
@media (min-width: 768px) {
    .sws-left { border-right: 1px solid var(--sws-border); }
}

.sws-group { border-bottom: 1px solid var(--sws-border); }
.sws-group:last-of-type { border-bottom: 0; }

.sws-list { list-style: none; margin: 0; padding: 0; }
.sws-row {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 6px 12px;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    color: var(--sws-text);
    transition: background-color .12s;
}
.sws-row:hover, .sws-row.is-active { background: rgba(0, 0, 0, .05); }

.sws-row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.sws-row-count { margin-left: auto; font-size: 12px; color: rgba(0, 0, 0, .5); flex: 0 0 auto; }

/* Náhľady v zoznamoch: jednotný štvorec pre kategórie aj produkty, fotka na bielom. */
.sws-thumb, .sws-thumb-sm {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    overflow: hidden;
    display: block;
}
.sws-thumb img, .sws-thumb-sm img { display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; padding: 2px; }

.sws-row-meta { min-width: 0; flex: 1; }
.sws-row-name {
    font-size: 13px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sws-row-brand {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .5);
}

.sws-all {
    display: block;
    width: 100%;
    padding: 11px;
    border: 0;
    border-top: 1px solid var(--sws-border);
    background: rgba(0, 0, 0, .02);
    font-size: .875rem;
    font-weight: 500;
    color: var(--sws-text);
    text-align: center;
    cursor: pointer;
}
.sws-all:hover { background: rgba(0, 0, 0, .05); }

/* ---------- pravý náhľadový panel ---------- */

.sws-right {
    display: none;
    max-height: 480px;
    overflow-y: auto;
    background: rgba(0, 0, 0, .02);
    padding: 14px;
}
@media (min-width: 768px) {
    .sws-right { display: block; }
}

.sws-right-label {
    margin-bottom: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .55);
}
.sws-right-hint {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    padding: 28px 0;
    font-size: 12px;
    color: rgba(0, 0, 0, .5);
}

/* minmax(0, 1fr) + min-width: 0 - dlhý názov/cena inak roztiahne stĺpec a karty (aj obrázky) majú rôznu šírku. */
.sws-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sws-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s, box-shadow .12s;
}
.sws-card:hover { border-color: rgba(0, 0, 0, .3); }
.sws-card.is-active {
    border-color: var(--sws-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--sws-accent) 30%, transparent);
}
.sws-card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    margin-bottom: 6px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    overflow: hidden;
    display: block;
}
.sws-card-img img { display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; padding: 6px; }
.sws-card-brand {
    font-size: 9px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .5);
}
.sws-card-name {
    font-size: 12px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sws-card-price { margin-top: 4px; font-size: 13px; font-weight: 700; }
.sws-card-price del { color: rgba(0, 0, 0, .45); font-weight: 400; margin-right: 4px; }
.sws-card-price ins { text-decoration: none; color: var(--sws-accent); }

.sws-attrs {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
}
.sws-attrs-title {
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .5);
}
.sws-attr { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; }
.sws-attr dt { color: rgba(0, 0, 0, .6); font-weight: 400; }
.sws-attr dd { margin: 0; text-align: right; font-weight: 500; }

/* ---------- presná zhoda (hero) ---------- */

.sws-exact { display: grid; gap: 16px; padding: 16px; }
@media (min-width: 768px) {
    .sws-exact { grid-template-columns: 200px 1fr; }
}
.sws-exact-img {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    overflow: hidden;
    display: block;
}
.sws-exact-img img { display: block; width: 100%; height: 100%; max-height: 100%; object-fit: contain; padding: 12px; }
.sws-exact-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sws-exact-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--sws-accent) 12%, #fff);
    color: var(--sws-accent);
    font-size: 11px;
    font-weight: 600;
}
.sws-exact-brand {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .55);
}
.sws-exact-name { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.sws-exact-price { font-size: 1.35rem; font-weight: 700; color: var(--sws-accent); }
.sws-exact-price del { font-size: 1rem; color: rgba(0, 0, 0, .45); font-weight: 400; margin-right: 6px; }
.sws-exact-price ins { text-decoration: none; }
.sws-exact-attrs { margin-top: 2px; width: 100%; }
.sws-exact-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--sws-accent);
    color: #fff;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
}
.sws-exact-open:hover { background: var(--sws-accent-dark); }
