﻿/* ============================
   PAGE DE RECHERCHE
   ============================ */
.page--search {
    padding: clamp(1rem, 4vw, 2.5rem);
    min-height: 32rem;
}

.search {
    max-width: 760px;
    margin: 0 auto;
}

.search__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #222;
}

.search__bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

/* Champ + liste des suggestions */
.search__field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search__input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 1rem;
    line-height: 1.3;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search__input:focus {
    border-color: #d41f26;
    box-shadow: 0 0 0 3px rgba(212, 31, 38, 0.18);
}

/* Bouton */
.search__button {
    background: linear-gradient(135deg, #d41f26, #a80e12);
    color: #fff;
    font-size: 1rem;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.search__button:hover {
    opacity: 0.85;
}

.search__button:focus-visible {
    outline: 3px solid rgba(212, 31, 38, 0.45);
    outline-offset: 2px;
}

.search__hint {
    margin: 0 0 1.5rem;
    font-size: 0.92rem;
    color: #666;
    line-height: 1.4;
}

/* ============================
   SUGGESTIONS
   ============================ */
.search__suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10000;
    max-height: 340px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.search__suggestions[hidden] {
    display: none;
}

.ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    cursor: pointer;
}

.ac-item.is-active,
.ac-item:hover {
    background: #f5f5f5;
}

.ac-item__image {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ac-item__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.ac-item__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ac-item__title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.ac-item__meta {
    font-size: 0.8rem;
    color: #777;
}

/* ============================
   PARCOURIR PAR CATÉGORIE
   ============================ */
.search__browse {
    max-width: 760px;
    margin: 0 auto;
}

.search__browse-title {
    margin: 0 0 0.9rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
}

.search__cats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 600px) {
    .search__cats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.search__cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    height: 100%;
    padding: 1rem 0.5rem;
    box-sizing: border-box;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    color: #222;
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.18s ease-out, border-color 0.18s ease-out;
}

.search__cat i {
    font-size: 1.4rem;
    color: #d41f26;
}

.search__cat-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.search__cat-count {
    font-size: 0.8rem;
    color: #777;
}

.search__cat:hover,
.search__cat:focus-visible {
    border-color: rgba(212, 31, 38, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.search__cat:focus-visible {
    outline: 3px solid rgba(212, 31, 38, 0.45);
    outline-offset: 2px;
}

/* ============================
   TÉLÉPHONE
   ============================ */
@media (max-width: 600px) {
    .search__bar {
        flex-direction: column;
    }

    .search__button {
        width: 100%;
        padding: 12px 18px;
    }
}
