.pfe-widget,
.pfe-widget * {
    box-sizing: border-box;
}

.pfe-widget {
    position: relative;
    z-index: 5;
}

.pfe-widget-box {
    background: #f7f7f7;
    border: 1px solid rgba(74, 176, 228, 0.28);
    border-radius: 26px;
    padding: 26px 18px 18px;
    overflow: visible;
}

.pfe-widget-header h3 {
    margin: 0 0 18px;
    color: #111;
    font-size: 24px;
    line-height: 1.05;
    font-weight: 900;
    text-transform: uppercase;
    word-break: normal;
    overflow-wrap: break-word;
}

.pfe-widget--sidebar .pfe-widget-header h3 {
    font-size: 22px;
}

.pfe-widget-header p {
    margin: 0 0 22px;
    color: #444;
    font-size: 15px;
    line-height: 1.5;
}


.pfe-widget-mode-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    padding: 4px;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 18px;
}

.pfe-mode-btn {
    flex: 1;
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #222;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}

.pfe-mode-btn.is-active {
    background: #111;
    color: #fff;
}

.pfe-widget--wide .pfe-widget-row--tires {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pfe-widget-row {
    display: grid;
    gap: 14px;
}

.pfe-widget--wide .pfe-widget-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
}

.pfe-widget--sidebar .pfe-widget-row {
    grid-template-columns: 1fr;
}

.pfe-field {
    min-width: 0;
    position: relative;
    z-index: 2;
}

    .pfe-field label {
        display: block;
        margin: 0 0 8px;
        color: #111;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.2;
    }

    .pfe-field select,
    .pfe-search-btn,
    .pfe-product-link {
        -webkit-appearance: none;
        appearance: none;
    }

    .pfe-field select {
        display: block;
        width: 100%;
        max-width: 100%;
        height: 52px;
        border: 1px solid #e3e3e3;
        border-radius: 20px;
        background-color: #ececec !important;
        color: #111;
        font-size: 15px;
        line-height: 1.2;
        padding: 0 46px 0 18px;
        outline: none;
        box-shadow: none;
        cursor: pointer;
        background-image: linear-gradient(45deg, transparent 50%, #222 50%), linear-gradient(135deg, #222 50%, transparent 50%) !important;
        background-position: calc(100% - 22px) 24px, calc(100% - 16px) 24px !important;
        background-size: 6px 6px, 6px 6px !important;
        background-repeat: no-repeat !important;
    }

        .pfe-field select:focus {
            border-color: #bfe8ff;
            box-shadow: 0 0 0 3px rgba(74, 176, 228, 0.14);
        }

        .pfe-field select:disabled {
            opacity: 1;
            color: #666;
            cursor: not-allowed;
        }

.pfe-button-label {
    visibility: visible;
}

.pfe-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 18px;
    background: #111;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

    .pfe-search-btn:hover,
    .pfe-search-btn:focus {
        background: #111;
        color: #fff;
    }

    .pfe-search-btn.is-ready {
        background: #111;
        color: #fff;
    }

        .pfe-search-btn.is-ready:hover,
        .pfe-search-btn.is-ready:focus {
            background: #ff6a00;
            color: #000;
        }

    .pfe-search-btn.is-loading {
        opacity: 0.75;
        pointer-events: none;
    }

.pfe-results {
    margin-top: 22px;
}

.pfe-shop-results {
    margin: 8px 0 36px;
}

.pfe-shop-results-title {
    margin: 0 0 18px;
    color: #111;
    font-size: 20px;
    line-height: 1.1;
    font-weight: 900;
    text-transform: uppercase;
}

.pfe-product-grid {
    display: grid;
    gap: 18px;
}

.pfe-widget--sidebar .pfe-product-grid,
.pfe-product-grid--shop {
    grid-template-columns: 1fr;
}

.pfe-widget--wide .pfe-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pfe-product-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    overflow: hidden;
}

.pfe-product-image {
    display: block;
    background: #fff;
    text-align: center;
}

    .pfe-product-image img {
        display: block;
        width: auto;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
    }

.pfe-product-content {
    padding: 14px 14px 16px;
}

    .pfe-product-content h4 {
        margin: 0 0 10px;
        font-size: 15px;
        line-height: 1.35;
        font-weight: 900;
        color: #111;
    }

        .pfe-product-content h4 a {
            color: inherit;
            text-decoration: none;
        }

.pfe-meta {
    margin-bottom: 6px;
    color: #222;
    font-size: 14px;
    line-height: 1.45;
}

.pfe-product-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    background: #111;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 800;
}

    .pfe-product-link:hover,
    .pfe-product-link:focus {
        background: #ff6a00;
        color: #000 !important;
    }

.pfe-message {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    color: #222;
    font-size: 14px;
}

/* ===========================
   RÉSULTATS INJECTÉS DANS WOO
=========================== */

.woocommerce .pfe-shop-results {
    margin: 8px 0 30px;
}

.woocommerce .pfe-shop-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 18px;
    flex-wrap: wrap;
}

.woocommerce .pfe-shop-results-title {
    margin: 0;
    color: #111;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 900;
    text-transform: uppercase;
}

.woocommerce .pfe-shop-results-count {
    color: #333;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.woocommerce .pfe-product-grid--shop {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    justify-content: start;
    align-items: stretch;
    gap: 30px;
    max-width: 980px;
}

    .woocommerce .pfe-product-grid--shop .pfe-product-card {
        display: flex;
        flex-direction: column;
        background: #fff;
        border: 1px solid #ececec;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 1px 0 rgba(0,0,0,0.02);
    }

    .woocommerce .pfe-product-grid--shop .pfe-product-image {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 320px;
        padding: 22px;
        background: #fff;
    }

        .woocommerce .pfe-product-grid--shop .pfe-product-image img {
            display: block;
            width: auto;
            max-width: 100%;
            max-height: 280px;
            height: auto;
            margin: 0 auto;
        }

    .woocommerce .pfe-product-grid--shop .pfe-product-content {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        padding: 18px 18px 20px;
        text-align: center;
    }

        .woocommerce .pfe-product-grid--shop .pfe-product-content h4 {
            margin: 0 0 14px;
            font-size: 24px;
            line-height: 1.22;
            font-weight: 500;
            color: #111;
            min-height: 118px;
        }

    .woocommerce .pfe-product-grid--shop .pfe-meta {
        margin-bottom: 8px;
        color: #111;
        font-size: 18px;
        line-height: 1.35;
    }

        .woocommerce .pfe-product-grid--shop .pfe-meta strong {
            font-weight: 900;
        }

    .woocommerce .pfe-product-grid--shop .pfe-product-link {
        min-height: 48px;
        padding: 0 22px;
        border-radius: 999px;
        background: #111;
        color: #fff !important;
        font-size: 16px;
        font-weight: 800;
        margin: auto auto 0;
    }

        .woocommerce .pfe-product-grid--shop .pfe-product-link:hover,
        .woocommerce .pfe-product-grid--shop .pfe-product-link:focus {
            background: #ff6a00;
            color: #000 !important;
        }

/* cache la pagination Woo quand résultats compatibles affichés */
body.pfe-has-filtered-results .woocommerce nav.woocommerce-pagination,
body.pfe-has-filtered-results .woocommerce .woocommerce-pagination,
body.pfe-has-filtered-results .woocommerce .woocommerce-result-count.is-original-hidden,
body.pfe-has-filtered-results .woocommerce ul.products.is-original-hidden {
    display: none !important;
}

/* cache aussi les éléments originaux marqués par le JS */
.woocommerce .pfe-original-hidden {
    display: none !important;
}

@media (max-width: 1100px) {
    .pfe-widget--wide .pfe-widget-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .woocommerce .pfe-product-grid--shop {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
        max-width: 100%;
        gap: 24px;
    }

        .woocommerce .pfe-product-grid--shop .pfe-product-image {
            min-height: 250px;
        }

            .woocommerce .pfe-product-grid--shop .pfe-product-image img {
                max-height: 220px;
            }

        .woocommerce .pfe-product-grid--shop .pfe-product-content h4 {
            font-size: 20px;
            min-height: 96px;
        }

        .woocommerce .pfe-product-grid--shop .pfe-meta {
            font-size: 16px;
        }
}

@media (max-width: 767px) {
    .pfe-widget-box {
        padding: 24px 16px 16px;
        border-radius: 24px;
    }

    .pfe-widget-header h3 {
        font-size: 22px;
    }

    .pfe-widget-mode-tabs {
        flex-direction: column;
    }

    .pfe-widget--wide .pfe-widget-row {
        grid-template-columns: 1fr;
    }

    .pfe-field select {
        height: 56px;
        font-size: 14px;
        padding: 0 42px 0 16px;
        background-position: calc(100% - 21px) 26px, calc(100% - 15px) 26px !important;
    }

    .pfe-search-btn {
        min-height: 54px;
        font-size: 14px;
        border-radius: 16px;
    }

    .woocommerce .pfe-shop-results-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .woocommerce .pfe-shop-results-title {
        font-size: 16px;
    }

    .woocommerce .pfe-product-grid--shop {
        grid-template-columns: 1fr;
        gap: 22px;
        max-width: 100%;
    }

        .woocommerce .pfe-product-grid--shop .pfe-product-card {
            border-radius: 16px;
        }

        .woocommerce .pfe-product-grid--shop .pfe-product-image {
            min-height: 220px;
            padding: 16px;
        }

            .woocommerce .pfe-product-grid--shop .pfe-product-image img {
                max-height: 200px;
            }

        .woocommerce .pfe-product-grid--shop .pfe-product-content {
            padding: 14px 14px 18px;
        }

            .woocommerce .pfe-product-grid--shop .pfe-product-content h4 {
                min-height: auto;
                font-size: 18px;
                margin-bottom: 12px;
            }

        .woocommerce .pfe-product-grid--shop .pfe-meta {
            font-size: 15px;
        }

        .woocommerce .pfe-product-grid--shop .pfe-product-link {
            min-height: 46px;
            font-size: 15px;
        }
}

/* ===========================
   PFE 1.1.1 — Compact icon mode switcher
=========================== */
.pfe-widget-box {
    padding-top: 22px;
}

.pfe-widget-header h3 {
    margin-bottom: 12px;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.pfe-widget-header p {
    display: none;
}

.pfe-widget-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.pfe-mode-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    padding: 10px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    background: #fff;
    color: #111;
    box-shadow: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.pfe-mode-btn:hover,
.pfe-mode-btn:focus {
    border-color: #111;
    outline: none;
}

.pfe-mode-btn.is-active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.pfe-mode-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
}

.pfe-mode-icon svg {
    display: block;
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pfe-mode-label {
    display: block;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pfe-widget--sidebar .pfe-widget-header h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.pfe-field label {
    margin-bottom: 7px;
    font-size: 13px;
}

.pfe-field select {
    height: 52px;
    border-radius: 18px;
    font-size: 14px;
}

.pfe-search-btn {
    border-radius: 18px;
}

@media (max-width: 767px) {
    .pfe-widget-mode-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .pfe-mode-btn {
        min-height: 66px;
        border-radius: 15px;
    }

    .pfe-mode-icon,
    .pfe-mode-icon svg {
        width: 28px;
        height: 28px;
    }

    .pfe-mode-label {
        font-size: 11px;
    }
}
