/* ─── Overlay ──────────────────────────────────────────────────────── */

.hzm-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9499;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.hzm-search-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* ─── Panel ───────────────────────────────────────────────────────── */

.hzm-search {
    position: fixed;
    z-index: 9500;
    top: 10vh;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    width: 680px;
    max-width: 90vw;
    max-height: 75vh;
    background: #fff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hzm-search--open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

body.hzm-search-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0px);
}

/* ─── Header ──────────────────────────────────────────────────────── */

.hzm-search__header {
    padding: 16px 24px;
    border-bottom: 1.5px solid #e9ecef;
}

.hzm-search__input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hzm-search__input-wrap svg {
    flex-shrink: 0;
}

.hzm-search__input {
    flex: 1;
    padding: 8px 0;
    font-size: 1.05rem;
    border: none;
    outline: none;
    background: transparent;
    color: #212529;
    font-family: inherit;
}

.hzm-search__input::placeholder {
    color: #adb5bd;
}

.hzm-search__close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.hzm-search__close-btn kbd {
    padding: 3px 8px;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
}

/* ─── Body ────────────────────────────────────────────────────────── */

.hzm-search__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ─── Sections ────────────────────────────────────────────────────── */

.hzm-search__section {
    margin-bottom: 28px;
}

.hzm-search__section:last-child {
    margin-bottom: 0;
}

.hzm-search__section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6c757d;
    margin: 0 0 12px 0;
}

/* ─── Popular Tags ────────────────────────────────────────────────── */

.hzm-search__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hzm-search__tag {
    padding: 6px 16px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: #495057;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.hzm-search__tag:hover {
    border-color: var(--hzm-accent, #D4A857);
    color: var(--hzm-accent, #D4A857);
}

/* ─── Categories Grid ─────────────────────────────────────────────── */

.hzm-search__categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.hzm-search__category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.hzm-search__category:hover {
    background: #f8f9fa;
    color: var(--hzm-accent, #D4A857);
}

.hzm-search__category .material-icons {
    font-size: 20px;
    color: var(--hzm-accent, #D4A857);
}

/* ─── Quick Products (New) ────────────────────────────────────────── */

.hzm-search__quick-products {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hzm-search__quick-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.hzm-search__quick-product:hover {
    background: #f8f9fa;
}

.hzm-search__quick-product img {
    width: 56px;
    height: 42px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 4px;
    flex-shrink: 0;
}

.hzm-search__quick-product strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #212529;
}

.hzm-search__quick-product span {
    font-size: 0.78rem;
    color: #6c757d;
    font-weight: 600;
}

/* ─── Search Results ──────────────────────────────────────────────── */

.hzm-search__results-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 12px;
}

.hzm-search__results-categories {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f3f5;
}

.hzm-search__results-cat-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #adb5bd;
    margin-bottom: 6px;
}

.hzm-search__results-cat-link {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 4px 4px 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--hzm-primary, #004F65);
    background: #f0f7f9;
    text-decoration: none;
    border-radius: 3px;
    transition: background 0.15s;
}

.hzm-search__results-cat-link:hover {
    background: #dbeef3;
}

.hzm-search__result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 0 -12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    border-radius: 4px;
}

.hzm-search__result:hover,
.hzm-search__result--active {
    background: #f8f9fa;
}

.hzm-search__result img {
    width: 64px;
    height: 48px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 6px;
    flex-shrink: 0;
}

.hzm-search__result-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.hzm-search__result-brand {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
}

.hzm-search__result-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hzm-search__result-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--hzm-accent, #D4A857);
}

/* ─── No Results ──────────────────────────────────────────────────── */

.hzm-search__no-results {
    text-align: center;
    padding: 48px 0;
}

.hzm-search__no-results svg {
    margin-bottom: 12px;
}

.hzm-search__no-results p {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 4px 0;
}

.hzm-search__no-results span {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ─── All Results Link ────────────────────────────────────────────── */

.hzm-search__all-results {
    display: block;
    text-align: center;
    padding: 12px;
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hzm-primary, #004F65);
    text-decoration: none;
    border-top: 1px solid #f1f3f5;
    transition: background 0.15s;
}

.hzm-search__all-results:hover {
    background: #f8f9fa;
}

/* ─── Loading ─────────────────────────────────────────────────────── */

.hzm-search__loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.hzm-search__spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid #e9ecef;
    border-top-color: var(--hzm-primary, #004F65);
    border-radius: 50%;
    animation: hzm-spin 0.6s linear infinite;
}

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

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 576px) {
    .hzm-search {
        top: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100%;
        transform: translateX(-50%) translateY(0);
    }

    .hzm-search--open {
        transform: translateX(-50%) translateY(0);
    }

    .hzm-search__categories {
        grid-template-columns: repeat(2, 1fr);
    }

    .hzm-search__body {
        padding: 16px;
    }
}
