/* ==========================================================
   Catalogue EC14 — téléphone
========================================================== */

@media (max-width: 640px) {
    body.ec14-filters-open {
        overflow: hidden;
    }

    .ec14-shop {
        position: relative;
        margin: 16px auto 42px;
        padding: 0 10px;
    }

    .ec14-shop-layout {
        display: block;
    }

    .ec14-shop-intro {
        margin-bottom: 14px;
        padding-left: 0;
    }

    .ec14-content > .ec14-mobile-filter-button-mount {
        display: block;
    }

    .ec14-sidebar {
        display: none !important;
    }

    /* Ouverture et volet des filtres. */
    .ec14-mobile-filter-button {
        position: relative;
        display: block;
        width: 100%;
        margin: 0 0 16px;
        padding: 11px 14px;
        background: var(--ec14-red);
        border: 1px solid transparent;
        border-radius: 3px;
        color: #fff;
        cursor: pointer;
        font-size: 13px;
        font-weight: 650;
        line-height: 1.2;
        text-align: center;
        box-shadow: 0 0 0 0 rgba(198, 161, 91, 0);
        transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
    }

    .ec14-mobile-filter-button.is-active {
        border-color: var(--ec14-gold);
        box-shadow: 0 0 0 2px rgba(198, 161, 91, .24);
    }

    .ec14-mobile-filter-button.is-active::after {
        position: absolute;
        top: 50%;
        right: 12px;
        width: 8px;
        height: 8px;
        background: var(--ec14-gold);
        border: 1px solid rgba(255, 255, 255, .8);
        border-radius: 50%;
        content: "";
        transform: translateY(-50%);
    }

    .ec14-mobile-sidebar {
        position: absolute;
        top: 0;
        left: 14px;
        z-index: 1001;
        display: block;
        width: calc(100% - 28px);
        max-width: 360px;
        max-height: calc(100dvh - 28px);
        margin: 0;
        overflow-x: hidden;
        overflow-y: auto;
        background: #fff;
        border-radius: 18px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, .28);
        overscroll-behavior: contain;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px) scale(.99);
        visibility: hidden;
        transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
        -webkit-overflow-scrolling: touch;
    }

    .ec14-mobile-sidebar.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
        visibility: visible;
        transition-delay: 0s;
    }

    .ec14-mobile-sidebar .ec14-sidebar-card {
        min-height: 0;
        padding: 22px;
        background: #fff;
        border: 0;
        border-radius: 18px;
    }

    .ec14-sidebar-top {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 0 22px;
        padding: 0 0 15px;
        background: #fff;
        border-bottom: 1px solid #ececec;
    }

    .ec14-sidebar-top h2 {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 24px;
    }

    .ec14-close-filter {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        background: #f0f0f0;
        border: 0;
        border-radius: 50%;
        color: #111;
        cursor: pointer;
        font-size: 30px;
        line-height: 1;
    }

    .ec14-overlay {
        position: absolute;
        inset: 0;
        z-index: 1000;
        display: block;
        min-height: 100%;
        background: rgba(20, 20, 20, .30);
        backdrop-filter: blur(1px);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .ec14-overlay.show {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    /* En-tête et tri. */
    .ec14-content .woocommerce-products-header,
    .ec14-shop-intro {
        margin-bottom: 16px;
    }

    .ec14-content .woocommerce-products-header__title,
    .ec14-content .page-title,
    .ec14-shop-intro .woocommerce-products-header__title,
    .ec14-shop-intro .page-title {
        margin-bottom: 14px;
        font-size: 22px;
        line-height: 1.16;
        letter-spacing: -.02em;
    }

    .ec14-content .woocommerce-products-header__title::after,
    .ec14-content .page-title::after,
    .ec14-shop-intro .woocommerce-products-header__title::after,
    .ec14-shop-intro .page-title::after {
        width: 42px;
        margin-top: 12px;
    }

    .ec14-content .kadence-shop-top-row {
        min-height: 0;
        margin-bottom: 18px;
    }

    .ec14-content .woocommerce-result-count {
        margin: 0;
        font-size: 12px;
    }

    .ec14-content .woocommerce-ordering {
        width: 100%;
        margin-bottom: 20px;
    }

    .ec14-content .woocommerce-ordering select {
        width: 100%;
        min-height: 40px;
        font-size: 13px;
    }

    /* Deux colonnes sont conservées sur tous les téléphones. */
    .ec14-content ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 10px;
        align-items: stretch;
    }

    .ec14-content ul.products li.product {
        align-self: stretch;
        height: 100%;
        padding: 4px 4px 10px;
        border-radius: 4px;
    }

    .ec14-product-image {
        width: 100%;
        aspect-ratio: 1 / 1;
        margin: 0;
        padding: 3px;
        border-radius: 3px;
    }

    .ec14-product-details {
        padding: 10px 6px 7px;
    }

    body .ec14-shop .ec14-product-details .woocommerce-loop-product__title {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        font-size: 12px !important;
        line-height: 1.35;
    }

    .ec14-product-details .price {
        margin-top: 8px;
        font-size: 15px;
    }

    .ec14-content li.product > .button,
    .ec14-content li.product > .product-action-wrap {
        width: calc(100% - 12px);
        margin: auto 6px 0;
    }

    .ec14-product-unavailable-label {
        width: calc(100% - 12px);
        min-height: 36px;
        margin: auto 6px 0;
        padding: 7px 4px;
        font-size: 9px;
    }

    body .ec14-shop .ec14-content ul.products li.product .button,
    body .ec14-shop .ec14-content ul.products li.product a.button {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        padding: 9px 3px !important;
        font-size: 10px !important;
        text-overflow: ellipsis;
    }

    .ec14-content li.product .onsale {
        top: 12px;
        right: 12px;
        padding: 6px 8px;
        font-size: 9px;
    }

    .ec14-catalog-badge {
        top: 5px;
        left: 5px;
        max-width: calc(100% - 10px);
        padding: 5px 7px;
        border-radius: 5px;
        font-size: 8px;
        letter-spacing: .035em;
    }

    .ec14-content nav.woocommerce-pagination {
        margin-top: 26px;
    }

    .ec14-content nav.woocommerce-pagination ul {
        justify-content: center;
    }

    .ec14-content nav.woocommerce-pagination ul li a,
    .ec14-content nav.woocommerce-pagination ul li span {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ec14-mobile-sidebar,
    .ec14-overlay {
        transition: none !important;
    }
}
