/* ================================
   PROFESSIONAL AJAX SEARCH
================================ */

.kas-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    gap: 6px;
}

/* Category */
.kas-category {
    width: 180px;
    border: none;
    border-right: 1px solid #e5e7eb;
    padding: 10px 12px;
    font-size: 14px;
    background: transparent;
    outline: none;
}

/* Input */
.kas-input-wrap {
    position: relative;
    flex: 1;
}

.kas-input {
    width: 100%;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

/* Suggestions */
.kas-suggestions {
    display: none;
    margin-top: 8px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.kas-suggestions span {
    background: #f1f5f9;
    color: #0f172a;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.kas-suggestions span:hover {
    background: #e2e8f0;
}

/* Results dropdown */
.kas-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    z-index: 9999;
    display: none;
}

.kas-results ul {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.kas-no {
    padding: 12px;
    color: #64748b;
    text-align: center;
}

/* ================================
   SEARCH RESULT – PRODUCT LAYOUT
================================ */

.kas-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    color: #0f172a;
    text-decoration: none;
}

.kas-item:hover {
    background: #f8fafc;
}

.kas-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.kas-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kas-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
}

.kas-price {
    font-size: 13px;
    color: #16a34a;
    font-weight: 600;
    line-height: 1.2;
}

/* ================================
   MOBILE
================================ */
@media (max-width: 768px) {

    .kas-wrap {
        max-width: 100%;
        flex-direction: column;
    }

    .kas-category {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .kas-input {
        width: 100%;
    }

    .kas-suggestions {
        justify-content: flex-start;
    }

    .kas-item img {
        width: 42px;
        height: 42px;
    }

    .kas-title {
        max-width: 100%;
    }
}

/* ================================
   DESKTOP HEADER OVERRIDES
================================ */
@media (min-width: 1025px) {

    .site-header-row {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
    }

    .site-header-section-center,
    .site-header-section-center .site-header-item {
        width: 100% !important;
        max-width: none !important;
    }

    .kas-wrap {
        width: 100% !important;
        max-width: none !important;
    }

    .kas-category {
        width: 200px;
    }

    .kas-input {
        min-width: 450px;
    }
}

/* ================================
   DESKTOP FIX – KADENCE + WC
================================ */
@media (min-width: 769px) {

    /* Remove Kadence underline */
    .kas-results a {
        background-image: none !important;
        box-shadow: none !important;
        border-bottom: 0 !important;
        text-decoration: none !important;
    }

    /* Keep WC regular price strike */
    .kas-results del {
        text-decoration: line-through !important;
    }

    /* Sale price clean */
    .kas-results ins {
        text-decoration: none !important;
    }

    .kas-results a::before,
    .kas-results a::after {
        display: none !important;
        content: none !important;
    }
}




/* =====================================================
   MOBILE FIX – Equal full-width search fields
   Scope: mobile only
===================================================== */
@media (max-width: 768px) {

    .kas-wrap {
        width: 100%;
        padding: 6px;
    }

    .kas-category,
    .kas-input-wrap,
    .kas-input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .kas-input {
        display: block;
    }
}

