/* =====================================================
   WRAPPER GLOBAL
   ===================================================== */

.ch-sas-wrapper {
    position: relative;
    max-width: 520px;
}

.ch-sas-form {
    position: relative;
}


/* =====================================================
   CHAMP DE RECHERCHE
   ===================================================== */

.ch-sas-input-wrap {
    position: relative;
}

.ch-sas-input {
    width: 100%;
    height: 46px;
    padding: 0 52px 0 14px; /* espace pour la loupe */
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Bouton loupe */
.ch-sas-submit {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}


/* =====================================================
   DROPDOWN RESULTATS AJAX
   ===================================================== */

.ch-sas-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 999;

    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;

    box-shadow: 0 8px 28px rgba(0,0,0,0.08);
    overflow: hidden;
}


/* =====================================================
   LISTE RESULTATS
   ===================================================== */

ul.ch-sas-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ch-sas-item {
    border-bottom: 1px solid #efefef;
	list-style: none;
}

.ch-sas-item:last-child {
    border-bottom: 0;
}


/* =====================================================
   ITEM RESULTAT (AVEC VIGNETTE)
   ===================================================== */

.ch-sas-item a {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;
    text-decoration: none;
    color: #222;
}

.ch-sas-item a:hover {
    background: #f7f7f7;
}


/* --- VIGNETTE --- */

.ch-sas-item-thumb-wrap {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.ch-sas-item-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;

    border-radius: 6px;
    background: #f2f2f2;
}

/* placeholder si pas d’image */
.ch-sas-item-thumb--empty {
    border: 1px solid #e3e3e3;
    background: #f7f7f7;
}


/* --- CONTENU TEXTE --- */

.ch-sas-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;

    flex: 1 1 auto;
    min-width: 0; /* important pour ellipsis si besoin */
}

.ch-sas-item-title {
    font-weight: 400;
    line-height: 1.3;
}

.ch-sas-item-type {
    font-size: 12px;
    opacity: 0.6;
    white-space: nowrap;
}


/* =====================================================
   ETATS / ACTIONS
   ===================================================== */

.ch-sas-no-result,
.ch-sas-all-results {
    padding: 12px 14px;
}

.ch-sas-see-all {
    width: 100%;
    border: 1px solid #ddd;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
}

.ch-sas-see-all:hover {
    background: #f0f0f0;
}


/* =====================================================
   PAGE RESULTATS (FULL PAGE)
   ===================================================== */

.ch-sas-page-results {
    max-width: 960px;
    margin: 0 auto;
}

.ch-sas-page-list {
    display: grid;
    gap: 20px;
}

.ch-sas-page-item {
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 18px;
}


/* vignette page résultats */
.ch-sas-thumb {
    margin: 10px 0;
}

.ch-sas-thumb img {
    display: block;
    max-width: 120px;
    height: auto;
}

/* Compteur résultats */
.ch-sas-meta {
    padding: 8px 12px;
    font-size: 12px;
    color: #777;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/** top header search */
/* Champ recherche dans le header Divi */
/* ==============================
   RECHERCHE SOUS LE MENU
   ============================== */

.ch-header-search-row {
    padding: 10px 0 16px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.ch-header-search {
    max-width: 460px;
    margin: 0 auto;
}

.ch-header-search .ch-sas-wrapper {
    max-width: 100%;
}

.ch-header-search .ch-sas-input {
    height: 42px;
    font-size: 15px;
}

/* dropdown bien centré sous le champ */
.ch-header-search .ch-sas-results {
    text-align: left;
}