/* Garde-fous UX mobiles communs aux templates historiques et aux blocs Pezi. */
@media (max-width: 767px) {
    body.pezi-global-chrome,
    body.pezi-global-chrome .wrapper,
    body.pezi-global-chrome .content,
    body.pezi-global-chrome main {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    body.pezi-global-chrome .pezi-home-container,
    body.pezi-global-chrome .pezi-product-page__after,
    body.pezi-global-chrome .pezi-product-page__summary {
        box-sizing: border-box;
        width: calc(100% - 44px) !important;
        max-width: 560px !important;
        margin-right: auto !important;
        margin-left: auto !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    body.pezi-global-chrome img,
    body.pezi-global-chrome video,
    body.pezi-global-chrome iframe,
    body.pezi-global-chrome canvas,
    body.pezi-global-chrome svg {
        max-width: 100%;
    }

    body.pezi-global-chrome h1,
    body.pezi-global-chrome h2,
    body.pezi-global-chrome h3,
    body.pezi-global-chrome p,
    body.pezi-global-chrome a,
    body.pezi-global-chrome span {
        overflow-wrap: anywhere;
    }

    body.pezi-global-chrome .pezi-products,
    body.pezi-global-chrome .pezi-stockists-grid,
    body.pezi-global-chrome .pezi-contact-main__grid,
    body.pezi-global-chrome .pezi-bespoke-hero__grid,
    body.pezi-global-chrome .pezi-lightbox-process__grid,
    body.pezi-global-chrome .pezi-reassurance__grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.pezi-global-chrome button,
    body.pezi-global-chrome .button,
    body.pezi-global-chrome .pezi-button,
    body.pezi-global-chrome .pezi-text-link {
        min-height: 44px;
    }

    body.pezi-global-chrome input,
    body.pezi-global-chrome select,
    body.pezi-global-chrome textarea {
        box-sizing: border-box;
        max-width: 100%;
        font-size: 16px;
    }

    body.pezi-global-chrome .pezi-section,
    body.pezi-global-chrome .pezi-production,
    body.pezi-global-chrome .pezi-stockists-list,
    body.pezi-global-chrome .pezi-contact-main,
    body.pezi-global-chrome .pezi-legal-content {
        padding-top: clamp(48px, 12vw, 72px);
        padding-bottom: clamp(48px, 12vw, 72px);
    }
}

/* WooCommerce sale prices: keep Bridge's default green out of PEZI product UI. */
body.pezi-global-chrome .pezi-product-card__price,
body.pezi-global-chrome .pezi-product-page .price,
body.pezi-global-chrome .pezi-product-page__after .products li.product .price,
body.pezi-global-chrome .pezi-product-related .price,
body.pezi-global-chrome .woocommerce ul.products li.product .price,
.pezi-editor-preview .pezi-product-card__price,
.pezi-editor-preview .woocommerce ul.products li.product .price {
    color: var(--pezi-muted, #68625e) !important;
}

body.pezi-global-chrome .pezi-product-card__price del,
body.pezi-global-chrome .pezi-product-card__price del .amount,
body.pezi-global-chrome .pezi-product-page .price del,
body.pezi-global-chrome .pezi-product-page .price del .amount,
body.pezi-global-chrome .pezi-product-page__after .products li.product .price del,
body.pezi-global-chrome .pezi-product-page__after .products li.product .price del .amount,
body.pezi-global-chrome .pezi-product-related .price del,
body.pezi-global-chrome .pezi-product-related .price del .amount,
body.pezi-global-chrome .woocommerce ul.products li.product .price del,
body.pezi-global-chrome .woocommerce ul.products li.product .price del .amount,
.pezi-editor-preview .pezi-product-card__price del,
.pezi-editor-preview .pezi-product-card__price del .amount,
.pezi-editor-preview .woocommerce ul.products li.product .price del,
.pezi-editor-preview .woocommerce ul.products li.product .price del .amount {
    color: var(--pezi-muted, #68625e) !important;
    opacity: .72;
}

body.pezi-global-chrome .pezi-product-card__price ins,
body.pezi-global-chrome .pezi-product-card__price ins .amount,
body.pezi-global-chrome .pezi-product-page .price ins,
body.pezi-global-chrome .pezi-product-page .price ins .amount,
body.pezi-global-chrome .pezi-product-page__after .products li.product .price ins,
body.pezi-global-chrome .pezi-product-page__after .products li.product .price ins .amount,
body.pezi-global-chrome .pezi-product-related .price ins,
body.pezi-global-chrome .pezi-product-related .price ins .amount,
body.pezi-global-chrome .woocommerce ul.products li.product .price ins,
body.pezi-global-chrome .woocommerce ul.products li.product .price ins .amount,
.pezi-editor-preview .pezi-product-card__price ins,
.pezi-editor-preview .pezi-product-card__price ins .amount,
.pezi-editor-preview .woocommerce ul.products li.product .price ins,
.pezi-editor-preview .woocommerce ul.products li.product .price ins .amount {
    color: var(--pezi-primary, #c45824) !important;
    text-decoration: none !important;
    font-weight: 700;
}

/* Keep PEZI calls to action independent from Bridge's green link hover. */
body.pezi-global-chrome a.pezi-button,
body.pezi-global-chrome a.pezi-button:visited,
.pezi-editor-preview a.pezi-button,
.pezi-editor-preview a.pezi-button:visited {
    color: var(--pezi-white, #fff) !important;
    background-color: var(--pezi-primary, #c45824) !important;
}

body.pezi-global-chrome a.pezi-button:hover,
body.pezi-global-chrome a.pezi-button:focus,
body.pezi-global-chrome a.pezi-button:focus-visible,
.pezi-editor-preview a.pezi-button:hover,
.pezi-editor-preview a.pezi-button:focus,
.pezi-editor-preview a.pezi-button:focus-visible {
    color: var(--pezi-white, #fff) !important;
    background-color: #a94b20 !important;
}

body.pezi-global-chrome a.pezi-button--outline,
body.pezi-global-chrome a.pezi-button--outline:visited,
body.pezi-global-chrome a.pezi-button--outline:hover,
body.pezi-global-chrome a.pezi-button--outline:focus,
body.pezi-global-chrome a.pezi-button--outline:focus-visible,
.pezi-editor-preview a.pezi-button--outline,
.pezi-editor-preview a.pezi-button--outline:visited,
.pezi-editor-preview a.pezi-button--outline:hover,
.pezi-editor-preview a.pezi-button--outline:focus,
.pezi-editor-preview a.pezi-button--outline:focus-visible {
    color: var(--pezi-primary, #c45824) !important;
    border-color: var(--pezi-primary, #c45824) !important;
    background-color: transparent !important;
}

/* Gouttières finales, actives quelle que soit la largeur de la fenêtre de
 * preview. Les media queries ajustent ensuite la valeur sans rupture brutale. */
body.single-product .woocommerce {
    box-sizing: border-box !important;
    width: min(1240px, calc(100% - 64px)) !important;
    max-width: min(1240px, calc(100% - 64px)) !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

body.single-product .pezi-product-page__summary,
body.single-product .pezi-product-page__after,
body.single-product .pezi-product-story {
    box-sizing: border-box !important;
    padding-right: clamp(18px, 2.2vw, 30px) !important;
    padding-left: clamp(18px, 2.2vw, 30px) !important;
}

@media (max-width: 1179px) {
    body.single-product .woocommerce {
        width: calc(100% - 48px) !important;
        max-width: calc(100% - 48px) !important;
    }
}

@media (max-width: 767px) {
    body.single-product .woocommerce {
        width: calc(100% - 40px) !important;
        max-width: min(560px, calc(100% - 40px)) !important;
    }

    body.single-product .pezi-product-page__summary,
    body.single-product .pezi-product-page__after,
    body.single-product .pezi-product-story {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }
}

.pezi-shop-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:12px;margin:0 0 28px}.pezi-shop-toolbar label{font-weight:700}.pezi-shop-toolbar select{min-height:44px;border:1px solid var(--pezi-border);background:#fff;padding:8px 38px 8px 12px}.pezi-shop-pagination ul{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin:40px 0 0;padding:0;list-style:none}.pezi-shop-pagination a,.pezi-shop-pagination span{display:grid;place-items:center;min-width:42px;height:42px;border:1px solid var(--pezi-border);padding:0 10px}.pezi-shop-pagination .current{background:var(--pezi-text);color:#fff}@media(max-width:767px){.pezi-shop-toolbar{align-items:stretch;flex-direction:column}.pezi-shop-toolbar select{width:100%}}
.pezi-product-page{display:flex;flex-direction:column}
.pezi-lightbox-process__item .pezi-section-icon,.pezi-reassurance__item .pezi-section-icon{display:block;width:28px!important;height:28px!important;object-fit:contain;filter:brightness(0) invert(1)}

/* Une fiche produit est déjà contenue par WooCommerce : les sections internes
 * ne doivent pas recalculer leur largeur à partir de tout le viewport. */
html:has(body.single-product),
body.single-product {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
}

body.single-product .wrapper,
body.single-product .wrapper_inner,
body.single-product .content,
body.single-product .content_inner,
body.single-product .container,
body.single-product .container_inner,
body.single-product .full_width,
body.single-product .full_width_inner,
body.single-product main,
body.single-product .woocommerce,
body.single-product .pezi-product-page,
body.single-product .pezi-product-page > *,
body.single-product .pezi-product-page__hero > * {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
}

body.single-product .pezi-product-lifestyle {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

body.single-product .pezi-product-gallery,
body.single-product .pezi-product-gallery__item,
body.single-product .pezi-product-gallery__item a,
body.single-product form.cart,
body.single-product .variations_form,
body.single-product .wcpa_form_outer,
body.single-product .pezi-product-details,
body.single-product .pezi-product-reviews,
body.single-product .pezi-product-related {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
}

@media (max-width: 959px) {
    body.single-product .pezi-product-page__hero {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
    }
}

/* Galerie produit compacte : visuel principal + miniatures, comme sur les
 * boutiques e-commerce, au lieu d'empiler toutes les photos verticalement. */
body.single-product .pezi-product-gallery {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
}

body.single-product .pezi-product-gallery__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    overflow: hidden;
    background: var(--pezi-soft, #f7f3f0);
}

body.single-product .pezi-product-gallery__open {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    cursor: zoom-in;
    border: 0;
    background: transparent;
}

body.single-product .pezi-product-gallery__stage img,
body.single-product .pezi-product-gallery__main-image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: opacity .2s ease;
}

body.single-product .pezi-product-gallery__thumbs {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 2px 0 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

body.single-product .pezi-product-gallery__thumb {
    box-sizing: border-box;
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    min-height: 0;
    padding: 3px;
    cursor: pointer;
    scroll-snap-align: start;
    border: 1px solid transparent;
    background: #fff;
    opacity: .68;
    transition: border-color .2s ease, opacity .2s ease;
}

body.single-product .pezi-product-gallery__thumb:hover,
body.single-product .pezi-product-gallery__thumb:focus-visible,
body.single-product .pezi-product-gallery__thumb.is-active {
    border-color: var(--pezi-primary, #c45824);
    opacity: 1;
}

body.single-product .pezi-product-gallery__thumb img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

body.single-product .pezi-product-gallery__sources {
    display: none !important;
}

body.single-product .pezi-product-gallery__arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    color: #151515;
    cursor: pointer;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
    transform: translateY(-50%);
}

body.single-product .pezi-product-gallery__arrow--prev { left: 12px; }
body.single-product .pezi-product-gallery__arrow--next { right: 12px; }

body.single-product .pezi-product-gallery__counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    color: #fff;
    border-radius: 999px;
    background: rgba(21, 21, 21, .72);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

body.single-product .pezi-product-page form.cart:not(.variations_form) {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 152px) minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

body.single-product .pezi-product-page form.cart:not(.variations_form) > :not(.quantity):not(.single_add_to_cart_button) {
    grid-column: 1 / -1;
}

body.single-product .pezi-product-page form.cart .quantity,
body.single-product .pezi-product-page form.cart .single_add_to_cart_button.qbutton {
    box-sizing: border-box !important;
    float: none !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

body.single-product .pezi-product-page form.cart .quantity {
    width: 152px !important;
}

body.single-product .pezi-product-page form.cart .single_add_to_cart_button.qbutton {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: auto !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    padding-right: 18px !important;
    padding-left: 18px !important;
    line-height: 1.2 !important;
}

@media (max-width: 1179px) {
    body.single-product .pezi-product-page form.cart:not(.variations_form) {
        grid-template-columns: minmax(0, 1fr) !important;
        padding-right: 6px !important;
        padding-left: 6px !important;
    }

    body.single-product .pezi-product-page form.cart .quantity {
        width: 100% !important;
    }
}

@media (max-width: 767px) {
    body.single-product .woocommerce {
        box-sizing: border-box !important;
        width: calc(100% - 32px) !important;
        max-width: 560px !important;
        margin-right: auto !important;
        margin-left: auto !important;
    }

    body.single-product .pezi-product-page__summary {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    body.single-product .pezi-product-page__after,
    body.single-product .pezi-product-details,
    body.single-product .pezi-product-reviews,
    body.single-product .pezi-product-related,
    body.single-product .pezi-product-story {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    body.single-product .pezi-product-lifestyle {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    body.single-product .pezi-product-lifestyle > div {
        padding-right: 20px !important;
        padding-left: 20px !important;
    }

    body.single-product .pezi-product-detail__content,
    body.single-product .woocommerce-Tabs-panel,
    body.single-product .comment-respond,
    body.single-product .pezi-product-reviews__heading,
    body.single-product .pezi-product-reviews__summary {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.single-product .pezi-product-gallery__stage {
        aspect-ratio: .88 / 1;
        touch-action: pan-y;
    }

    body.single-product .pezi-product-gallery__thumb {
        flex-basis: 68px;
        width: 68px;
        height: 68px;
    }

    body.single-product .pezi-product-gallery__arrow {
        width: 40px;
        height: 40px;
        min-height: 40px;
    }

    body.single-product .pezi-product-page form.cart,
    body.single-product .pezi-product-page .variations_form.cart,
    body.single-product .pezi-product-page .single_variation_wrap,
    body.single-product .pezi-product-page .woocommerce-variation-add-to-cart {
        box-sizing: border-box !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        gap: 12px !important;
        padding-right: 8px !important;
        padding-left: 8px !important;
    }

    body.single-product .pezi-product-page form.cart > *,
    body.single-product .pezi-product-page .woocommerce-variation-add-to-cart > *,
    body.single-product .pezi-product-page .quantity,
    body.single-product .pezi-product-page .single_add_to_cart_button {
        box-sizing: border-box !important;
        float: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    body.single-product .pezi-product-page .single_add_to_cart_button {
        white-space: normal !important;
        overflow-wrap: anywhere;
        padding-right: 18px !important;
        padding-left: 18px !important;
    }
}

@media (max-width: 767px) {
    body.single-product .woocommerce {
        width: calc(100% - 40px) !important;
        max-width: min(560px, calc(100% - 40px)) !important;
    }

    body.single-product .pezi-product-page__summary,
    body.single-product .pezi-product-page__after,
    body.single-product .pezi-product-story {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }
}
