/* ============================================================
   LiptovPortal Search — overlay + live results.
   Dizajn: ostré hrany (žiadne border-radius), LP paleta.
   ============================================================ */

body.lps-open { overflow: hidden; }

.lp-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(5, 14, 32, 0.92);
    padding: 8vh 16px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.lp-search-overlay.open {
    display: block;
    animation: lps-fade-in .18s ease-out;
}
@keyframes lps-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lp-search-overlay__box {
    background: #ffffff;
    padding: 28px 28px 24px;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 24px 72px rgba(0, 0, 0, .35);
    position: relative;
    box-sizing: border-box;
    animation: lps-slide-in .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes lps-slide-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.lp-search-overlay__form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.lp-search-overlay__input {
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    border: 2px solid #D71920;
    padding: 0 16px;
    font-size: 16px;
    color: #0B1F45;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    border-radius: 0 !important;
    -webkit-appearance: none;
    appearance: none;
}
.lp-search-overlay__input:focus {
    border-color: #0B1F45;
}
.lp-search-overlay__input::placeholder {
    color: #8494b4;
    opacity: 1;
}

.lp-search-overlay__submit {
    height: 56px;
    width: 56px;
    background: #D71920;
    color: #ffffff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    -webkit-appearance: none;
    appearance: none;
    transition: background .15s;
}
.lp-search-overlay__submit:hover,
.lp-search-overlay__submit:focus {
    background: #B5141A;
}
.lp-search-overlay__submit svg {
    width: 22px;
    height: 22px;
    stroke: #ffffff;
    fill: none;
}

.lp-search-overlay__close {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #6b7692;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    transition: color .15s, background .15s;
}
.lp-search-overlay__close:hover,
.lp-search-overlay__close:focus {
    color: #D71920;
    background: #f4f6fb;
    outline: none;
}
.lp-search-overlay__close:focus-visible {
    outline: 2px solid #D71920;
    outline-offset: -2px;
}

/* ---------------- Live results ---------------- */
.lps-results {
    margin-top: 18px;
    border-top: 1px solid #dde5f1;
    padding-top: 6px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lps-suggested {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #D71920;
    padding: 10px 4px 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.lps-suggested::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e4e9f5;
}

.lps-group {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #8494b4;
    padding: 12px 4px 6px;
    border-top: 1px solid #f0f3f8;
    margin-top: 4px;
}
.lps-group:first-child {
    border-top: none;
    margin-top: 0;
}

.lps-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 4px;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
    transition: background .12s, border-color .12s;
    border-radius: 0;
}
.lps-result:hover,
.lps-result:focus {
    background: #f4f6fb;
    border-left-color: #D71920;
    outline: none;
}

.lps-thumb {
    width: 64px;
    height: 48px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f2f8;
    border: 1px solid #e4e9f5;
    display: grid;
    place-items: center;
}
.lps-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lps-thumb svg { width: 20px; height: 20px; color: #b0bcd6; }

.lps-info { flex: 1; min-width: 0; }
.lps-title {
    font-size: 15px;
    font-weight: 700;
    color: #0B1F45;
    line-height: 1.3;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lps-title mark {
    background: rgba(215, 25, 32, .14);
    color: inherit;
    padding: 0 1px;
}
.lps-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lps-badge {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #ffffff;
    background: #D71920;
    padding: 2px 8px;
}
.lps-date { font-size: 12px; color: #8494b4; }

/* Kategórie */
.lps-cat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    text-decoration: none;
    color: #0B1F45;
    font-size: 14.5px;
    font-weight: 600;
    transition: background .12s, color .12s;
    border-left: 3px solid transparent;
}
.lps-cat:hover,
.lps-cat:focus {
    background: #f4f6fb;
    border-left-color: #D71920;
    color: #D71920;
    outline: none;
}
.lps-cat svg { width: 18px; height: 18px; color: #D71920; flex-shrink: 0; }
.lps-cat__name { flex: 1; }
.lps-cat__name mark { background: rgba(215, 25, 32, .14); color: inherit; padding: 0 1px; }
.lps-cat__cnt { font-size: 12px; color: #8494b4; }

/* „Všetky výsledky →" */
.lps-all {
    display: block;
    text-align: center;
    padding: 14px 10px;
    margin-top: 10px;
    background: #0B1F45;
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
    transition: background .15s;
    border: 2px solid #0B1F45;
}
.lps-all:hover,
.lps-all:focus {
    background: #D71920;
    border-color: #D71920;
    outline: none;
}

/* Loading / prázdne */
.lps-loading, .lps-empty {
    padding: 28px 10px;
    text-align: center;
    color: #8494b4;
    font-size: 14px;
    line-height: 1.6;
}
.lps-empty span {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    opacity: .8;
}

/* --------------- Responzívne --------------- */
@media (max-width: 767px) {
    .lp-search-overlay {
        padding: 0;
    }
    .lp-search-overlay__box {
        padding: 56px 16px 16px;
        max-width: 100%;
        min-height: 100%;
        box-shadow: none;
    }
    .lp-search-overlay__close {
        top: 6px;
        right: 6px;
    }
    .lp-search-overlay__form {
        gap: 8px;
    }
    .lp-search-overlay__input {
        height: 52px;
        font-size: 16px; /* iOS: aby nezoomoval pri focus */
    }
    .lp-search-overlay__submit {
        height: 52px;
        width: 52px;
    }
    .lps-results {
        max-height: none;
    }
    .lps-title { font-size: 14.5px; }
    .lps-thumb { width: 56px; height: 42px; }
}
