/**
 * Klevu Quick Search Custom Styles
 * 
 * Custom styles for Klevu Quick Search functionality.
 * This file is loaded independently of any theme selection.
 * 
 * @package Klevu_Product_Feed
 * @since 1.9.1
 * @updated 1.9.2 - Added search overlay
 * @updated 1.9.3 - Added infinite scroll message
 */

/* ============================================== */
/* ========= SEARCH OVERLAY/BACKDROP ============ */
/* ============================================== */

/**
 * Dark overlay element that appears behind search results
 * to focus attention on the search dropdown
 */
#klevu-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: auto;
}

#klevu-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/**
 * Ensure Klevu quick search appears above page content
 * Note: Only z-index is set, position is handled by Klevu
 */
.klevuWrap {
    z-index: 999999 !important;
}

/* ============================================== */
/* ========= SHOW ALL RESULTS BUTTON =========== */
/* ============================================== */

.kuShowAllResultsContainer {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #ddd;
    background-color: #fafafa;
}

.kuShowAllResultsBtn {
    display: inline-block;
    background-color: #222;
    color: #fff;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.kuShowAllResultsBtn:hover {
    background-color: #000;
    color: #fff;
    text-decoration: none;
}

.kuShowAllResultsBtn:active {
    transform: scale(0.98);
}

/* Arrow styling */
.kuShowAllResultsBtn .kuArrow {
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.kuShowAllResultsBtn:hover .kuArrow {
    transform: translateX(3px);
}

/* ============================================== */
/* ========= RESPONSIVE STYLES ================= */
/* ============================================== */

@media screen and (max-width: 768px) {
    .kuShowAllResultsContainer {
        padding: 12px 15px;
    }
    
    .kuShowAllResultsBtn {
        width: 100%;
        padding: 14px 20px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .kuShowAllResultsBtn {
        padding: 12px 16px;
        font-size: 12px;
        letter-spacing: 0.5px;
    }
}

/* ============================================== */
/* ========= INFINITE SCROLL MESSAGE ============ */
/* ============================================== */

/**
 * "Scroll for more" message shown at bottom of search results
 * when infinite scroll is enabled and more results exist
 */
.klevu-scroll-more-message {
    display: none;
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.klevu-scroll-more-message .klevu-scroll-arrow {
    display: inline-block;
    margin-right: 8px;
    animation: klevu-bounce 1.5s ease-in-out infinite;
}

@keyframes klevu-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(5px);
    }
}
