/* Hnojik Search */

/* Reset theme styles na search a badge v top baru */
.site-top-bar .hvg-search,
.site-top-bar .hvg-user-badge,
.site-top-bar li.hvg-user-badge-menu-item {
    box-shadow: none !important;
    border: none !important;
    background: none !important;
    float: none !important;
}

/* Search v top-bar menu */
li.hvg-search-menu-item {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    float: left;
}

.hvg-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Form */
.hvg-search-form {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border: none;
    border-radius: 22px;
    overflow: hidden;
    transition: background 0.2s;
}

.hvg-search-form:focus-within {
    background: #eaebec;
}

/* Lupa ikona - skrytá, nahrazena ::before uvnitř formu */
.hvg-search-icon {
    display: none;
}

.hvg-search-form::before {
    content: "\f002";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 13px;
    color: #999;
    padding-left: 14px;
    flex-shrink: 0;
}

/* Input */
.hvg-search-input {
    border: none;
    outline: none;
    padding: 9px 10px 9px 8px;
    font-size: 14px;
    width: 130px;
    background: transparent;
    color: #374151;
}

.hvg-search-input::placeholder {
    color: #b0b0b0;
    font-weight: 400;
}

/* Tlačítko Hledat - desktop */
.hvg-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #5b9a3c;
    color: #fff;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border-radius: 0 22px 22px 0;
    transition: background 0.2s;
    white-space: nowrap;
}

.hvg-search-btn:hover {
    background: #4a8530;
}

/* Loading state */
.hvg-search--loading .hvg-search-icon i {
    animation: hvg-spin 1s linear infinite;
}

@keyframes hvg-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Results dropdown */
.hvg-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 360px;
    max-height: 440px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 9999;
}

.hvg-search-results--open {
    display: block;
}

/* Group */
.hvg-search-group {
    padding: 4px 0;
}

.hvg-search-group + .hvg-search-group {
    border-top: 1px solid #f3f4f6;
}

.hvg-search-group-title {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

/* Result item */
.hvg-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: #374151;
    transition: background 0.15s;
}

.hvg-search-item:hover {
    background: #f9fafb;
    text-decoration: none;
    color: #111827;
}

.hvg-search-item-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}

.hvg-search-item-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 16px;
}

.hvg-search-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hvg-search-item-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hvg-search-item-title mark {
    background: #fef08a;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.hvg-search-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.hvg-search-item-price {
    color: #111827;
    font-weight: 600;
}

.hvg-search-item-price del {
    color: #9ca3af;
    font-weight: 400;
}

.hvg-search-item-price ins {
    text-decoration: none;
    color: #dc2626;
    font-weight: 700;
}

.hvg-search-stock--in {
    color: #4a7c59;
}

.hvg-search-stock--out {
    color: #dc2626;
}

.hvg-search-item-type {
    color: #6b7280;
}

/* Empty state */
.hvg-search-empty {
    padding: 20px 14px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* All results link */
.hvg-search-all {
    display: block;
    padding: 10px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #4a7c59;
    text-decoration: none;
    border-top: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.hvg-search-all:hover {
    background: #f0fdf4;
    text-decoration: none;
    color: #3d6a4a;
}

/* Responsive - mobil: pill shape bez rámečku, lupa + text */
@media (max-width: 1024px) {
    .hvg-search-btn {
        display: none !important;
    }

    .hvg-search-form {
        background: #f3f4f6;
        border: none !important;
        border-radius: 20px;
        box-shadow: none !important;
        outline: none !important;
    }

    .hvg-search-form:focus-within {
        background: #eaebec;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
    }

    .hvg-search-input {
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .hvg-search-icon {
        display: none !important;
    }

    .hvg-search-form::before {
        content: "\f002";
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 14px;
        color: #999;
        padding-left: 14px;
        flex-shrink: 0;
    }

    .hvg-search {
        max-width: 160px;
        flex-shrink: 1;
    }

    .hvg-search-input {
        width: 85px;
        min-width: 0;
        padding: 10px 12px 10px 8px;
        font-size: 16px; /* 16px = iPhone nezoomuje */
    }

    .hvg-search-results {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: auto;
        min-width: 100%;
        max-height: 70vh;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }
}
