/*
Theme Name: Lucas Levotre
Theme URI: 
Author: Echappée Web
Author URI: https://www.echappee-web.fr
Description: Thème sur-mesure du site Lucas Levotre
Requires at least: 6.5
Tested up to: 6.5
Requires PHP: 8.0
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: echappee
*/

/* Variables */
:root {
    --wp--preset--font-size--small: 0.9375rem;
}

/* La page doit prndre 100% de la hauteur */
.wp-site-blocks {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
footer.wp-block-template-part {
    margin-top: auto !important;
}

/* Header */
.topbar {
    padding-top: 0.3rem;
}
.sticky-header {    
    z-index: 999;
}
header {
    img.custom-logo {
        /* width: 335px; */
        width: 310px;
        transform-origin: left center; /* L'animation part de la gauche */
        transition: width 0.4s ease;
        @media screen and (max-width: 1199px) {
            width: min(335px, 80%);
        }
    }
}
.scrolled {
    header {
        img.custom-logo {
            /* transform: scale(0.53); */
            width: 200px;
            @media screen and (max-width: 1199px) {
                width: min(200px, 60%);
            }
        }
        .wp-block-group:has(>.wp-block-site-logo) {
            padding-top: 1em !important;
            padding-bottom: 1em !important;
        }
    }
    .wp-block-ollie-mega-menu__menu-container {
        margin-top: -25px;
    }
}
.wp-block-ollie-mega-menu__menu-container {
    --wp--preset--spacing--medium: var(--wp--preset--spacing--xxs);
}

/* Headings spacings - correct / bug with layout editor */
:is(h2.wp-block-heading) {
    margin-top: var(--wp--preset--spacing--xl);
    margin-bottom: var(--wp--preset--spacing--l);
}
:is(h3.wp-block-heading) {
    margin-top: var(--wp--preset--spacing--l);
    margin-bottom: var(--wp--preset--spacing--s);
}
:is(h4.wp-block-heading) {
    margin-bottom: var(--wp--preset--spacing--s);
    margin-bottom: var(--wp--preset--spacing--xs);
}

/* Accordions */
.wp-block-accordion-heading__toggle:hover .wp-block-accordion-heading__toggle-title {
    text-decoration: none;
}

/* Reviews */
.glsr-reviews {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--wp--preset--spacing--s);
    .glsr-review {
        align-content: flex-start;
        border-radius: 10px;
        border: 1px solid var(--wp--preset--color--accent);
        padding: var(--wp--preset--spacing--xs);
        .glsr-review-date, .glsr-review-author {
            font-size: var(--wp--preset--font-size--xs);
        }
        .glsr-review-date {
            font-style: normal;
            color: var(--wp--preset--color--secondary-dark);
        }
        .glsr-review-author {
            color: var(--wp--preset--color--contrast);
        }
    }
}

/* WooCommerce */
/* Max width */
.woocommerce-account .wp-block-post-title, .woocommerce-account main .woocommerce, .woocommerce-cart .wp-block-post-title, .woocommerce-cart main .woocommerce, .woocommerce-checkout .wp-block-post-title, .woocommerce-checkout main .woocommerce {
    max-width: 1170px;
}
/* Hover state for add to cart button - Normal state defined in theme.json */
.add_to_cart_button:is(:hover, :focus) {
    background-color: var(--wp--preset--color--secondary-dark);
    color: var(--wp--preset--color--white);
}
/* Single product : add to cart button */
.woocommerce div.product form.cart :is(button.single_add_to_cart_button, button[name=add-to-cart]) {
    border-radius: 5px;
    background-color: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--secondary-dark);
    &:is(:hover, :focus) {
        background-color: var(--wp--preset--color--secondary-dark);
        color: var(--wp--preset--color--white);
    }
}
/* Mini cart */
.wc-block-components-button:not(.is-link).is-style-outline:not(:focus), 
.wc-block-components-button:not(.is-link).outlined:not(:focus) {
    box-shadow: none;
    border-color: var(--wp--preset--color--secondary-dark);
}
.wc-block-components-button:not(.is-link).is-style-outline:hover, .wc-block-components-button:not(.is-link).outlined:hover {
    background-color: var(--wp--preset--color--secondary-dark);
}
h2.wc-block-mini-cart__title {
    font-size: 1.6em;
    @media screen and (max-width: 380px) {
        font-size: 1.4em;
    }
}
.wc-block-mini-cart-items .wc-block-cart-item__total-price-and-sale-badge-wrapper {
    line-height: 1.4;
}
@media screen and (max-width: 380px) {
    .wc-block-mini-cart-items .wc-block-cart-item__total {
        display: none;
    }
}
/* Mon compte */
/* Side nav */
.woocommerce-account .woocommerce-MyAccount-navigation {
    background: var(--wp--preset--color--contrast-light);
    border-radius: 10px;
    padding: var(--wp--preset--spacing--s);
    box-sizing: border-box;
    margin-block-end: var(--wp--preset--spacing--m);
    @media screen and (min-width: 769px) {
        width: 28%;
    }    
}
.woocommerce-account .woocommerce-MyAccount-navigation {
    a {
        font-weight: bold;
    }
    li:is(.is-active) a {
        background: var(--wp--preset--color--contrast);
        padding: 0.85em 1.2em;
        border-radius: 5px;
        color: white;
        text-decoration: none;
        width: 100%;
        display: inline-block;
        box-sizing: border-box;
    }
    li:not(.is-active) a:is(:hover, :focus) {
        color: black;
        text-decoration: none;
    }
}
.woocommerce-account .woocommerce-orders-table__cell.woocommerce-orders-table__cell-order-actions a {
    margin-top: 1em;
}
/* Addreses */
.woocommerce-Addresses > div {
    background-color: var(--wp--preset--color--lightgray);
    border-radius: 20px;
    padding: var(--wp--preset--spacing--s);
    box-sizing: border-box;
    margin-block: var(--wp--preset--spacing--m);
    h2 {
        font-size: var(--wp--preset--font-size--l);
        margin-top: 0;
    }
}
/* Product archive */
.wc-block-product > .wp-block-group {
    height: 100%;
}

/* Site reviews */
.glsr-review-title :is(h2, h3) {
    font-size: var(--wp--preset--font-size--l);
    margin-block: 0;
}

/* Footer */
footer {
    .col1 {
        flex-grow: 1 !important;
    }
    .col3 .wp-block-group {
        align-items: flex-start;
    }
    @media screen and (max-width:767px) {
        .col1, .col3 {
            .wp-block-group {
                flex-direction: column;
                gap: var(--wp--preset--spacing--xxs);
            }
        }
    }
    @media screen and (min-width: 768px) {
        .texte-inad {
            max-width: 225px;
        }
    }
    .logo-inad {
        min-width: 95px;
    }
    .logo-footer {
        margin-top: -1.5vw;
        width: max(120px,22%);
        flex-shrink: 1;
        img {
            margin: 0;
        }
    }
}