/*======================================
  *** Shop Archive Page Styles ***
======================================*/

/*--- Hero Section Styling ---*/
body.post-type-archive-product .hero-section-shop-archive-page {
    width: 100vw;
    margin-left: min(calc((100vw - 1290px) / 2 * -1), -5vw);
}

@media (max-width: 689px) {
    body.post-type-archive-product .hero-section-shop-archive-page {
        margin-left: -6vw;
    }
}

/*--- Custom Image in Product Loop ---*/

/*Make Image Full-Height*/
li.custom-product-card .custom-product-card-wrapper {
    height: 100%;
    display: flex;
    background-size: cover;
}

/* Set Image for First Custom Card*/
li.custom-product-card.first .custom-product-card-wrapper {
    background-image: url("../images/frau-mit-erdbeerbeuteln.png");
}

/*Set Image for Second Custom Card*/
li.custom-product-card.second .custom-product-card-wrapper {
    background-image: url("../images/frau-mit-zwei-erdbeerscheiben.png");
}

/*Hide One Image on Tablet*/
@media (min-width: 768px) and (max-width: 1000px) {

    /*li.custom-product-card.second {
        display: none;
    }*/
    li.custom-product-card {
        display: none;
    }
}

/*Hide Both Images on Mobile*/
@media (max-width: 767px) {
    li.custom-product-card {
        display: none;
    }
}

/*--- Badges ---*/

/* Badges Wrapper */
li.type-product .badges-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Badges Styling */
li.type-product .variation-stock-badge,
li.type-product .custom-discount-badge {
    display: none;
    padding: 5px 10px;
    border-radius: var(--border-radius-medium);
    font: var(--small-text);
}

li.type-product .variation-stock-badge {
    background-color: var(--white);
    color: var(--dark-green);
}

li.type-product .custom-discount-badge {
    background-color: var(--light-green);
    color: var(--white);
}

li.type-product .variation-stock-badge.visible,
li.type-product .custom-discount-badge.visible {
    display: inline-block;
}

li.type-product .fruit-explosion-wrapper.out-of-stock {
    opacity: 0.5;
}

/*--- Reviews Styling ---*/
li.type-product .product-reviews-badge-wrapper {
    position: absolute;
    top: 17px;
    text-align: left;
}

li.type-product .jdgm-widget {
    margin-bottom: 10px;
}

/*--- Add-to-Cart Button & Price ---*/

/* Hide View-Cart Button */
li.type-product .added_to_cart {
    display: none;
}

/* Style Actions Buttons */
li.type-product .add_to_cart_button,
li.type-product .out-of-stock-link {
    min-height: auto;
    width: 50px;
    height: 50px;
    padding: 0px;
    flex: none;
    border-radius: 100px;
}

li.type-product .add_to_cart_button.loading .custom-add-to-cart-icon {
    display: none;
    /* Hide the cart icon during loading */
}

/*Change Color of Loading Button*/
li.type-product .add_to_cart_button.loading:after {
    background-color: var(--white);
}

/*Style Add-to-Cart Button*/
li.type-product .ct-woo-card-actions .add_to_cart_button {
    background-color: var(--dark-green);
}

/*Style Out-of-Stock Button*/
li.type-product .out-of-stock-link {
    background-color: var(--white);
}

/*Show Add-to-Cart Button Again When Product is Added to Cart*/
li.type-product .ct-woo-card-actions[data-add-to-cart=auto-hide] .added {
    display: inline-flex;
}

/* Price Styling */
li.type-product .price {
    flex: none;
}

li.type-product .price>.sale-price,
li.type-product .price>.woocommerce-Price-amount {
    margin-right: 10px;
}

li.type-product .ct-woo-card-actions .price:not(:only-child):after {
    background: none;
}

/* Crossed-out prices */
li.type-product .sale-price del {
    font: var(--tiny-text);
    opacity: 1;
    color: var(--dark-gray)
}

li.type-product .price-per-kg {
    font: var(--tiny-text);
    color: var(--dark-gray);
}

/* Add-to-Cart and Read More Button Styling */
li.type-product .custom-add-to-cart-icon,
li.type-product .custom-arrow-icon {
    height: 25px;
}

li.type-product .ct-woo-card-actions {
    width: 100%;
    justify-content: space-between;
    margin-inline: 0;
    border-block: 0;
}

li.type-product .ct-woo-card-actions:last-child {
    margin-bottom: 0;
}

/* Variation Swatches Styling */
li.type-product .ct-swatch-container {
    border-radius: var(--border-radius-medium);
}

li.type-product .ct-swatch-container .ct-swatch {
    font: var(--small-text);
}

/*--- Product Card Styling ---*/

/*Resize product image*/
li.type-product figure a.ct-media-container img {
    transform: scale(0.9);
    /* Use transform instead of scale */
    overflow: visible;
    padding-top: 80px;
    /*Make space for wishlist and review stars*/
    aspect-ratio: 1/1.125 !important;
    max-height: 500px;
}

/*Align product info to left*/
[data-products] li.type-product.product {
    align-items: flex-start;
}

/*--- Dynamic Colors ---*/

/* Product title color */
li.type-product.has-dynamic-colors .woocommerce-loop-product__title {
    color: var(--product-color);
}

/* Variant swatches – active state */
li.type-product.has-dynamic-colors [data-swatches-type="button"]>*.active .ct-swatch {
    background-color: var(--product-color);
    color: var(--white);
}

/* Variant swatches – default border/text */
li.type-product.has-dynamic-colors [data-swatches-type="button"] .ct-swatch {
    border-color: var(--product-color);
    color: var(--product-color);
}

/*--- Product Card Mask ---*/
[data-products] li.type-product.product {
    position: relative;
    overflow: hidden;
}

/* Card background tint */
li.type-product.has-dynamic-colors {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* Card base – already driven by ACF via CSS vars */
li.type-product.has-dynamic-colors {
    background-color: var(--product-background-color);
}

li.type-product.has-dynamic-colors::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background-color: var(--product-color);
    opacity: 0.9;

    -webkit-mask-image: url("../images/product-card-mask-generic.svg");
    mask-image: url("../images/product-card-mask-generic.svg");
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/*--- Wishlist Styling ---*/
li.type-product .ct-wishlist-button-archive .ct-icon-container::before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 26px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

li.type-product .ct-wishlist-button-archive[data-button-state=""] .ct-icon-container::before {
    background-image: url("../images/icons/wishlist-icon.svg");
}

li.type-product .ct-wishlist-button-archive[data-button-state="active"] .ct-icon-container::before {
    background-image: url("../images/icons/wishlist-icon-full.svg");
}

li.type-product .ct-wishlist-button-archive .ct-icon-container svg {
    display: none;
}