/* ===========================
   WooCommerce Barre de Recherche Avancée — v5.4.0
   =========================== */

:root {
    --wfs-bg:          #e8f5e9;
    --wfs-white:       #ffffff;
    --wfs-accent:      #dd0f07;
    --wfs-accent-h:    #b71c1c;
    --wfs-border:      #d8d8d8;
    --wfs-text:        #333333;
    --wfs-placeholder: #9e9e9e;
    --wfs-radius:      5px;
    --wfs-height:      50px;
    --wfs-font:        'Mulish', Arial, sans-serif;
    --wfs-shadow:      0 1px 4px rgba(0,0,0,0.07);
}

body.wfs-modal-open { overflow: hidden; }

/* =========================================================
   BARRE DE FILTRE
   ========================================================= */
.wfs-wrapper {
    font-family: var(--wfs-font);
    width: 100%;
    position: relative;
}

/* Force fond blanc sur tous les champs — anti-override thème */
.wfs-filter-bar input[type='text'],
.wfs-filter-bar input[type='search'],
.wfs-filter-bar input[type='email'],
.wfs-filter-bar input[type='url'],
.wfs-filter-bar input[type='tel'],
.wfs-filter-bar input[type='number'],
.wfs-filter-bar input[type='date'],
.wfs-filter-bar input[type='password'],
.wfs-filter-bar textarea,
.wfs-filter-bar select {
    background-color: #fff !important;
}

.wfs-filter-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--wfs-bg);
    padding: 18px 20px;
    border-radius: 0px 0px 8px 8px;
    flex-wrap: wrap;
    box-sizing: border-box;
    row-gap: 10px;
}

.wfs-search-wrap {
    flex: 3 1 280px;
    margin-right: 10px;
}

.wfs-input {
    width: 100%;
    height: var(--wfs-height);
    padding: 0 16px;
    background: var(--wfs-white);
    border: 1.5px solid var(--wfs-border);
    border-radius: var(--wfs-radius);
    font-size: 14px;
    color: var(--wfs-text);
    outline: none;
    box-shadow: var(--wfs-shadow);
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: var(--wfs-font);
}

.wfs-input::placeholder { color: var(--wfs-placeholder); }
.wfs-input:focus { border-color: #bbb; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }

.wfs-select-wrap {
    position: relative;
    flex: 2 1 180px;
    margin-right: 10px;
}

.wfs-select {
    width: 100%;
    height: var(--wfs-height);
    padding: 0 38px 0 16px;
    background: var(--wfs-white);
    border: 1.5px solid var(--wfs-border);
    border-radius: var(--wfs-radius);
    font-size: 14px;
    color: var(--wfs-text);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    box-shadow: var(--wfs-shadow);
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: var(--wfs-font);
}

.wfs-select:focus { border-color: #bbb; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }

.wfs-arrow {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 10px;
    pointer-events: none;
}

/* Bouton */
.wfs-btn,
button#wfs-filter-btn {
    height: var(--wfs-height);
    padding: 0 28px;
    background: #dd0f07 !important;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #fff !important;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--wfs-font);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wfs-btn:hover:not(:disabled),
button#wfs-filter-btn:hover:not(:disabled) { background: #b71c1c !important; }
.wfs-btn:active:not(:disabled),
button#wfs-filter-btn:active:not(:disabled) { transform: scale(0.97); }
.wfs-btn:disabled,
button#wfs-filter-btn:disabled { opacity: 0.75; cursor: wait; }

/* Spinner dans le bouton */
.wfs-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wfs-spin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes wfs-spin { to { transform: rotate(360deg); } }

/* =========================================================
   MODALE — design moderne
   ========================================================= */
.wfs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.wfs-modal {
    background: #fff;
    border-radius: 0;
    padding: 0;
    max-width: 820px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.08);
    animation: wfs-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wfs-modal-in {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Barre rouge en haut */
.wfs-modal::before {
    content: '';
    display: block;
    height: 4px;
    background: #dd0f07;
    border-radius: 0;
}

/* Bouton fermer — rouge, rond, hover bleu */
.wfs-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #dd0f07 !important;
    color: #fff !important;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
    z-index: 2;
    float: right;
}
.wfs-modal-close:hover {
    background: rgb(0,16,98) !important;
    color: #fff !important;
}

/* Fix liens dans les cartes — pas de style parasite du thème */
.wfs-mcard-body a {
    border-color: #fff;
    background-color: #fff;
}
.wfs-mcard-body a:hover {
    border-color: #fff;
    background-color: #fff;
}

/* En-tête de la modale */
.wfs-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 28px 32px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.wfs-modal-icon-wrap {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wfs-modal-icon-svg {
    width: 28px;
    height: 28px;
}

.wfs-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 2px 0 6px;
    line-height: 1.3;
    padding-right: 44px;
}

.wfs-modal-msg {
    font-size: 13.5px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* Corps */
#wfs-modal-found-section,
#wfs-modal-suggestions-section {
    padding: 20px 32px;
}

/* Labels de section */
.wfs-modal-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #888;
    margin-bottom: 14px;
}

.wfs-label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wfs-dot-blue { background: rgb(0,16,98); }
.wfs-dot-red  { background: #dd0f07; }

/* Séparateur */
.wfs-modal-sep {
    height: 1px;
    background: #f0f0f0;
    margin: 0 32px;
}

/* =========================================================
   CARTES PRODUITS
   ========================================================= */
.wfs-modal-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.wfs-mcard {
    display: flex;
    flex-direction: column;
    border: 1.5px solid #ebebeb;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit !important;
    background: #fafafa;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.wfs-mcard:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.11);
    transform: translateY(-3px);
    border-color: #ddd;
}

/* Carte produit trouvé ailleurs */
.wfs-mcard-highlight {
    border-color: rgb(0,16,98);
    background: #f0f2ff;
}
.wfs-mcard-highlight:hover {
    border-color: rgb(0,16,98);
    box-shadow: 0 8px 24px rgba(0,16,98,0.15);
}

.wfs-mcard-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}

.wfs-mcard-body {
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.wfs-mcard-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wfs-mcard-price {
    font-size: 13px;
    font-weight: 700;
    color: #dd0f07;
    margin-top: auto;
    padding-top: 4px;
}

/* Tags catégorie */
.wfs-product-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.wfs-cat-tag {
    display: inline-block;
    background: rgba(0,16,98,0.08);
    color: rgb(0,16,98);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-decoration: none !important;
    transition: background 0.15s;
    white-space: nowrap;
    border-color: transparent !important;
}
.wfs-cat-tag:hover { background: rgba(0,16,98,0.16); }

/* =========================================================
   BOUTONS D'ACTION
   ========================================================= */
.wfs-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 18px 32px 28px;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.wfs-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.18s, color 0.18s, transform 0.1s, box-shadow 0.18s;
    border: none;
    white-space: nowrap;
    font-family: var(--wfs-font);
}
.wfs-modal-btn:active { transform: scale(0.97); }

.wfs-modal-btn-primary {
    background: #dd0f07;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(221,15,7,0.3);
}
.wfs-modal-btn-primary:hover {
    background: #b71c1c;
    box-shadow: 0 6px 20px rgba(221,15,7,0.4);
    color: #fff !important;
}

.wfs-modal-btn-secondary {
    background: #f5f5f5;
    color: #444 !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 4px;
}
.wfs-modal-btn-secondary:hover {
    background: #ececec;
    color: #222 !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .wfs-filter-bar {
        flex-direction: column;
        align-items: stretch;
        row-gap: 10px;
    }
    .wfs-search-wrap,
    .wfs-select-wrap { flex: 1 1 100%; margin-right: 0; }
    .wfs-btn { width: 100%; justify-content: center; }

    .wfs-modal { border-radius: 0; }
    .wfs-modal-header { padding: 22px 20px 16px; gap: 12px; }
    .wfs-modal-title { font-size: 15px; }
    #wfs-modal-found-section,
    #wfs-modal-suggestions-section { padding: 16px 20px; }
    .wfs-modal-sep { margin: 0 20px; }
    .wfs-modal-actions { padding: 16px 20px 22px; flex-direction: column; }
    .wfs-modal-btn { width: 100%; justify-content: center; }
    .wfs-modal-products { grid-template-columns: repeat(2, 1fr); }
}
