/**
 * RNF Live Search — Front CSS
 * Design system DA RAF (Rose&Fly)
 */

.rnf-ls-wrapper {
    --rnf-ls-burgundy: #8B2252;
    --rnf-ls-rose: #C1526E;
    --rnf-ls-nude: #F9F1EE;
    --rnf-ls-gold: #B8956A;
    --rnf-ls-text: #333;
    --rnf-ls-text-light: #666;
    --rnf-ls-border: #e8d8d8;
    --rnf-ls-radius: 12px;
    --rnf-ls-shadow: 0 8px 32px rgba(139, 34, 82, 0.12);
    --rnf-ls-font-display: 'Playfair Display', Georgia, serif;
    --rnf-ls-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    font-family: var(--rnf-ls-font-body);
}

/* ============= Search bar ============= */
.rnf-ls-form {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--rnf-ls-border);
    border-radius: var(--rnf-ls-radius);
    transition: border-color .2s, box-shadow .2s;
}

.rnf-ls-form:focus-within {
    border-color: var(--rnf-ls-burgundy);
    box-shadow: 0 0 0 3px rgba(139, 34, 82, 0.08);
}

.rnf-ls-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    color: var(--rnf-ls-burgundy);
    pointer-events: none;
}

.rnf-ls-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    font-size: 15px;
    color: var(--rnf-ls-text);
    outline: none;
    font-family: inherit;
}

.rnf-ls-input::placeholder { color: #aaa; }

.rnf-ls-clear {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    margin-right: 6px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--rnf-ls-text-light);
    font-size: 22px;
    line-height: 1;
    transition: background .2s;
}
.rnf-ls-clear:hover { background: var(--rnf-ls-nude); color: var(--rnf-ls-burgundy); }

/* ============= Dropdown ============= */
.rnf-ls-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--rnf-ls-radius);
    box-shadow: var(--rnf-ls-shadow);
    border: 1px solid var(--rnf-ls-border);
    overflow: hidden;
    z-index: 9999;
    max-height: 70vh;
    overflow-y: auto;
}

.rnf-ls-content {
    padding: 8px 0;
}

/* ============= Loading ============= */
.rnf-ls-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--rnf-ls-text-light);
    font-size: 14px;
}

.rnf-ls-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--rnf-ls-nude);
    border-top-color: var(--rnf-ls-burgundy);
    border-radius: 50%;
    animation: rnf-ls-spin .7s linear infinite;
}

@keyframes rnf-ls-spin {
    to { transform: rotate(360deg); }
}

/* ============= Suggestion "Vouliez-vous dire ?" ============= */
.rnf-ls-suggestion {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--rnf-ls-nude) 0%, #fff 100%);
    border-bottom: 1px solid var(--rnf-ls-border);
    font-size: 14px;
    color: var(--rnf-ls-text);
}

.rnf-ls-rosy {
    margin-right: 4px;
}

.rnf-ls-suggestion-link {
    background: none;
    border: none;
    color: var(--rnf-ls-burgundy);
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rnf-ls-suggestion-link:hover { color: var(--rnf-ls-rose); }

/* ============= Sections ============= */
.rnf-ls-section-title {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--rnf-ls-text-light);
}

/* ============= Liste produits ============= */
.rnf-ls-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rnf-ls-item {
    border-bottom: 1px solid #f5ecec;
}
.rnf-ls-item:last-child { border-bottom: none; }

.rnf-ls-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}

.rnf-ls-item:hover .rnf-ls-item-link,
.rnf-ls-item.is-active .rnf-ls-item-link {
    background: var(--rnf-ls-nude);
}

.rnf-ls-item-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.rnf-ls-item-body {
    flex: 1;
    min-width: 0;
}

.rnf-ls-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--rnf-ls-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rnf-ls-item-cats {
    font-size: 12px;
    color: var(--rnf-ls-text-light);
    margin-top: 2px;
}

.rnf-ls-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.rnf-ls-item-price {
    font-size: 13px;
    color: var(--rnf-ls-burgundy);
    font-weight: 600;
}

.rnf-ls-item-price del {
    color: var(--rnf-ls-text-light);
    font-weight: 400;
    margin-right: 4px;
}

.rnf-ls-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.rnf-ls-badge-sale {
    background: var(--rnf-ls-burgundy);
    color: #fff;
}
.rnf-ls-badge-out {
    background: #f5f5f5;
    color: var(--rnf-ls-text-light);
}

.rnf-ls-item.is-fuzzy { opacity: .92; }

/* ============= "Voir tous les résultats" ============= */
.rnf-ls-view-all {
    display: block;
    text-align: center;
    padding: 12px;
    margin: 8px 12px 4px;
    background: var(--rnf-ls-burgundy);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s;
}
.rnf-ls-view-all:hover { background: var(--rnf-ls-rose); color: #fff; }

/* ============= État vide ============= */
.rnf-ls-empty {
    padding: 24px 20px;
    text-align: center;
}

.rnf-ls-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: .6;
}

.rnf-ls-empty-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--rnf-ls-text);
    margin: 0 0 4px;
}

.rnf-ls-empty-text {
    font-size: 13px;
    color: var(--rnf-ls-text-light);
    margin: 0 0 16px;
}

.rnf-ls-empty-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.rnf-ls-empty-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    background: var(--rnf-ls-nude);
    border-radius: 8px;
    text-decoration: none;
    color: var(--rnf-ls-text);
    transition: transform .15s, background .15s;
    font-size: 12px;
}

.rnf-ls-empty-cat:hover {
    transform: translateY(-2px);
    background: #fff;
    color: var(--rnf-ls-burgundy);
    box-shadow: 0 2px 8px rgba(139, 34, 82, 0.1);
}

.rnf-ls-empty-cat img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
}

.rnf-ls-empty-cat span {
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* ============= Mobile ============= */
@media (max-width: 600px) {
    .rnf-ls-dropdown {
        max-height: 75vh;
        font-size: 14px;
    }
    .rnf-ls-item-thumb { width: 42px; height: 42px; }
    .rnf-ls-item-link  { padding: 8px 12px; }
    .rnf-ls-section-title { padding-left: 12px; padding-right: 12px; }
}
