/* Product cards woocommerce/content-product.php (extracted from style.css) */
span.e_title {
    display: block;
    font-size: 14px;
    font-weight: 400;
}

/* Desktop product title clamping */
a.product-title .e_heading {
    font-weight: 700;
    font-size: 18px;
    line-height: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

a.product-title .e_title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.product-title,
.product-actions .price-net {
    font-weight: 700;
    font-size: 18px;
    line-height: 24px;
}

.product-actions .product-add-to-cart {
    flex: 0 0 auto;
    max-width: 175px;
}

.product-actions del {
    font-size: 14px;
    font-weight: 400;
}

li.product-card .title-part {
    /* grow to fill the gap between thumbnail and footer */
    flex: 1 1 auto;
    /* if you want some breathing room: */
    margin-bottom: 1em;
}

/* your <li> wrapper */
li.product-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: auto;
}

.product-symbol {
    opacity: 50%;
    font-size: 12px;
    line-height: 21px;
}

.product-label {
    font-size: 12px;
    font-weight: 700;
    line-height: 12px;
    background-color: #fff;
    margin-top: -14px;
}

.product-label.new {
    color: #FF7300;
}

.product-label.sale {
    color: #F00;
}

/* Tag-based product labels */
.product-label.promocja {
    color: #ef4444;
    /* red */
}

.product-label.eco {
    color: #10b981;
    /* green */
}

.product-label.bestseller {
    color: #f59e0b;
    /* orange */
}

.product-label.nowosc {
    color: #3b82f6;
    /* blue */
}

.product-label.polecany {
    color: #8b5cf6;
    /* violet */
}

.product-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.2rem;
    margin-top: auto;
    padding-top: 8px;
}

.product-price {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 48px);
    min-width: 0;
}

/* Add to Cart Button - Responsive Text/Icon Display */
.woocommerce li.product-card .product-actions .product-add-to-cart a.button.add_to_cart_button {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 12px 12px;
    border: 1px solid #000;
    border-radius: 999px;
    background-color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    color: #000 !important;
    transition: background-color .3s, color .3s, border-color .3s;
    justify-content: center;
    white-space: nowrap;
    width: auto;
    min-width: auto;
    box-sizing: border-box;
    letter-spacing: normal;
    text-transform: none;
}

.woocommerce li.product-card .product-actions .product-add-to-cart a.button.add_to_cart_button:hover {
    background-color: #000 !important;
    color: #fff !important;
}

.woocommerce ul.products.woo-archive-btn-button li.product-card .product-actions .product-add-to-cart .add-to-cart-icon {
    display: flex;
    align-items: center;
}

.woocommerce ul.products.woo-archive-btn-button li.product-card .product-actions .product-add-to-cart .add-to-cart-icon svg {
    width: 16px;
    height: 16px;
}

/* Desktop: Show both icon and text */
@media screen and (min-width: 768px) {
    .woocommerce ul.products.woo-archive-btn-button li.product-card .product-actions .product-add-to-cart .add-to-cart-text {
        display: inline;
    }

    .woocommerce ul.products.woo-archive-btn-button li.product-card .product-actions .product-add-to-cart .add-to-cart-icon {
        display: flex;
        align-items: center;
    }
}

/* (moved kadence-shop-top-row styles back to style.css) */

/* Woo Archive Mobile */

@media screen and (max-width: 768px) {

    li a.product-title .e_heading,
    li.product a.product-title {
        line-height: 1.2;
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 2px;
    }

    li a span.e_title {
        font-size: 12px;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    li p.price-net-gross {
        margin-block-start: 0;
        margin-block-end: 0;
        line-height: 1.2;
    }

}

p.price-net-gross {
    margin-block-start: 0em;
    margin-block-end: 0em;
}

.product-price p.price-net-gross {
    text-align: left;
    font-size: 14px;
    line-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

li p.price-net-gross {
    text-align: left;
    font-size: 14px;
    line-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Container query for responsive button text */
li.product-card .product-actions {
    container-type: inline-size;
}

@container (max-width: 285px) {
    .woocommerce .product-actions .product-add-to-cart .button.add_to_cart_button {
        font-size: 0 !important;
        line-height: 0;
        overflow: hidden;
        gap: 0 !important;
    }
}

/* Disable Cart spin after adding to cart */

x.woocommerce ul.products li.product .button.added,
span.kadence-svg-iconset.svg-baseline {
    display: none !important;
}

/* Add to cart buttons */

.woocommerce .product-actions .product-add-to-cart .button.add_to_cart_button::before {
    content: "";
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url(../../includes/products/single-product-customize/css/css-icons/cart-plus-solid-full.svg);
    transition: all 0.3s;
    display: inline-block;
    margin-right: 0;
}

.woocommerce .product-actions .product-add-to-cart .button.add_to_cart_button:hover::before {
    filter: brightness(0) invert(1);
}

a.added_to_cart.wc-forward {
    white-space: pre-line;
    max-width: 100px;
    padding-bottom: 0 !important;
    text-align: center;
}

li.product .button.added {
    height: 0 !important;
    padding: 0 !important;
    width: 0 !important;
    overflow: hidden;
    border: 0 !important;
}

/* Mobile archive layout: 1 column grid and 2-column card (image left) */
@media (max-width: 768px) {

    /* Force archive loops to a single column across Kadence variants */
    .woocommerce ul.products.woo-archive-loop,
    .woocommerce ul.products.grid-cols,
    .woocommerce ul.products.grid-ss-col-2,
    .woocommerce ul.products.grid-sm-col-3,
    .woocommerce ul.products.grid-lg-col-4,
    .woocommerce ul.products.product-archive {
        grid-template-columns: 1fr !important;
    }

    /* Card lays out as image left, content right */
    .woocommerce ul.products li.product-card {
        display: grid !important;
        grid-template-columns: 112px minmax(0, 1fr) !important;
        gap: 12px;
        align-items: start;
        width: 100%;
        padding: 12px;
    }

    .woocommerce ul.products li.product-card .product-thumb {
        grid-column: 1;
        grid-row: 1 / span 3;
        position: relative;
        width: 112px;
        height: 112px;
        justify-self: start;
        align-self: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .woocommerce ul.products li.product-card .product-thumb a,
    .woocommerce ul.products li.product-card .product-thumb img {
        display: block;
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    /* Place label over the image on mobile */
    .product-card .product-label {
        position: absolute;
        bottom: -10px;
        padding: 4px 8px;
        border-radius: 999px;
        background: #fff;
        z-index: 2;
    }

    .woocommerce ul.products li.product-card .title-part {
        grid-column: 2 / -1;
        margin-bottom: 4px;
    }

    .woocommerce ul.products li.product-card .product-actions {
        grid-column: 2 / -1;
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 8px;
        margin-top: 6px;
    }

    .woocommerce ul.products li.product-card .product-price {
        max-width: 100%;
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Tweak title sizes for compact layout */
    li a.product-title .e_heading,
    li.product a.product-title {
        font-size: 16px;
        line-height: 1.25;
    }

    .woocommerce li.product-card .product-actions .product-add-to-cart a.button.add_to_cart_button {
        padding: 10px 12px;
    }
}