.kadence-ajax-search-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}
.kadence-ajax-search-wrapper * {
    box-sizing: border-box;
}
.kas-search-input {
    width: 100%;
    border: 1px solid;
    outline: 0;
    transition: all 0.15s ease-in-out;
    -webkit-appearance: none;
    appearance: none;
}
.kas-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid;
    border-top: none;
    z-index: 99999;
    max-height: 340px;
    overflow-y: auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.kas-results-hidden {
    display: none !important;
}
.kas-section-title {
    background: rgba(0, 0, 0, 0.03);
    padding: 8px 14px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.75px;
}
.kas-result-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out;
}
.kas-result-thumb, .kas-forum-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 12px;
    border-radius: 6px;
    flex-shrink: 0;
}
.kas-forum-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    font-size: 16px;
}
.kas-result-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kas-no-result {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    opacity: 0.6;
}

/* --- Icône déclencheur --- */
.kas-icon-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: 0;
    color: inherit;
}
.kas-icon-trigger svg {
    display: block;
}

/* --- Popup modale --- */
.kas-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 999999;
    padding: 10vh 20px;
    box-sizing: border-box;
    overflow-y: auto;
}
.kas-modal-overlay.kas-modal-open {
    display: block;
}
.kas-modal-box {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.3);
}
.kas-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 6px;
}
.kas-modal-close:hover {
    color: #1e293b;
}
/* La recherche dans la popup prend toute la largeur disponible,
   quels que soient les réglages desktop/tablette/mobile du header. */
.kas-modal-box .kadence-ajax-search-wrapper {
    width: 100% !important;
    max-width: 100% !important;
}
body.kas-modal-active {
    overflow: hidden;
}
@media (max-width: 600px) {
    .kas-modal-overlay { padding: 15px; }
    .kas-modal-box { padding: 16px; }
}