/* ==========================================================
   Catalogue EC14 — styles partagés ordinateur et tablette
========================================================== */

.ec14-shop {
    --ec14-border: #e2e2e2;

    max-width: 1480px;
    margin: 44px auto 70px;
    padding: 0 28px;
}

.ec14-shop-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.ec14-shop-intro {
    margin: 0 0 26px;
    padding-left: 314px;
}

.ec14-sidebar {
    position: relative;
    align-self: start;
    min-width: 0;
}

.ec14-sidebar-card {
    padding: 24px;
    background: var(--ec14-surface);
    border: 1px solid var(--ec14-border);
    border-radius: 6px;
}

@media (min-width: 1025px) {
    .ec14-sidebar > .ec14-sidebar-card {
        position: sticky;
        top: 95px;
    }
}

.ec14-sidebar-card h2 {
    margin: 0 0 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #ddd;
    color: var(--ec14-text);
    font-size: 23px;
    font-weight: 700;
}

.ec14-content {
    min-width: 0;
}

/* En-tête et barre de résultats. */
.ec14-content .woocommerce-products-header,
.ec14-shop-intro {
    margin: 0 0 26px;
}

.ec14-content .woocommerce-products-header__title,
.ec14-content .page-title,
.ec14-shop-intro .woocommerce-products-header__title,
.ec14-shop-intro .page-title {
    max-width: 920px;
    margin: 0 auto 22px;
    color: var(--ec14-text);
    font-size: clamp(28px, 2.4vw, 38px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.025em;
    text-align: center;
    text-wrap: balance;
}

.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 {
    display: block;
    width: 54px;
    height: 2px;
    margin: 18px auto 0;
    background: var(--ec14-gold);
    content: "";
}

.ec14-content .kadence-shop-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 42px;
    margin-bottom: 24px;
}

.ec14-content .woocommerce-result-count {
    float: none;
    margin: 0;
    color: var(--ec14-muted);
    font-size: 14px;
}

/* La grille est la seule vue conçue et maintenue par ce thème. */
.ec14-content .kadence-product-toggle-container {
    display: none;
}

.ec14-content .woocommerce-ordering {
    float: none;
    margin: 0 0 24px;
}

.ec14-content .woocommerce-ordering select {
    min-height: 42px;
    padding: 8px 38px 8px 14px;
    background: var(--ec14-surface);
    border: 1px solid #dfe3e8;
    border-radius: 3px;
    color: #303640;
    font-size: 14px;
}

/* Filtres natifs du catalogue. */
.ec14-product-filters fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.ec14-filter-group {
    margin: 0 0 24px !important;
}

.ec14-filter-group legend,
.ec14-filter-label {
    display: block;
    margin: 0 0 12px;
    color: #303640;
    font-size: 14px;
    font-weight: 700;
}

.ec14-filter-disclosure summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    color: #303640;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    list-style: none;
}

.ec14-filter-disclosure summary::-webkit-details-marker {
    display: none;
}

.ec14-filter-disclosure summary:focus-visible {
    outline: 2px solid var(--ec14-gold);
    outline-offset: 4px;
}

.ec14-filter-toggle {
    position: relative;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    background: #eceef0;
    border-radius: 50%;
}

.ec14-filter-toggle::before,
.ec14-filter-toggle::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 1.5px;
    background: #4f555e;
    border-radius: 2px;
    content: "";
    transform: translate(-50%, -50%);
    transition: transform .18s ease;
}

.ec14-filter-toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.ec14-filter-disclosure[open] .ec14-filter-toggle::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

.ec14-filter-disclosure .ec14-filter-options {
    margin-top: 13px;
}

.ec14-filter-options {
    display: grid;
    gap: 9px;
    max-height: 190px;
    padding-right: 5px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.ec14-filter-option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 9px;
    align-items: center;
    margin: 0;
    padding-left: calc(var(--ec14-filter-depth, 0) * 14px);
    color: #343942;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.35;
}

.ec14-filter-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ec14-red);
}

.ec14-filter-option:focus-within {
    outline: 2px solid var(--ec14-gold);
    outline-offset: 3px;
}

.ec14-filter-count {
    min-width: 22px;
    padding: 1px 6px;
    background: #eceef0;
    border-radius: 999px;
    color: #666d76;
    font-size: 11px;
    text-align: center;
}

.ec14-product-filters select {
    width: 100%;
    min-height: 42px;
    padding: 8px 34px 8px 11px;
    background-color: #fff;
    border: 1px solid #d5d9de;
    border-radius: 3px;
    color: #303640;
    font-size: 13px;
}

.ec14-price-values {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-bottom: 15px;
    color: #424852;
    font-size: 13px;
    font-weight: 650;
}

.ec14-price-slider {
    position: relative;
    height: 28px;
}

.ec14-price-slider::before {
    position: absolute;
    top: 13px;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(
        to right,
        #d8dadd 0 var(--ec14-price-start, 0%),
        var(--ec14-gold) var(--ec14-price-start, 0%) var(--ec14-price-end, 100%),
        #d8dadd var(--ec14-price-end, 100%) 100%
    );
    border-radius: 999px;
    content: "";
}

.ec14-price-slider input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 28px;
    margin: 0;
    padding: 0;
    background: transparent;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}

.ec14-price-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    background: transparent;
}

.ec14-price-slider input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -7px;
    background: #fff;
    border: 2px solid var(--ec14-red);
    border-radius: 50%;
    cursor: grab;
    pointer-events: auto;
    appearance: none;
    -webkit-appearance: none;
}

.ec14-price-slider input[type="range"]::-moz-range-track {
    height: 3px;
    background: transparent;
}

.ec14-price-slider input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid var(--ec14-red);
    border-radius: 50%;
    cursor: grab;
    pointer-events: auto;
}

.ec14-price-slider input[type="range"]:focus-visible::-webkit-slider-thumb {
    outline: 3px solid rgba(198, 161, 91, .45);
    outline-offset: 2px;
}

.ec14-price-slider input[type="range"]:focus-visible::-moz-range-thumb {
    outline: 3px solid rgba(198, 161, 91, .45);
    outline-offset: 2px;
}

.ec14-filter-actions {
    display: grid;
    gap: 10px;
}

.ec14-filter-actions button,
.ec14-filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 650;
    text-align: center;
}

.ec14-filter-actions button {
    background: var(--ec14-red);
    border: 1px solid var(--ec14-red);
    color: #fff;
}

.ec14-filter-actions button:hover {
    background: var(--ec14-red-dark);
    border-color: var(--ec14-red-dark);
}

.ec14-filter-reset {
    background: transparent;
    border: 1px solid #cfd3d8;
    color: #454b54;
    text-decoration: none;
}

.ec14-filter-reset:hover {
    border-color: var(--ec14-red);
    color: var(--ec14-red);
}

.ec14-products-region {
    transition: opacity .18s ease;
}

.ec14-content.is-filtering .ec14-products-region {
    opacity: .42;
    pointer-events: none;
}

/* Éléments réservés au téléphone. */
.ec14-mobile-filter-button,
.ec14-mobile-filter-button-mount,
.ec14-mobile-sidebar,
.ec14-overlay {
    display: none;
}

/* Grille et cartes produit. */
.ec14-content ul.products {
    gap: 34px 24px;
    align-items: stretch;
}

.ec14-content ul.products li.product {
    position: relative;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 6px 6px 14px;
    overflow: hidden;
    background: var(--ec14-surface);
    border: 1px solid var(--ec14-border);
    border-radius: 5px;
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.ec14-content li.product > .woocommerce-LoopProduct-link,
.ec14-content li.product > .woocommerce-loop-product__link {
    display: flex;
    flex: 1;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.ec14-product-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    transition: border-color .2s ease;
}

.ec14-product-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    object-fit: contain;
    object-position: center;
    transition: transform .28s ease;
}

.ec14-content li.product:hover .ec14-product-image {
    border-color: #c8c8c8;
}

@media (min-width: 1025px) {
    .ec14-shop .ec14-content ul.products li.product:hover {
        border-color: #c7c7c7;
        box-shadow: 0 10px 26px rgba(24, 24, 24, .11);
        transform: translateY(-3px) scale(1.012);
        z-index: 2;
    }

    .ec14-shop .ec14-content ul.products li.product:hover .ec14-product-image img {
        transform: scale(1.02);
    }
}

.ec14-product-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 15px 8px 10px;
}

body .ec14-shop .ec14-product-details .woocommerce-loop-product__title {
    display: -webkit-box;
    width: 100%;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0;
    overflow: hidden;
    color: var(--ec14-text);
    font-size: 15px !important;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: .002em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ec14-product-details .price {
    margin: 12px 0 0;
    color: #333;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.25;
}

/* Badges WooCommerce et personnalisés. */
.ec14-content li.product .onsale {
    top: 16px;
    right: 16px;
    left: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 7px 11px;
    background: #a6192e;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .06em;
    text-transform: uppercase;
    z-index: 2;
}

.ec14-catalog-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 7px 10px;
    overflow: hidden;
    border-radius: 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: .055em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .14);
    z-index: 3;
}

.ec14-catalog-badge--red {
    background: #a6192e;
}

.ec14-catalog-badge--gold {
    background: var(--ec14-gold);
    color: var(--ec14-text);
}

.ec14-catalog-badge--white {
    background: #fff;
    border: 1px solid #a6192e;
    color: #a6192e;
}

/* Actions produit : hauteur et alignement stables sur chaque rangée. */
.ec14-content li.product > .button,
.ec14-content li.product > .product-action-wrap {
    width: calc(100% - 16px);
    margin: auto 8px 0;
}

.ec14-product-unavailable-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 24px);
    min-height: 42px;
    margin: auto 12px 0;
    padding: 9px 10px;
    background: #eceef0;
    border: 1px solid #d7dade;
    border-radius: 3px;
    color: #5a6068;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
}

.ec14-content li.product > .product-action-wrap .button {
    width: 100%;
}

body .ec14-shop .ec14-content ul.products li.product .button,
body .ec14-shop .ec14-content ul.products li.product a.button {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 10px 14px !important;
    overflow: hidden !important;
    background: var(--ec14-red) !important;
    border: 1px solid var(--ec14-red) !important;
    border-radius: 3px !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    text-transform: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    transition: background-color .18s ease !important;
}

body .ec14-shop .ec14-content ul.products li.product .button:hover,
body .ec14-shop .ec14-content ul.products li.product a.button:hover {
    background: var(--ec14-red-dark) !important;
    border-color: var(--ec14-red-dark) !important;
}

body .ec14-shop .ec14-content ul.products li.product .button.ec14-cart-flight {
    color: transparent !important;
}

body .ec14-shop .ec14-content ul.products li.product .button.ec14-added-to-cart,
body .ec14-shop .ec14-content ul.products li.product a.button.ec14-added-to-cart {
    background: var(--ec14-success) !important;
    border-color: var(--ec14-success) !important;
}

body .ec14-shop .ec14-content ul.products li.product .added_to_cart.wc-forward {
    display: none !important;
}

/* Animation du Rafale. */
.ec14-cart-plane {
    position: absolute;
    top: 50%;
    left: -42px;
    display: block;
    width: 36px;
    height: 23px;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    -webkit-mask: url("../images/rafale2.svg") center / contain no-repeat;
    mask: url("../images/rafale2.svg") center / contain no-repeat;
    animation: ec14-rafale-flight 650ms cubic-bezier(.35, .05, .25, 1) forwards;
    z-index: 2;
}

@keyframes ec14-rafale-flight {
    0% {
        left: -42px;
        opacity: 0;
    }
    14%, 84% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 8px);
        opacity: 0;
    }
}

/* Pagination. */
.ec14-content nav.woocommerce-pagination {
    margin-top: 38px;
    text-align: left;
}

.ec14-content nav.woocommerce-pagination ul {
    display: flex;
    gap: 6px;
    margin: 0;
    border: 0;
}

.ec14-content nav.woocommerce-pagination ul li {
    border: 0;
}

.ec14-content nav.woocommerce-pagination ul li a,
.ec14-content nav.woocommerce-pagination ul li span {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #344056;
    font-size: 13px;
    line-height: 1;
}

.ec14-content nav.woocommerce-pagination ul li span.current {
    background: var(--ec14-red);
    color: #fff;
}

.ec14-content nav.woocommerce-pagination ul li a:hover {
    background: #f5f6f7;
    border-color: #dfe3e8;
    color: #a6192e;
}

/* Messages accessibles de WooCommerce, invisibles visuellement. */
body .ec14-shop .screen-reader-text,
body #wp-a11y-speak-polite,
body #wp-a11y-speak-assertive {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 1024px) and (min-width: 641px) {
    body.ec14-filters-open {
        overflow: hidden;
    }

    .ec14-shop {
        position: relative;
        padding: 20px;
    }

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

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

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

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

    .ec14-mobile-filter-button {
        position: relative;
        display: block;
        width: 100%;
        margin: 0 0 20px;
        padding: 12px 16px;
        background: var(--ec14-red);
        border: 1px solid transparent;
        border-radius: 3px;
        color: #fff;
        cursor: pointer;
        font-size: 14px;
        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: 14px;
        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;
        left: 20px;
        z-index: 1001;
        display: block;
        width: min(400px, calc(100% - 40px));
        max-height: calc(100dvh - 40px);
        overflow-x: hidden;
        overflow-y: auto;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, .28);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px) scale(.99);
        visibility: hidden;
        transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
    }

    .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: 24px;
        background: #fff;
        border: 0;
    }

    .ec14-sidebar-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 22px;
        padding-bottom: 15px;
        border-bottom: 1px solid #ececec;
    }

    .ec14-sidebar-top h2 {
        margin: 0;
        padding: 0;
        border: 0;
    }

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

    .ec14-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: block;
        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;
    }

    .ec14-content .kadence-shop-top-row {
        margin-bottom: 20px;
    }

    .ec14-content ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ec14-content ul.products li.product,
    .ec14-product-image,
    .ec14-product-image img {
        transition: none;
    }

    .ec14-shop .ec14-content ul.products li.product:hover,
    .ec14-shop .ec14-content ul.products li.product:hover .ec14-product-image img {
        transform: none !important;
    }

    .ec14-cart-plane {
        display: none;
        animation: none;
    }
}
