/* ChemSafe catalogue: archive cards only;
native WooCommerce controls retained. */

.woocommerce.archive #loops-wrapper.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px 24px;
    margin: 24px 0 48px;
    padding: 0;
    clear: both;
    align-items: stretch;
}

.woocommerce.archive #loops-wrapper.products:before,
.woocommerce.archive #loops-wrapper.products:after {
    display: none;
}

.woocommerce.archive #loops-wrapper.products > li.product {
    width: auto !important;
    min-width: 0;
    float: none !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    border: 1px solid #dce7ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(31, 79, 116, .05);
    overflow: hidden;
}

.woocommerce.archive #loops-wrapper.products .product-image {
    margin: 0 !important;
    aspect-ratio: 1;
    background: #fff;
    overflow: hidden;
}

.woocommerce.archive #loops-wrapper.products .product-image > a {
    display: block;
    width: 100%;
    height: 100%;
}

.woocommerce.archive #loops-wrapper.products .product-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1;
    object-fit: contain;
    box-sizing: border-box;
    padding: 14px;
    transform: none;
}

.woocommerce.archive #loops-wrapper.products .product-content {
    display: flex;
    flex: 1;
    padding: 18px !important;
    text-align: left;
}

.woocommerce.archive #loops-wrapper.products .product-content-inner-wrapper {
    display: flex;
    flex: 1;
    min-width: 0;
}

.woocommerce.archive #loops-wrapper.products .product-content-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    align-items: stretch;
}

.woocommerce.archive #loops-wrapper.products .product_title {
    font-size: 16px !important;
    line-height: 1.45 !important;
    margin: 0 0 16px !important;
    text-align: left;
    overflow-wrap: anywhere;
}

.woocommerce.archive #loops-wrapper.products .product_title a {
    color: #24455d;
}

.woocommerce.archive #loops-wrapper.products .price {
    margin-top: auto !important;
    margin-bottom: 14px !important;
    font-size: 18px;
    line-height: 1.5;
    color: #205b9e;
    font-weight: 600;
}

.woocommerce.archive #loops-wrapper.products .woocommerce-price-suffix {
    font-size: 12px;
    font-weight: 400;
    color: #647481;
}

.woocommerce.archive #loops-wrapper.products .product-content .button {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 11px 10px !important;
    border: 1px solid #205b9e;
    border-radius: 8px;
    background: #205b9e;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    box-shadow: none;
}

.woocommerce.archive #loops-wrapper.products .product-content .button:hover {
    background: #184878;
    border-color: #184878;
}

.woocommerce.archive #loops-wrapper.products a:focus-visible {
    outline: 3px solid #137eaa;
    outline-offset: 3px;
}

/* Sortowanie i nagłówek katalogu */
.woocommerce.archive .woocommerce-ordering select {
    max-width: 100%;
    min-height: 44px;
    border: 1px solid #dce7ef;
    border-radius: 8px;
    padding: 10px 36px 10px 12px;
    background-color: #fff;
}

.woocommerce.archive .woocommerce-result-count {
    color: #647481;
    font-size: 14px;
}

.woocommerce.archive .page-title {
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.2;
    color: #205b9e;
    margin: 0 0 24px;
}

.woocommerce.archive .woocommerce-products-header {
    text-align: left;
    margin-bottom: 24px;
}

.woocommerce.archive .woocommerce-products-header .page-title {
    text-align: left !important;
    margin: 0 0 16px !important;
}

.woocommerce.archive .woocommerce-ordering {
    float: right !important;
    width: auto !important;
    margin: 0 0 20px !important;
}

.woocommerce.archive .woocommerce-result-count {
    padding: 10px 0 !important;
    margin: 0 0 20px !important;
    min-height: 44px;
    box-sizing: border-box;
}

/* Nawigacja kategorii */
#cs-catalog-categories {
    display: none;
}

html[lang^="pl"] .woocommerce.archive #cs-catalog-categories {
    display: flex;
    width: 100%;
    max-width: none;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px auto 0;
    clear: both;
}

#cs-catalog-categories a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    box-sizing: border-box;
    border: 1px solid #d5e4ee;
    border-radius: 24px;
    background: #f0f8fc;
    color: #205b9e;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    text-align: center;
}

#cs-catalog-categories a:hover,
#cs-catalog-categories a:focus-visible {
    background: #205b9e;
    border-color: #205b9e;
    color: #fff;
}

.woocommerce-shop #cs-catalog-categories a:first-child,
body.term-testy-do-moczu #cs-catalog-categories a[href$="/testy-do-moczu/"],
body.term-testy-do-sliny #cs-catalog-categories a[href$="/testy-do-sliny/"],
body.term-testy-do-substancji #cs-catalog-categories a[href$="/testy-do-substancji/"],
body.term-testy-na-metale-ciezki #cs-catalog-categories a[href$="/testy-na-metale-ciezki/"],
body.term-alkotesty #cs-catalog-categories a[href$="/alkotesty/"] {
    background: #205b9e;
    color: #fff;
    border-color: #205b9e;
}

.woocommerce.archive #content {
    padding-top: 32px;
    padding-bottom: 56px;
}

@media (max-width:1024px) {
    .woocommerce.archive #loops-wrapper.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width:680px) {
    .woocommerce.archive #loops-wrapper.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }
    .woocommerce.archive #loops-wrapper.products .product-content {
        padding: 12px !important;
    }
    .woocommerce.archive #loops-wrapper.products .product_title {
        font-size: 14px !important;
    }
    .woocommerce.archive .woocommerce-ordering select {
        width: 100%;
    }
    .woocommerce.archive .woocommerce-ordering {
        float: none !important;
        width: 100% !important;
    }
    .woocommerce.archive .woocommerce-result-count {
        float: none !important;
    }
    html[lang^="pl"] .woocommerce.archive #cs-catalog-categories {
        gap: 8px;
        margin: 24px auto 0;
    }
    #cs-catalog-categories a {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width:380px) {
    .woocommerce.archive #loops-wrapper.products {
        grid-template-columns: 1fr;
    }
    .woocommerce.archive #loops-wrapper.products .product_title {
        font-size: 16px !important;
    }
}
