/* ============================================================
   featcascade.css — Recherche Marque / Série / Modèle
   ============================================================ */

/* ---- MODE TOP (pleine largeur horizontal) ---- */
.fc-mode-top {
    background: #2d2d2d;
    padding: 14px 20px;
    width: 100%;
    box-sizing: border-box;
}

.fc-top-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.fc-title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.fc-top-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.fc-top-group {
    flex: 1;
    min-width: 150px;
}

.fc-mode-top .fc-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: none;
    border-radius: 3px;
    background: #fff;
    color: #333;
    cursor: pointer;
    height: 38px;
}

.fc-mode-top .fc-select:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.fc-btn {
    background: #f0a500;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    height: 38px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    transition: background .2s;
}

.fc-btn:hover:not(:disabled) {
    background: #d49200;
}

.fc-btn:disabled {
    background: #888;
    cursor: not-allowed;
}

/* Résultats en mode top : sous le bloc, pleine largeur */
.fc-mode-top .fc-results {
    margin-top: 12px;
    background: #fff;
    border-radius: 3px;
    padding: 12px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- MODE COLUMN (colonne gauche vertical) ---- */
.fc-mode-column {
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 16px;
}

.fc-mode-column .block-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid #333;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.fc-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fc-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fc-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
}

.fc-mode-column .fc-select {
    width: 100%;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fafafa;
}

.fc-mode-column .fc-select:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.fc-mode-column .fc-results {
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* ---- BOUTON FERMER ---- */
.fc-results,
.fc-mode-top .fc-results,
.fc-mode-column .fc-results {
    position: relative !important;
}

.fc-block button.fc-close,
button.fc-close {
    position: absolute !important;
    top: 8px !important;
    right: 10px !important;
    width: 24px !important;
    height: 24px !important;
    background: #cc0000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    transition: background .15s !important;
    z-index: 100 !important;
    pointer-events: auto !important;
}

.fc-block button.fc-close:hover,
button.fc-close:hover {
    background: #990000 !important;
}

/* ---- RÉSULTATS (commun) ---- */
.fc-count {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.fc-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* En mode top : grille horizontale */
.fc-mode-top .fc-product-item {
    flex: 0 0 calc(25% - 8px);
    min-width: 180px;
}

/* En mode column : liste verticale */
.fc-mode-column .fc-product-item {
    flex: 0 0 100%;
}

.fc-product-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    transition: background .15s;
    height: 100%;
    box-sizing: border-box;
}

.fc-product-link:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #000;
}

.fc-product-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.fc-product-name {
    font-size: 12px;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
}

.fc-product-ref {
    display: block;
    font-size: 10px;
    color: #888;
}

.fc-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #c00;
    white-space: nowrap;
}

.fc-no-result,
.fc-loading,
.fc-error {
    font-size: 13px;
    color: #888;
    text-align: center;
    padding: 10px 0;
    font-style: italic;
}

.fc-error { color: #c00; }

/* ---- Résultats dans le contenu principal ---- */
#fc-main-results {
    padding: 16px;
    background: #fff;
    border-bottom: 2px solid #eee;
    margin-bottom: 16px;
}

#fc-main-results .fc-product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#fc-main-results .fc-product-item {
    flex: 0 0 calc(25% - 9px);
    min-width: 200px;
}

@media (max-width: 768px) {
    #fc-main-results .fc-product-item {
        flex: 0 0 calc(50% - 6px);
    }
}

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */

@media (max-width: 767px) {

    .fc-mode-top {
        padding: 10px 12px;
    }

    .fc-top-wrapper {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .fc-title {
        font-size: 12px;
        text-align: center;
    }

    .fc-top-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 6px;
    }

    .fc-top-group {
        min-width: 0;
    }

    /* Modèle prend toute la largeur */
    .fc-top-group:nth-child(3) {
        grid-column: 1 / 2;
    }

    /* Bouton prend toute la largeur */
    .fc-btn {
        grid-column: 2 / 3;
        width: 100%;
        font-size: 12px;
        padding: 8px 6px;
    }

    .fc-mode-top .fc-select {
        font-size: 12px;
        padding: 6px 8px;
        height: 36px;
    }

    /* Résultats mobile : 1 colonne */
    .fc-results {
        margin-top: 8px;
        padding: 8px;
    }

    .fc-product-list {
        flex-direction: column;
        gap: 6px;
    }

    .fc-mode-top .fc-product-item {
        flex: 0 0 100%;
        min-width: 0;
    }

    .fc-product-link {
        padding: 6px;
        gap: 10px;
    }

    .fc-product-img {
        width: 56px;
        height: 56px;
    }

    .fc-product-name {
        font-size: 13px;
    }

    .fc-product-price {
        font-size: 14px;
        font-weight: 700;
    }

    .fc-count {
        font-size: 12px;
        margin-bottom: 6px;
    }
}
