/**
 * WP X Search - Styles (fully independent, no Qode/theme classes)
 * @author 360x.dev
 */

.wpx-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

@media (min-width: 1025px) {
    .wpx-search-btn { display: none !important; }
    .wpx-search-panel { display: none !important; }
}

@media (max-width: 1024px) {

    .wpx-search-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: 0;
        padding: 0;
        margin: 0;
        color: #111;
        cursor: pointer;
        position: relative;
        line-height: 1;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .wpx-search-btn svg { width: 22px; height: 22px; display: block; }

    /* --- Panel ----------------------------------------------------------- */

    .wpx-search-panel {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        z-index: 999990;
        pointer-events: none;
    }
    .wpx-search-panel[hidden] { display: none !important; }
    .wpx-search-panel:not([hidden]) { display: block !important; pointer-events: auto; }

    .wpx-search-backdrop {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: transparent;
        z-index: 1;
    }

    /* Shell: flat, no shadow on top, clean extension of header */
    .wpx-search-shell {
        position: fixed;
        top: var(--wpx-header-bottom, 60px);
        left: 0; right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: 0 4px 6px -2px rgba(0,0,0,0.06);
        padding: 10px 12px;
        box-sizing: border-box;
    }

    .wpx-search-close { display: none !important; }

    .wpx-search-form { display: block; width: 100%; }

    .wpx-search-row {
        display: flex;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    .wpx-search-input {
        flex: 1 1 auto;
        min-width: 0;
        height: 44px;
        padding: 0 12px;
        background: #f5f5f5;
        border: 1px solid #ddd;
        border-radius: 2px;
        font-size: 16px;
        color: #111;
        box-sizing: border-box;
        outline: none;
        appearance: none;
        -webkit-appearance: none;
        line-height: 1.4;
    }
    .wpx-search-input::placeholder { color: #999; }
    .wpx-search-input:focus { border-color: #f47c20; background: #fff; }

    .wpx-search-submit {
        flex: 0 0 auto;
        height: 44px;
        padding: 0 14px;
        background: #f47c20;
        color: #fff;
        border: 0;
        border-radius: 2px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        cursor: pointer;
        white-space: nowrap;
        appearance: none;
        -webkit-appearance: none;
    }
    .wpx-search-submit:active { background: #d96a10; }

    /* --- Results --------------------------------------------------------- */

    .wpx-search-results {
        margin-top: 6px;
        background: #fff;
        border-top: 1px solid #eee;
        overflow: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: var(--wpx-results-max-height, none);
        position: relative;
    }
    .wpx-search-results:empty { display: none; }

    .wpx-search-list { list-style: none; margin: 0; padding: 0; }

    .wpx-search-item { border-bottom: 1px solid #f2f2f2; }
    .wpx-search-item:last-child { border-bottom: 0; }

    .wpx-search-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        text-decoration: none;
        color: inherit;
        box-sizing: border-box;
    }
    .wpx-search-link:active { background: #faf7f4; }

    /* Thumb: compact */
    .wpx-search-thumb {
        flex: 0 0 auto;
        width: 54px;
        height: 54px;
        border-radius: 3px;
        overflow: hidden;
        background: #f0f0f0;
    }
    .wpx-search-thumb img {
        width: 100%; height: 100%;
        object-fit: cover;
        display: block;
    }
    .wpx-search-thumb-placeholder {
        width: 100%; height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ccc;
        font-size: 18px;
    }

    /* Text */
    .wpx-search-content {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .wpx-search-title {
        font-size: 13.5px;
        font-weight: 600;
        line-height: 1.3;
        color: #222;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Meta line */
    .wpx-search-meta {
        font-size: 11.5px;
        line-height: 1.3;
        color: #888;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .wpx-search-meta:empty { display: none; }

    .wpx-search-meta-arrow { margin: 0 3px; color: #bbb; }
    .wpx-search-meta-sep { margin: 0 5px; color: #ccc; }
    .wpx-search-meta-price { font-weight: 700; color: #e06a10; }

    /* States */
    .wpx-search-loading,
    .wpx-search-empty {
        padding: 18px 12px;
        text-align: center;
        color: #999;
        font-size: 13px;
    }

    /* Scroll hint */
    .wpx-scroll-hint {
        position: absolute;
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10;
        pointer-events: none;
        opacity: 1;
        transition: opacity 0.3s ease;
    }
    .wpx-scroll-hint.wpx-hint-hidden { opacity: 0; }
    .wpx-scroll-hint-finger {
        display: block;
        width: 22px; height: 22px;
        color: #bbb;
        animation: wpx-swipe-up 1.2s ease-in-out infinite;
    }
    @keyframes wpx-swipe-up {
        0%   { transform: translateY(5px); opacity: 0.3; }
        50%  { transform: translateY(-3px); opacity: 1; }
        100% { transform: translateY(5px); opacity: 0.3; }
    }

}
