/* ============================================================================
   Canin — the suggestion panel under the search box. Phase 3.

   Prefix `cs-`, kept clear of `sx-` (shop listing), `vrev-` (reviews) and `hm-`
   (home), so this file can be dropped in without touching any of them.

   The panel hangs from the field's own wrapper, which search-suggest.js makes
   position:relative if it is not already. That is what lets the same markup work
   in the home hero and in the mobile header, which lay their forms out very
   differently.
   ========================================================================== */

.cs-box {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    z-index: 60;
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .13);
    padding: 5px;
    text-align: right;
}

.cs-box[hidden] { display: none; }

.cs-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text, #111827);
    /* Keyboard navigation moves .is-active, so the rows must not also react to
       :focus — two highlights at once reads as a bug. */
    outline: none;
}

.cs-row:hover,
.cs-row.is-active {
    background: var(--surface-2, #f3f4f6);
}

/* ------------------------------------------------------------- product row */

.cs-thumb {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--surface-2, #f3f4f6);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cs-text {
    /* min-width:0 is what lets the title actually truncate: a flex item defaults
       to min-width:auto and refuses to shrink below its content. */
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cs-title {
    font-size: 12.5px;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    color: var(--muted, #6b7280);
}

.cs-meta b {
    color: var(--primary, #2563eb);
    font-weight: 700;
}

.cs-vendors::before {
    content: '·';
    margin-inline-end: 6px;
}

/* -------------------------------------------------- category / brand rows */

.cs-sep {
    height: 1px;
    margin: 5px 9px;
    background: var(--border, #e5e7eb);
}

.cs-tag {
    flex: 0 0 auto;
    font-size: 10.5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--surface-2, #f3f4f6);
    color: var(--muted, #6b7280);
}

.cs-name {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----------------------------------------------------------- see-all row */

.cs-row--all {
    justify-content: center;
    margin-top: 3px;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary, #2563eb);
    background: var(--surface-2, #f8fafc);
}

.cs-row--all:hover,
.cs-row--all.is-active {
    background: var(--primary, #2563eb);
    color: #fff;
}

/* -------------------------------------------------------------- phone ---- */

@media (max-width: 640px) {
    .cs-box { max-height: 300px; }
    .cs-thumb { flex-basis: 32px; width: 32px; height: 32px; }
    .cs-title { font-size: 12px; }
}
