/* 
Theme Name: CodePix Child
Theme URI: https://github.com/elementor/hello-theme/
Description: Een website door CodePix
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-codepix
Version: 1.0.2
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

:root {
    --cpx-border-radius: 20px;
}

/* Hide recaptcha */
.grecaptcha-badge {
    visibility: hidden;
}

form .elementor-field-type-recaptcha_v3 {
    height: 0;
    margin-bottom: 0 !important;
}

.elementor-form .elementor-form-fields-wrapper small {
    line-height: 1.3em;
    display: block;
    text-wrap: balance;
}

.elementor-form .elementor-form-fields-wrapper small a {
    color: inherit;
    text-decoration: underline;
}

/* Elementor form messages */
.elementor-form .elementor-message {
    background-color: var(--e-global-color-secondary);
    border-radius: 0px;
    padding: 15px;
    line-height: 1.5;
    border: 1px solid var(--e-global-color-921c514);
    color: var(--e-global-color-text);

    &.elementor-message-danger {
        border-color: var(--e-global-color-c571861);
    }
}

/* Hide hidden form fields */
.elementor-form .elementor-field-type-hidden {
    margin-bottom: 0 !important;
    height: 0 !important;
}

/* CPX form checkboxes and radio buttons */
.cpx-form .elementor-field-type-checkbox .elementor-field-option,
.cpx-form .elementor-field-type-acceptance .elementor-field-option,
.cpx-form .elementor-field-type-radio .elementor-field-option {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.cpx-form .elementor-field-type-checkbox .elementor-field-option label,
.cpx-form .elementor-field-type-acceptance .elementor-field-option label,
.cpx-form .elementor-field-type-radio .elementor-field-option label {
    padding-left: 1.75em;
    position: relative;
    font-weight: 400;
    font-size: var(--e-global-typography-text-font-size);
    line-height: 1.2;
}

.cpx-form .elementor-field-type-checkbox .elementor-field-option label:hover,
.cpx-form .elementor-field-type-acceptance .elementor-field-option label:hover,
.cpx-form .elementor-field-type-radio .elementor-field-option label:hover {
    cursor: pointer;
}

.cpx-form .elementor-field-type-checkbox .elementor-field-option input[type="checkbox"],
.cpx-form .elementor-field-type-acceptance .elementor-field-option input[type="checkbox"],
.cpx-form .elementor-field-type-radio .elementor-field-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.cpx-form .elementor-field-type-checkbox .elementor-field-option label:before,
.cpx-form .elementor-field-type-acceptance .elementor-field-option label:before,
.cpx-form .elementor-field-type-radio .elementor-field-option label:before {
    content: '';
    position: absolute;
    top: 0px;
    left: 0;
    width: 21px;
    height: 21px;
    border-radius: 5px;
    background-color: #fff;
    border: 1px solid #b6b6b6;
    transition: background-color .2s ease-in-out;
    line-height: 0;
}

/* Make the radio buttons round */
.cpx-form .elementor-field-type-radio .elementor-field-option label:before {
    border-radius: 100%;
}

.cpx-form .elementor-field-type-checkbox .elementor-field-option label:after,
.cpx-form .elementor-field-type-acceptance .elementor-field-option label:after,
.cpx-form .elementor-field-type-radio .elementor-field-option label:after {
    content: '';
    color: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    border-radius: 5px;
    background-color: var(--e-global-color-primary);
    transition: opacity .2s ease-in-out, transform .2s ease-in-out;
    line-height: 0;

    opacity: 0;
    transform: scale(0);
}

/* Make the radio buttons round */
.cpx-form .elementor-field-type-radio .elementor-field-option label:after {
    border-radius: 100%;
}

.cpx-form .elementor-field-type-checkbox .elementor-field-option:hover label:after,
.cpx-form .elementor-field-type-acceptance .elementor-field-option:hover label:after,
.cpx-form .elementor-field-type-radio .elementor-field-option:hover label:after {
    opacity: 1;
    transform: scale(0.6);
}

.cpx-form .elementor-field-type-checkbox .elementor-field-option input[type="checkbox"]:checked+label:after,
.cpx-form .elementor-field-type-acceptance .elementor-field-option input[type="checkbox"]:checked+label:after,
.cpx-form .elementor-field-type-radio .elementor-field-option input[type="radio"]:checked+label:after {
    opacity: 1;
    transform: none;
}

.cpx-form .elementor-field-type-radio .elementor-field-subgroup,
.cpx-form .elementor-field-type-checkbox .elementor-field-subgroup,
.cpx-form .elementor-field-type-acceptance .elementor-field-subgroup {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cpx-form .elementor-field-type-checkbox .elementor-field-label,
.cpx-form .elementor-field-type-acceptance .elementor-field-label,
.cpx-form .elementor-field-type-radio .elementor-field-label {
    margin-bottom: .5rem;
}

.cpx-form .elementor-field-type-checkbox,
.cpx-form .elementor-field-type-acceptance,
.cpx-form .elementor-field-type-radio {
    margin-bottom: 30px !important;
}

/* End CPX form checkboxes */

/* Fix icons not having auto width defined on ipad */
.elementor-widget-icon svg {
    width: auto !important;
}

/* Elementor animation overwrites */
@keyframes cpx_fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -30px, 0)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.fadeInDown {
    animation-name: cpx_fadeInDown !important;
}

@keyframes cpx_fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-30px, 0, 0);
    }

    to {
        opacity: 1;
        transform: none
    }
}

.fadeInLeft {
    animation-name: cpx_fadeInLeft !important;
}

@keyframes cpx_fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(30px, 0, 0);
    }

    to {
        opacity: 1;
        transform: none
    }
}

.fadeInRight {
    animation-name: cpx_fadeInRight !important
}

@keyframes cpx_fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.fadeInUp {
    animation-name: cpx_fadeInUp !important;
}

/* Balance out all headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

.text-balance {
    text-wrap: balance;
}

.text-pretty {
    text-wrap: pretty;
}

/* Fix elementor default line height for icons. Icons should not affect button height */
.elementor-widget-button .elementor-button-icon {
    line-height: 0;
    /* Flexbox to keep the icon in the middle if it's not big enough to fill height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Backgrounds */
.cpx-background {
    height: 100%;
}

.cpx-background img {
    object-fit: cover;
    object-position: center;
}

/* ::selection {
    background: rgba(251, 80, 0, 0.3);
    color: #FFFFFF;
}
  
::-moz-selection {
    background: rgba(251, 80, 0, 0.3);
    color: #FFFFFF;
} */

/* Prevent focussing woo messages with ugly outline */
.woocommerce-message:focus {
    outline: none;
    box-shadow: none;
}

/* Turn elementor grids into centered flex layout using the gap variables from the grid */
.cpx-grid-to-flex .elementor-grid {
    display: flex;
    flex-wrap: wrap;
    row-gap: var(--grid-row-gap, 30px);
    column-gap: var(--grid-column-gap, 30px);
    justify-content: center;
}

/* Based on the variable --grid-columns (this is an int, say: 5) i need the items (.e-loop-item) to have the correct sizes. calculate the gaps so it doesnt overflow */
.cpx-grid-to-flex .elementor-grid .e-loop-item {
    flex: 0 1 calc(calc(100% / var(--grid-columns, 5)) - var(--grid-column-gap, 30px) * (var(--grid-columns, 5) - 1) / var(--grid-columns, 5));
}

body.logged-in .hide-logged-in {
    display: none !important;
}

body:not(.logged-in) .hide-logged-out {
    display: none !important;
}

/* cpx mt auto */
.cpx-mt-auto {
    margin-top: auto;
}

/* Fix paragraph spacings */
.elementor-widget-text-editor,
.elementor-widget-woocommerce-product-content,
.elementor-widget-theme-post-content,
.cpx-ingredient-popup__content {
    p:not(:last-child) {
        margin-bottom: 1em;
    }
}

/* Fix all icons */
.elementor-widget-container .elementor-icon-wrapper {
    line-height: 0;
}

.cpx-header-button {
    svg {
        aspect-ratio: 1/1;
        object-fit: contain;
        object-position: center;
    }
}

.cpx-aspect-1-1 img {
    aspect-ratio: 1/1;
    object-fit: cover;
    object-position: center;
}

.cpx-aspect-16-9 img {
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: center;
}

.cpx-aspect-4-3 img {
    aspect-ratio: 4/3;
    object-fit: cover;
    object-position: center;
}

.cpx-aspect-3-4 img {
    aspect-ratio: 3/4.25;
    object-fit: cover;
    object-position: center;
}

.cpx-slider {
    .swiper {
        padding: 0px 20px !important;
        padding-bottom: 60px !important;
        margin-left: -20px;
        margin-right: -20px;
        mask-image: linear-gradient(to right, transparent 0px, black 20px, black calc(100% - 20px), transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0px, black 20px, black calc(100% - 20px), transparent 100%);
    }

    .swiper-wrapper {
        padding: 20px 0;
    }

    .swiper-pagination {

        .swiper-pagination-bullet {
            opacity: 1 !important;
            border: 1px solid var(--e-global-color-secondary);
            padding: 2px;
            background-color: #fff !important;
            position: relative;

            &:after {
                display: block;
                content: '';
                position: absolute;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%) scale(0);
                height: 65%;
                width: 65%;
                background-color: transparent;
                border-radius: 50%;
                transition: background-color .2s ease-in-out, transform .2s ease-in-out;
            }

            &:hover,
            &.swiper-pagination-bullet-active {
                &:after {
                    background-color: var(--e-global-color-text);
                }
            }

            &:hover:after {
                transform: translate(-50%, -50%) scale(.8);
            }

            &.swiper-pagination-bullet-active:after {
                transform: translate(-50%, -50%) scale(1);
            }
        }
    }

    .swiper-pagination {
        .swiper-pagination-bullet {
            width: 40px;
            height: 6px;
            border-radius: 5px;
            background-color: color-mix(in srgb, var(--e-global-color-text) 30%, transparent) !important;
            transition: all .2s ease-in-out;

            &:before {
                content: '';
                position: absolute;
                top: -8px;
                left: -8px;
                width: calc(100% + 16px);
                height: calc(100% + 16px);
                background: transparent;
            }

            &:after {
                border-radius: 5px;
                height: 100%;
                width: 0;
                transition: all .2s ease-in-out;
            }

            &:hover,
            &:focus {
                &:after {
                    width: 50%;
                }
            }

            &.swiper-pagination-bullet-active {
                width: 65px;

                &:after {
                    width: 100%;
                }
            }
        }
    }
}

.no-pointer-events {
    pointer-events: none !important;
}

/* Dissplay the term widget which is comma separated by default as tags, including hashtags */
.cpx-cats-as-tags {
    .elementor-post-info__terms-list-item {
        text-transform: lowercase;
        font-size: 12px;
        line-height: 1;
        display: inline-block !important;

        &:before {
            content: '#';
        }

        &:not(:first-child) {
            margin-left: 5px;
        }
    }

    .elementor-post-info__terms-list {
        font-size: 0;
    }
}

/* This does the same as the above, but for the taxonomy filter widget */
.cpx-tax-filters-as-tags {

    /* Exclude the show-all button */
    .e-filter-item:not([data-filter="__all"]) {
        text-transform: lowercase;

        &:before {
            content: '#';
        }
    }
}

/* Fix pagination styling for all loops */
.elementor-widget-loop-grid {
    .elementor-pagination {

        >span,
        >a {
            height: 40px;
            width: 40px;
            background-color: #fff;
            border: 1px solid var(--e-global-color-921c514);
            border-radius: 40px;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            transition: background-color .2s ease-in-out;

            &:hover {
                background-color: var(--e-global-color-secondary);
            }

            &.current {
                user-select: none;
                background-color: var(--e-global-color-primary);
                color: #fff !important;
            }
        }
    }
}

.community-post-featured-image img {
    aspect-ratio: 8/3;
    object-fit: cover;
    object-position: center;
}

@media screen and (max-width: 768px) {
    .community-post-featured-image img {
        aspect-ratio: 4/3;
    }
}

.cpx-icon-square svg {
    aspect-ratio: 1/1;
    object-fit: contain;
    object-position: center;
}

.cpx-smaller-content {
    h2 {
        font-size: 24px;
    }
}

/* --------- WooCommerce --------- */
.woocommerce span.onsale {
    background-color: var(--e-global-color-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 11px 10px !important;
    border-radius: 0;
    text-transform: uppercase;
    line-height: 1;
    min-height: 0;
}

.elementor-widget-woocommerce-product-price {
    ins {
        text-decoration: none !important;
    }
}

.woocommerce div.product div.images {
    margin-bottom: 0;

    .flex-control-nav>li {
        padding-bottom: 0 !important;
    }

    a.woocommerce-product-gallery__trigger {
        display: none;
    }
}

/* Fix product page tabs widget */
@media screen and (max-width: 768px) {
    .cpx-product-tabs {
        .e-n-tabs-heading {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px !important;

            .e-n-tab-title {
                margin-top: 0 !important;
                margin-bottom: 0 !important;
            }
        }
    }
}

/* Fix account page mobile tabs */
@media screen and (max-width: 768px) {
    .woocommerce-MyAccount-navigation ul li {
        width: 100% !important;
    }
}

.woocommerce-cart-form__cart-item .quantity input {
    background-color: #fff !important;
    text-align: center !important;
    height: 40px;
    max-height: none !important;
    border-radius: 0 !important;
}

.wc-proceed-to-checkout .checkout-button {
    width: 100% !important;
    padding-top: 17px !important;
    padding-bottom: 17px !important;
}

@media screen and (max-width: 768px) {
    .wc-proceed-to-checkout {
        position: sticky;
        bottom: 20px;
    }
}

.elementor-widget-woocommerce-checkout-page {
    .address-field select {
        width: 100% !important;
    }

    .place-order button[type="submit"] {
        width: 100% !important;
        margin-top: 20px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }
}

/* Status balls */
.cpx-status-login,
.cpx-status-cart-count {
    position: relative;
}

.cpx-status-ball {
    position: absolute;
    right: -4px;
    top: -4px;
    height: 20px;
    width: 20px;
    border-radius: 100%;
    background-color: var(--e-global-color-accent);
    color: var(--e-global-color-988dc82);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 0;

    &.cpx-status-logged-in {
        color: var(--e-global-color-988dc82);
        background-color: var(--e-global-color-accent);
    }

    &.cpx-status-logged-out {
        color: var(--e-global-color-988dc82);
        background-color: #9d9393;
    }
}