﻿

:root {
    --colorMain: #808080;
    --colorHover: #aaaaaa;
    --colorAlert: #FF0000;
}

#descriptionTop {
    clear: both;
    margin-bottom: 30px;
}

#shopContainer {
    display: grid;
    grid-column-gap: 50px;
    grid-template-columns: 250px auto; 
}

#shopSideContainer {
    grid-column: 1;
    grid-row: 1 / -1;
}

.scrolled #shopSideContainer {
    position: sticky;
    top: 110px;
    align-self: start;
    background-color: white;
}

#shopSearchContainer.fixed-shopsearch {
    position: sticky;
    top: 90px;
    align-self: start;
    background-color: white;
    z-index: 9;
    padding: 30px 0 30px 0;
}

#shopSearchContainer.fixed-shopsearch #shopSearchButton {
    top: 40px;
}


#shopProducts {
    grid-column: 2;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 0 0 0 0;
}

.overviewShopProductContainer {
    position: relative;
    width: Calc(100% / 4);
    border-bottom: 1px solid #cccccc;
    border-right: 1px solid #cccccc;
    padding: 0px 25px 25px 25px;
}

/* Remove right border from every 4rd item */
#shopProducts .overviewShopProductContainer:nth-child(4n) {
    border-right: none;
}


.overviewShopProductContainer:before {
    background: #fff;
    content: "";
    height: 40px;
    position: absolute;
    left: -20px;
    bottom: -20px;
    width: 40px;
    z-index: 2;
}

#shopProducts .productDetailLink {
    display: inline-block;
    text-decoration: none;
    padding: 0px;
    border: 0px;
    background-image: initial;
    background-position: 0px center;
    background-size: initial;
    background-repeat: initial;
    background-attachment: initial;
    background-origin: initial;
    background-clip: initial;
    text-align: left;
    cursor: pointer;
    position: absolute;
    z-index: 3;
    inset: 1px;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.001); /* Instead of opacity: 0; is still technically visible, so iOS registers it correctly on the first tap, otherwise two clicks are needed*/
    transition: all 0.2s ease;
    border-radius: 20px;
}

    #shopProducts .productDetailLink:hover {
        background-color: rgba(160, 160, 160, 0.05);
    }

#shopProducts .overviewShopProduct {
    margin-bottom: 45px;
    font-size: 16px;
}

#shopProducts .shopProductContentContainer {
    pointer-events: none;
}

#shopProducts .shopProductImageContainer {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Ensures square container */
    background-color: #fff; /* Optional: gives a neutral background */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
    pointer-events: none;
}

#shopProducts .shopProductImageContainer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensures the entire image is visible, no cropping */
}

#shopProducts .shopProductTitle {
    position: relative;
    z-index: 5;
    pointer-events: none;
    margin: 10px 0 5px 0;
}

#shopProducts .shopProductTitle h2 {
    font-family: 'Exo', sans-serif;
    font-weight: 500;
    font-size: 17px;
    color: #000;
    pointer-events: none;
}

#shopProducts .shopProductProductNumber {
    pointer-events: none;
    font-size: 16px;
    color: #404040;
}

#shopProducts .shopProductProductNumber2 {
    pointer-events: none;
    font-size: 14px;
    color: #404040;
}

#shopProducts .shopProductDescription {
    position: relative;
    z-index: 5;
    margin-top: 10px;
    pointer-events: none;
}

/* Allow links and buttons to be cklickable */
#shopProducts .shopProductDescription .button,
#shopProducts .shopProductDescription a {
    pointer-events: auto;
    position: relative;
    z-index: 6;
}


#shopProducts .shopProductDescription p:last-child {
    padding: 0;
}

#shopProducts .shopProductPriceContainer {
    pointer-events: none;
    margin-top: 15px;
}

#shopProducts .shopProductPrice {
    color: var(--colorMain);
    font-weight: 700;
}

#shopProducts .shopProductPriceWithoutDiscount {
    font-size: 17px;
}

#shopProducts .shopProductPriceDiscountPercent.circle {
    position: absolute;
    left: 10px;
    top: 15px;
    background-color: var(--colorAlert);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 7px;
    text-align: center;
    color: #fff;
    font-size: 18px;
    line-height: 38px;
    text-shadow: 1px 1px #4c4c4c;
    border: 1px solid #fff;
}

#shopProducts .overviewShopProductFooter {
    bottom: 15px;
    left: 25px;
    position: absolute;
    right: 25px;
    z-index: 5;
}

#shopProducts .shopProductFooterCartControlContainer {
    display: flex;
    float: right;
}

#shopProducts .shopProductFooterQuantityContainer {
    display: flex;
}

#shopProducts input.shopProductQuantityInputPlus,
#shopProducts input.shopProductQuantityInputMinus {
    width: 26px;
    height: 30px;
    text-align: center;
    background-color: var(--colorMain);
    border: none;
    color: #fff;
}

#shopProducts input:focus {
    outline: none;
}

#shopProducts input.shopProductQuantityInputPlus {
    border-radius: 0 4px 4px 0;
}

#shopProducts input.shopProductQuantityInputMinus {
    border-radius: 4px 0 0 4px;
}

#shopProducts input.shopProductQuantityInputPlus:hover,
#shopProducts input.shopProductQuantityInputMinus:hover {
    background-color: var(--colorHover);
    cursor: pointer;
}

#shopProducts input.shopProductQuantityInput {
    width: 30px;
    height: 30px;
    text-align: right;
    border: 0;
    border-top: 1px solid var(--colorMain);
    border-bottom: 1px solid var(--colorMain);
    border-radius: 0;
    vertical-align: top;
    font-size: 12px;
    margin: 0;
    padding: 0 5px 0 0;
}

#shopProducts .shopProductAddToCartButton {
    background-color: var(--colorMain);
    border-radius: 4px;
    margin-left: 10px;
    height: 30px;
    width: 30px;
}

    #shopProducts .shopProductAddToCartButton:hover {
        cursor: pointer;
        background-color: var(--colorHover);
    }

#shopProducts .quantityInputValueNotNumeric {
    background-color: var(--colorAlert);
}

#shopProducts .shopProductAddToCartButton .fa-shopping-cart {
    color: #fff;
    font-size: 17px;
    margin-left: 4px;
    margin-top: 5px;
}

#shopProducts .shopProductAddToCartButton:hover {
    cursor: pointer;
}

#shopProducts .shopProductGotDetailButton,
#shopProducts .shopProductGotDetailButton:visited {
    background-color: var(--colorMain);
    color: #fff;
    border-radius: 4px;
    margin: 0;
    height: 30px;
    display: inline-block;
    padding: 5px 7px 0 7px;
    font-size: 15px;
}

    #shopProducts .shopProductGotDetailButton:hover {
        color: #fff;
        background-color: var(--colorHover);
        text-decoration: none;
    }

    #shopProducts .shopProductGotDetailButton .fa-search {
        color: #fff;
        font-size: 15px;
        margin: 0 5px 0 0;
    }

#loadMoreProductsContainer {
    grid-column: 2;
    margin: 40px 0 0 25px;
    text-align: center;
}

#loadMoreProductsButton {

}

#shopProductCount h2
{
    font-size: 22px;
}

@media screen and (max-width: 1600px) {
    #shopProducts .overviewShopProductContainer {
        position: relative;
        width: Calc(100% / 3);
        border-bottom: 1px solid #cccccc;
        border-right: 1px solid #cccccc;
        padding: 25px;
    }

    /* Reapply right border from every 4rd item */
    #shopProducts .overviewShopProductContainer:nth-child(4n) {
        border-right: 1px solid #cccccc;
    }

    /* Remove right border from every 3rd item */
    #shopProducts .overviewShopProductContainer:nth-child(3n) {
        border-right: none;
    }
}

    

@media screen and (max-width: 1023.9px) {

    #shopProducts .overviewShopProductContainer {
        width: 100%;
        padding: 10px 0 35px 0;
    }

    #shopProducts .overviewShopProductContainer,
    #shopProducts .overviewShopProductContainer:nth-child(2n),
    #shopProducts .overviewShopProductContainer:nth-child(3n),
    #shopProducts .overviewShopProductContainer:nth-child(4n) {
        border-right: none;
    }

    #shopProducts .overviewShopProductFooter {
        left: 0;
        right: 0;
        bottom: 25px;
    }

    #shopProducts .overviewShopProductContainer:before {
        display: none;
    }

    #shopProducts .overviewShopProduct {
        display: flex;
        flex-direction: row;
        gap: 25px;
        align-items: flex-start;
    }

    #shopProducts .shopProductImageContainer {
        flex: 0 0 20%;
        aspect-ratio: auto; /* Remove fixed aspect ratio on mobile */
        max-width: none;
        display: block;
        padding: 15px 0 0 0;
    }

        #shopProducts .shopProductImageContainer img {
            width: 100%;
            height: auto;
            object-fit: contain;
        }

    #shopProducts .shopProductContentContainer {
        flex: 1;
    }

}

@media screen and (max-width: 767.9px) {

    #shopProducts .overviewShopProduct {
        gap: 20px;
    }

    #shopContainer {
        display: block;
    }

    /* Hide block editor containers which are not the shop itself */
    #blockEditor > .beContainer:not([data-itemname="Shop"]) {
        display: none;
    }

    #blockEditor > .beContainer[data-itemname="Shop"] {
        margin-top: 0;
    }

    .scrolled #shopSearchContainer,
    #shopSearchContainer.fixed-shopsearch {
        position: fixed;
        margin-bottom: 30px;
        top: 83px;
        z-index: 9;
        right: 14px;
        width: Calc(100% - 100px);
        padding: 0;
    }


    #shopSearchContainer.fixed-shopsearch #shopSearchButton {
        top: 10px;
    }

    
}

