/* Overlay plein écran */
.dfl-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Valeur maximale : certains bandeaux Google Translate montent jusque-là. */
    z-index: 2147483647;
    background: rgba(20, 20, 20, 0.55);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    box-sizing: border-box;
}

/*
 * Google Translate ajoute parfois un iframe fixe au-dessus de toute la page.
 * Un z-index plus élevé ne suffit alors pas toujours (contexte d'empilement
 * séparé). On le masque uniquement pendant que la recherche est ouverte.
 */
body.dfl-noscroll iframe.goog-te-banner-frame,
body.dfl-noscroll .goog-te-banner-frame,
body.dfl-noscroll .VIpgJd-ZVi9od-ORHb-OEVmcd,
body.dfl-noscroll #goog-gt-tt,
body.dfl-noscroll .goog-te-balloon-frame {
    display: none !important;
    visibility: hidden !important;
}

/* Neutralise le décalage vertical injecté par le bandeau de traduction. */
html body.dfl-noscroll {
    top: 0 !important;
}

.dfl-overlay.dfl-open {
    display: flex;
}

body.dfl-noscroll {
    overflow: hidden;
}

.dfl-overlay-panel {
    position: relative;
    z-index: 1;
    background: #fff !important;
    width: 100%;
    max-width: 1400px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 88vh;
    /*
     * Ne pas utiliser un conteneur flex vertical ici. Certains thèmes PS 1.6
     * redéfinissent les propriétés des enfants scrollables et peuvent sortir
     * la grille de recommandations du fond blanc du panneau.
     */
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    isolation: isolate;
}

.dfl-overlay,
.dfl-overlay * {
    box-sizing: border-box;
}

.dfl-overlay-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.dfl-overlay-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.dfl-icon-search {
    flex-shrink: 0;
    color: #888;
}

.dfl-overlay-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    background: transparent;
}

.dfl-see-all-top {
    color: #1a5fd0;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.dfl-see-all-top:hover {
    text-decoration: underline;
}

.dfl-count-badge {
    background: #1a5fd0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.dfl-overlay-close {
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #aaa;
    padding: 4px 6px;
    flex-shrink: 0;
}

.dfl-overlay-close:hover {
    color: #222;
}

.dfl-overlay-body {
    padding: 20px;
    display: block !important;
    position: relative;
    width: 100%;
    min-height: 1px;
    overflow: visible !important;
    background: #fff !important;
}

/* Le contenu asynchrone doit toujours participer à la hauteur du panneau. */
.dfl-overlay-body::after {
    content: "";
    display: table;
    clear: both;
}

/* Recherches populaires */
.dfl-popular-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 10px;
    font-weight: 600;
}

.dfl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.dfl-chip {
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}

.dfl-chip:hover {
    background: #e8e8e8;
}

.dfl-chip-link {
    background: #eef4ff;
    color: #1a5fd0;
}

.dfl-chips-categories {
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* Suggestions de recherche textuelles */
.dfl-suggestions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.dfl-suggestions-label {
    color: #999;
    font-size: 13px;
    margin-right: 4px;
}

.dfl-suggestion-pill {
    border: 1.5px solid #ddd;
    background: #fff;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.dfl-suggestion-pill:hover {
    border-color: #999;
    color: #222;
}

.dfl-suggestion-pill-active {
    border-color: #222;
    color: #222;
    font-weight: 700;
}

/* Colonnes résultats : catégories/marques à gauche, carrousel à droite */
.dfl-columns {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.dfl-side-col {
    flex: 0 0 180px;
    width: 180px;
}

.dfl-side-block {
    margin-bottom: 24px;
}

.dfl-side-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 12px;
}

.dfl-side-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dfl-side-link {
    color: #444;
    text-decoration: none;
    font-size: 14px;
}

.dfl-side-link:hover {
    color: #1a5fd0;
    text-decoration: underline;
}

.dfl-main-col {
    flex: 1;
    min-width: 0;
}

.dfl-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.dfl-see-all-link {
    font-size: 13px;
    color: #1a5fd0;
    text-decoration: none;
}

.dfl-see-all-link:hover {
    text-decoration: underline;
}

.dfl-carousel-wrap {
    position: relative;
}

.dfl-carousel-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 0 2px 4px;
}

.dfl-carousel-track::-webkit-scrollbar {
    display: none;
}

.dfl-carousel-card {
    flex: 0 0 170px;
    width: 170px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    color: #222;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.dfl-carousel-card.dfl-active,
.dfl-carousel-card:hover {
    border-color: #999;
}

.dfl-carousel-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.dfl-carousel-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.dfl-carousel-name {
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dfl-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    color: #444;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.dfl-carousel-prev {
    left: -16px;
}

.dfl-carousel-next {
    right: -16px;
}

/* Recherches populaires / récentes / recommandés */
.dfl-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 12px;
}

.dfl-recent-block {
    margin-bottom: 24px;
}

.dfl-recent-list {
    display: flex;
    flex-direction: column;
}

.dfl-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.dfl-recent-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 4px 0;
}

.dfl-recent-link:hover {
    text-decoration: underline;
}

.dfl-recent-remove {
    border: none;
    background: transparent;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}

.dfl-recent-remove:hover {
    color: #222;
}

.dfl-recent-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.dfl-recent-actions button {
    border: none;
    background: transparent;
    color: #666;
    font-size: 12px;
    font-style: italic;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.dfl-reco-block,
.dfl-new-block {
    display: block !important;
    position: relative !important;
    float: none !important;
    clear: both;
    width: 100%;
    margin-top: 8px;
    background: #fff !important;
}

.dfl-new-block {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.dfl-reco-grid {
    display: grid !important;
    position: relative !important;
    float: none !important;
    clear: both;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    background: #fff !important;
}

.dfl-reco-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #222;
}

.dfl-reco-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.dfl-reco-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dfl-reco-name {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dfl-reco-price {
    font-size: 13px;
    color: #888;
}

/* Liste de résultats (2 colonnes, façon carte) */
.dfl-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.dfl-card {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px;
}

.dfl-card-link {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: #222;
}

.dfl-card-thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 6px;
    overflow: hidden;
}

.dfl-card-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.dfl-no-image {
    width: 100%;
    height: 100%;
    background: #eee;
    display: block;
}

.dfl-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dfl-card-name {
    font-size: 14px;
    line-height: 1.35;
}

.dfl-brand {
    color: #1a5fd0;
}

.dfl-card-pricerow {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
}

.dfl-card-price {
    font-weight: 700;
    color: #222;
}

.dfl-card-oldprice {
    color: #999;
    text-decoration: line-through;
    font-size: 13px;
}

.dfl-card-ref {
    font-size: 12px;
    color: #999;
}

.dfl-card-cta {
    flex-shrink: 0;
    background: #3d5a75;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

.dfl-card-cta:hover {
    background: #2f4759;
}

.dfl-card.dfl-active {
    border-color: #1a5fd0;
    box-shadow: 0 0 0 2px rgba(26, 95, 208, 0.15);
}

.dfl-see-all {
    display: block;
    text-align: center;
    padding: 14px;
    margin-top: 18px;
    border-top: 1px solid #f0f0f0;
    color: #1a5fd0;
    text-decoration: none;
    font-weight: 600;
}

.dfl-see-all:hover {
    text-decoration: underline;
}

.dfl-empty,
.dfl-loading {
    padding: 30px 0;
    text-align: center;
    color: #888;
}

.dfl-fuzzy-notice {
    font-size: 13px;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

@media (max-width: 600px) {
    .dfl-overlay {
        padding: 0;
    }
    .dfl-overlay-panel {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .dfl-overlay-header {
        padding: 12px 14px;
        gap: 8px;
    }
    .dfl-overlay-input {
        font-size: 16px;
    }
    .dfl-see-all-top,
    .dfl-count-badge {
        display: none !important;
    }
    .dfl-overlay-body {
        padding: 14px;
    }
    .dfl-columns {
        flex-direction: column;
        gap: 20px;
    }
    .dfl-side-col {
        width: 100%;
        flex: none;
        display: flex;
        gap: 32px;
    }
    .dfl-side-block {
        flex: 1;
        margin-bottom: 0;
    }
    .dfl-carousel-card {
        flex: 0 0 130px;
        width: 130px;
    }
    .dfl-carousel-arrow {
        display: none;
    }
    .dfl-reco-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .dfl-suggestion-pill {
        font-size: 12px;
        padding: 6px 12px;
    }
}
