/*
Theme Name: Shoptimizer Child Theme
Theme URI: 
Description: Child theme of Shoptimizer
Author: CommerceGurus
Author URI: 
Template: shoptimizer
Version: 1.2.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   1. RESET & GLOBAL
   ========================================================================== */

body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

.wp-block-woocommerce-checkout-order-summary-block {
    color: initial;
    background-color: transparent;
    border-color: transparent;
}

/* ==========================================================================
   2. SEARCH FORM
   ========================================================================== */

.search-form {
    display: flex !important;
    align-items: center;
}

.search-form input[type="search"] {
    width: 900px;
    margin-right: 10px;
}

.search-form input[type="submit"] {
    margin-left: 10px;
}

@media screen and (max-width: 1024px) {
    .search-form {
        flex-direction: column !important;
        padding: 0 15px;
        width: 100% !important;
        box-sizing: border-box;
    }

    .search-form label {
        width: 100% !important;
        display: block !important;
        box-sizing: border-box;
    }

    .search-form input[type="search"] {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 5px 0 !important;
        box-sizing: border-box !important;
        background-image: none !important;
        padding-left: 10px !important;
    }

    .search-form input[type="submit"] {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 5px 0 !important;
        box-sizing: border-box !important;
    }

    .search-form .search-icon,
    .search-form::before {
        display: none !important;
    }
}

@media screen and (max-width: 768px) {
    .search-form {
        flex-direction: column !important;
        padding: 0 15px;
        width: 100% !important;
        box-sizing: border-box;
    }

    .search-form label {
        width: 100% !important;
        display: block !important;
        box-sizing: border-box;
    }

    .search-form input[type="search"] {
        width: 100% !important;
        min-width: 100% !important;
        max-width: calc(100vw - 30px) !important;
        margin: 5px 0 !important;
        box-sizing: border-box !important;
        background-image: none !important;
        padding-left: 10px !important;
    }

    .search-form input[type="submit"] {
        width: 100% !important;
        min-width: 100% !important;
        max-width: calc(100vw - 30px) !important;
        margin: 5px 0 !important;
        box-sizing: border-box !important;
    }

    .search-form .search-icon,
    .search-form::before {
        display: none !important;
    }
}

/* ==========================================================================
   3. TYPOGRAPHY & PRIX
   ========================================================================== */

.price,
bdi,
.bold-text {
    font-weight: bold;
}

.single-product h2,
.single-product h3 {
    color: #A45D5D;
}

/* ==========================================================================
   4. COMPOSANTS UI
   ========================================================================== */

.custom-product-notification {
    text-align: left;
    margin-bottom: 15px;
    font-size: 14px;
}

.highlight {
    border: 2px solid #5DA4A4;
    color: #5DA4A4;
    padding: 3px 5px;
    border-radius: 3px;
    display: inline-block;
    font-size: 12px;
    margin-right: 10px;
}

.image-border {
    position: relative;
    overflow: hidden;
}

.image-border::after {
    position: absolute;
    top: 10px;
    right: -10px;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-color: #A45D5D;
    content: "";
}

.image-text-wrapper {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.image-text-wrapper .elementor-widget-image img {
    width: 100%;
    height: auto;
}

.image-text-wrapper .elementor-widget-text-editor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    z-index: 10;
}

.livraison-badge {
    display: inline-block;
    background-color: #c9a87c;
    color: #ffffff;
    padding: 5px 15px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-bottom: 16px;
}

/* ==========================================================================
   5. WOOCOMMERCE - GRILLE PRODUITS
   ========================================================================== */

.woocommerce ul.products {
    align-items: start !important;
}

.woocommerce ul.products li.product {
    border: none !important;
    box-shadow: none !important;
    align-self: start !important;
    height: auto !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.woocommerce ul.products li.product.promo-grid-image-wrapper {
    align-self: stretch !important;
    height: 100% !important;
}

.woocommerce ul.products li.product .button.product_type_variable,
.woocommerce ul.products li.product a.button.add_to_cart_button {
    display: none !important;
}

.quick-add-button {
    display: block !important;
}

/* Neutraliser pseudo-element Shoptimizer */
.woocommerce ul.products li.product::before,
.woocommerce ul.products li.product:hover::before,
.woocommerce ul.products li.product:focus-within::before {
    display: none !important;
    content: none !important;
}

/* Masquer elements Shoptimizer hors custom-card-wrapper */
.woocommerce ul.products li.product .woocommerce-image__wrapper,
.woocommerce ul.products li.product .woocommerce-card__header {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.badge-bestseller {
    background: #2c2c54;
    color: #fff;
}

.color-swatches-container + .color-swatches-container {
    display: none !important;
}

.cgkit-chosen-attribute.no-selection {
    display: none;
}

/* ==========================================================================
   6. PAGE PRODUIT UNIQUE
   ========================================================================== */

.single-product .archive-header {
    display: none !important;
}

.su-spoiler > .su-spoiler-title {
    font-size: 15px;
    background: transparent;
    color: #000000;
}

/* ==========================================================================
   7. BANNIERE CATEGORIE
   ========================================================================== */

.shoptimizer-category-banner .col-full {
    display: grid !important;
    grid-template-columns: 50% 50%;
    grid-template-rows: auto;
    gap: 0 !important;
    align-items: start !important;
}

.shoptimizer-category-banner .col-full .woocommerce-breadcrumb {
    grid-column: 1 / 2;
    grid-row: 1;
    margin: 0 !important;
    padding: 0 20px 0 0 !important;
    font-size: 18px;
}

.shoptimizer-category-banner .col-full h1 {
    grid-column: 1 / 2;
    grid-row: 1;
    margin: 0 !important;
    margin-top: 35px !important;
    padding: 0 20px 0 0 !important;
}

.shoptimizer-category-banner .col-full .taxonomy-description {
    grid-column: 2 / 3;
    grid-row: 1;
    margin: 0 !important;
    padding-left: 20px !important;
    align-self: start;
}

.shoptimizer-category-banner .col-full .taxonomy-description a,
.shoptimizer-category-banner .taxonomy-description p a {
    color: #000 !important;
    text-decoration: none !important;
    font-weight: bold;
}

.shoptimizer-category-banner .col-full .taxonomy-description a:hover,
.shoptimizer-category-banner .taxonomy-description p a:hover {
    text-decoration: underline !important;
}

.livraison-badge-wrapper {
    grid-column: 1 / 2;
    grid-row: 1;
    margin-top: 100px !important;
}

@media (max-width: 768px) {
    .shoptimizer-category-banner .col-full {
        grid-template-columns: 100% !important;
        grid-template-rows: auto auto auto !important;
    }

    .shoptimizer-category-banner .col-full .woocommerce-breadcrumb {
        grid-column: 1 !important;
        grid-row: 1 !important;
        padding-right: 0 !important;
    }

    .shoptimizer-category-banner .col-full h1 {
        grid-column: 1 !important;
        grid-row: 2 !important;
        padding-right: 0 !important;
        margin-top: 10px !important;
    }

    .shoptimizer-category-banner .col-full .taxonomy-description {
        grid-column: 1 !important;
        grid-row: 3 !important;
        padding-left: 0 !important;
        margin-top: 20px !important;
    }

    .image-text-wrapper {
        max-width: 100%;
    }
}

/* ==========================================================================
   8. HERO HEADER
   ========================================================================== */

.desktop-hero-header #page {
    position: relative;
}

.desktop-hero-header #masthead {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.desktop-hero-header .col-full-nav {
    position: absolute !important;
    top: 70px !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9998 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.desktop-hero-header .shoptimizer-primary-navigation {
    background: transparent !important;
}

.desktop-hero-header #content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.desktop-hero-header .col-full-nav .main-navigation a,
.desktop-hero-header .col-full-nav .main-navigation a span {
    color: #ffffff !important;
}

.desktop-hero-header #masthead .secondary-navigation a,
.desktop-hero-header #masthead .site-header-cart a {
    color: #ffffff !important;
}

.desktop-hero-header .col-full-nav .main-navigation .sub-menu a,
.desktop-hero-header .col-full-nav .main-navigation .sub-menu a span,
.desktop-hero-header .col-full-nav .sub-menu-wrapper a,
.desktop-hero-header .col-full-nav .sub-menu-wrapper a span {
    color: #000000 !important;
}

.desktop-hero-header .col-full-nav .sub-menu-wrapper,
.desktop-hero-header .col-full-nav .sub-menu {
    background-color: #ffffff !important;
}

/* ==========================================================================
   9. MINI CART
   ========================================================================== */

#shoptimizerCartDrawer .shoptimizer-custom-quantity-mini-cart_container {
    grid-column: 2 !important;
    grid-row: 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

#shoptimizerCartDrawer .shoptimizer-custom-quantity-mini-cart {
    display: flex !important;
    align-items: center !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    width: fit-content !important;
}

#shoptimizerCartDrawer .cart-item-trash {
    color: #333 !important;
    display: flex !important;
    align-items: center !important;
}

#shoptimizerCartDrawer .cart-item-trash svg {
    width: 16px !important;
    height: 16px !important;
}

/* ==========================================================================
   10. PRODUITS SIMILAIRES
   ========================================================================== */

/* Masquer elements WooCommerce natifs */
.related.products ul.products li.product > .woocommerce-image__wrapper,
.related.products ul.products li.product > .woocommerce-card__header,
.related.products ul.products li.product > a.woocommerce-LoopProduct-link,
.related.products ul.products li.product > .woocommerce-loop-product__link {
    display: none !important;
}

.related.products ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
}

.related.products ul.products li.product > .custom-card-wrapper {
    display: flex !important;
    flex: 1 !important;
}

body.single-product section.related ul.products {
    align-items: start !important;
    align-content: start !important;
}

/* Grille desktop */
.related-wrapper,
.related.products {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

.related.products > h2 {
    max-width: 1600px !important;
    margin: 0 auto 30px auto !important;
    padding: 0 15px !important;
    font-size: 30px !important;
}

.related.products ul.products,
.related.products ul.products.columns-4 {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
}

.related.products ul.products.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    max-width: 1600px !important;
}

/* Badges */
.related.products .badge-bestseller,
.related.products .product-badges .badge-bestseller {
    top: 12px !important;
}

.related.products .product-category-badge {
    top: 12px !important;
}

.related.products .custom-card-wrapper:hover {
    transform: translateY(0) !important;
}

@media (max-width: 1200px) {
    .related.products > h2 {
        padding: 0 25px !important;
        margin-bottom: 25px !important;
    }

    .related.products ul.products,
    .related.products ul.products.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 0 15px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .related.products ul.products li.product {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 768px) {
    body,
    html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .related-wrapper {
        padding: 20px 0 !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    .related.products {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .related.products ul.products,
    .related.products ul.products.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 0 5px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .related.products > h2 {
        padding: 0 5px !important;
        margin: 0 0 20px 0 !important;
        font-size: 24px !important;
    }

    .related.products ul.products li.product {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        min-height: auto !important;
        height: auto !important;
        overflow: hidden !important;
    }

    .related.products .custom-card-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        box-sizing: border-box !important;
        min-height: auto !important;
        height: auto !important;
    }

    /* Image : aspect-ratio carre, pas de hauteur fixe */
    .related.products .product-image-wrapper {
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        padding: 10px !important;
    }

    .related.products .product-image-wrapper img,
    .related.products .product-card-image {
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }

    .related.products .product-card-info,
    .related.products .product-content {
        padding: 8px !important;
        gap: 4px !important;
    }

    .related.products .badge-bestseller {
        left: 5px !important;
        padding: 3px 6px !important;
        font-size: 7px !important;
        max-width: 60px !important;
    }

    .related.products .product-category-badge {
        right: 5px !important;
        padding: 3px 6px !important;
        font-size: 7px !important;
        max-width: 90px !important;
    }

    .related.products .quick-add-button {
        padding: 4px 8px !important;
        font-size: 8px !important;
        bottom: 8px !important;
        right: 8px !important;
    }
}

@media (max-width: 360px) {
    .related.products ul.products,
    .related.products ul.products.columns-4 {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   11. SECTION "DANS LA MEME CATEGORIE"
   ========================================================================== */

.ps-section {
    padding: 40px 0 20px;
    width: 100%;
}

.ps-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.ps-products-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.ps-products-list > li {
    margin: 0 !important;
    float: none !important;
    width: 100% !important;
}

.ps-footer {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.ps-section ul.products li.product,
.ps-section ul.products li.product:hover {
    background: none !important;
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.ps-section .custom-card-wrapper {
    border-radius: 12px !important;
    overflow: hidden !important;
}

.ps-section .woocommerce-image__wrapper,
.ps-section .woocommerce-card__header,
.ps-section .product__categories,
.ps-section .gtm4wp_productdata,
.ps-section a.woocommerce-LoopProduct-link,
.ps-section .woocommerce-loop-product__link {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.ps-section li.product > *:not(.custom-card-wrapper):not(.commercekit-wishlist) {
    display: none !important;
}

@media (max-width: 900px) {
    .ps-products-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .ps-products-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .ps-btn-more {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   FIX GRILLE HOMEPAGE - WIDGETS ELEMENTOR
   b0b8ff2 / 6dfc79a / 78c9521
   ======================================== */

.elementor-element-b0b8ff2 .woocommerce ul.products li.product,
.elementor-element-6dfc79a .woocommerce ul.products li.product,
.elementor-element-78c9521 .woocommerce ul.products li.product {
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
}

.elementor-element-b0b8ff2 .custom-card-wrapper,
.elementor-element-6dfc79a .custom-card-wrapper,
.elementor-element-78c9521 .custom-card-wrapper {
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
}

.elementor-element-b0b8ff2 .product-image-wrapper,
.elementor-element-6dfc79a .product-image-wrapper,
.elementor-element-78c9521 .product-image-wrapper {
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    flex-shrink: 0 !important;
}

.elementor-element-b0b8ff2 .product-content,
.elementor-element-6dfc79a .product-content,
.elementor-element-78c9521 .product-content {
    flex: 0 0 144px !important;
    height: 144px !important;
    min-height: 144px !important;
    max-height: 144px !important;
}

/* === COMPLIANZ — Bouton "Gérer le consentement" — onglet latéral droit === */
.cmplz-manage-consent-container,
.cmplz-btn.cmplz-manage-consent {
    bottom: 80px !important;
    left: auto !important;
    right: -185px !important;
    transition: right 0.3s ease !important;
    border-radius: 6px 0 0 6px !important;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.15) !important;
    position: fixed !important;
    z-index: 999999 !important;
    overflow: visible !important;
}
.cmplz-manage-consent-container:hover,
.cmplz-btn.cmplz-manage-consent:hover {
    right: 0 !important;
}