.search-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    /* Stúdió (9000) és kompakt header (10010) fölött – mobilon különben letakaródik */
    z-index: 10025;
}
.search-modal.active { display: block; }

.search-modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    max-width: 860px;
    margin: 40px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
    animation: srchSlideDown 0.22s ease;
}
@keyframes srchSlideDown {
    from { opacity:0; transform:translateY(-20px); }
    to   { opacity:1; transform:translateY(0); }
}

.search-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 36px; height: 36px;
    background: #f3f3f3;
    color: #555;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
}
.search-modal-close:hover { background:#e4e4e4; transform:rotate(90deg); }

.search-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.search-input-wrapper {
    position: relative;
}
.search-icon-left {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
    color: var(--shop-primary);
    opacity: 0.75;
}
.search-input-large {
    width: 100%;
    padding: 14px 48px 14px 44px;
    font-size: 16px;
    border: 1.5px solid #e4e4e4;
    border-radius: 999px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fafafa;
}
.search-input-large:focus {
    border-color: var(--shop-primary);
    box-shadow: 0 0 0 3px rgba(var(--shop-primary-rgb), 0.12);
    background: #fff;
}
.search-input-large::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 14px;
    width: 14px;
    background: var(--shop-primary);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 5.7a1 1 0 0 0-1.4 0L12 10.6 7.1 5.7a1 1 0 0 0-1.4 1.4l4.9 4.9-4.9 4.9a1 1 0 1 0 1.4 1.4l4.9-4.9 4.9 4.9a1 1 0 0 0 1.4-1.4L13.4 12l4.9-4.9a1 1 0 0 0 0-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 5.7a1 1 0 0 0-1.4 0L12 10.6 7.1 5.7a1 1 0 0 0-1.4 1.4l4.9 4.9-4.9 4.9a1 1 0 1 0 1.4 1.4l4.9-4.9 4.9 4.9a1 1 0 0 0 1.4-1.4L13.4 12l4.9-4.9a1 1 0 0 0 0-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
    cursor: pointer;
}

.search-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

.search-suggest-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 20px 12px;
    border-bottom: 1px solid #f3f3f3;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}
.search-suggest-label {
    font-size: 11px;
    font-weight: 600;
    color: #9a9a9a;
    letter-spacing: 0.03em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.search-suggest-label i {
    color: var(--shop-primary);
    font-size: 11px;
}
.search-suggest-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
}
.search-suggest-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    border: none;
    background: #f2f2f3;
    font-size: 12.5px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.search-suggest-chip i {
    font-size: 11px;
    color: var(--shop-primary);
}
.search-suggest-chip:hover {
    border-color: transparent;
    color: var(--shop-primary);
    background: rgba(var(--shop-primary-rgb), 0.12);
    box-shadow: 0 2px 8px rgba(var(--shop-primary-rgb), 0.12);
}

.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.search-filter-total {
    font-size: 12px;
    font-weight: 600;
    color: #777;
    margin-right: 4px;
    white-space: nowrap;
}
.search-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid #e4e4e4;
    background: #f7f7f7;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    white-space: nowrap;
    user-select: none;
}
.search-filter-chip:hover {
    border-color: rgba(var(--shop-primary-rgb), 0.4);
    color: var(--shop-primary);
    background: #fff;
}
.search-filter-chip.active {
    border-color: var(--shop-primary);
    background: var(--shop-primary);
    color: #fff;
    font-weight: 600;
}
.chip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: rgba(0,0,0,0.08);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 0 4px;
    line-height: 1;
}
.search-filter-chip.active .chip-badge {
    background: rgba(255,255,255,0.28);
    color: #fff;
}

.search-section-heading {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 16px 20px 10px;
    margin: 0;
}

.search-result-product {
    display: flex;
    gap: 14px;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f4f4f4;
    transition: background 0.15s;
    align-items: center;
}
.search-result-product:hover { background: rgba(var(--shop-primary-rgb), 0.05); }
.search-result-product:last-child { border-bottom: none; }

.srp-thumb { flex-shrink: 0; display: flex; }
.srp-img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fafafa;
}
.srp-img-placeholder {
    width: 56px; height: 56px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid #eee;
    background: linear-gradient(145deg, #f4f6f8, #eef1f4);
    display: flex;
    align-items: center;
    justify-content: center;
}
.srp-info { flex: 1; min-width: 0; }
.srp-cat {
    font-size: 10px;
    font-weight: 600;
    color: var(--shop-primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}
.srp-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.srp-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 5px 0;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.srp-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--shop-primary);
}

.search-articles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0 20px 8px;
}
.search-result-article {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 10px 12px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f4f4f4;
    transition: background 0.15s;
    border-radius: 8px;
}
.search-result-article:hover { background: rgba(26, 111, 168, 0.04); }
.sra-thumb { flex-shrink: 0; display: flex; }
.sra-img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #f3f7fb;
}
.sra-img-placeholder {
    width: 56px; height: 56px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid #eee;
    background: linear-gradient(145deg, #f4f6f8, #eef1f4);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sra-info { flex: 1; min-width: 0; }
.sra-cat {
    font-size: 10px;
    font-weight: 600;
    color: #1a6fa8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}
.sra-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-all-link {
    display: block;
    padding: 16px 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--shop-primary);
    text-decoration: none;
    border-top: 1px solid #f0f0f0;
}
.search-all-link:hover {
    background: rgba(var(--shop-primary-rgb), 0.05);
}

.search-placeholder, .search-loading, .search-no-results {
    text-align: center;
    padding: 48px 20px;
    color: #999;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.search-loading { color: #666; }
.search-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(var(--shop-primary-rgb), 0.2);
    border-top-color: var(--shop-primary);
    border-radius: 50%;
    animation: searchSpin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .search-modal-content { margin: 10px; max-height: calc(100vh - 20px); border-radius: 14px; }
    .search-modal-header { padding: 14px 16px 12px; }
    .search-modal-body { padding: 0; }
    .search-articles-grid { grid-template-columns: 1fr; padding: 0 12px 8px; }
    .search-result-product { padding: 12px; }
    .search-section-heading { padding: 14px 12px 8px; }
    .search-filter-bar, .search-suggest-bar { padding: 10px 12px 8px; }
    .srp-title { font-size: 14px; }
}
