/* =====================================================
   SWIAT — STABILIZACJA STOPKI, NEWSLETTERA I TYPOGRAFII
===================================================== */

/* Newsletter: pole i komunikat walidacji */
.newsletter .sib-form-container,
.newsletter .form__entry,
.newsletter .form__label-row,
.newsletter .entry__field {
    width: 100%;
}

.newsletter .newsletter-form__field {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.newsletter .newsletter-field-error {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    margin: 0;
    color: #8b5047;
    font-family: "Lato", Arial, sans-serif;
    font-size: 11px;
    line-height: 1.35;
    letter-spacing: 0.01em;
    text-align: left;
}

.newsletter .sib-form-message-panel {
    display: none;
}

.newsletter .sib-form-message-panel--active {
    display: block !important;
}

/* Stopka: pięć pełnych kolumn */
.footer-top {
    grid-template-columns: 340px 150px 190px 270px 240px !important;
}

.footer-contact {
    min-width: 0;
}

.footer-contact .footer-social {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.footer-contact .footer-social a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 28px !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #7d756c !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.footer-contact .footer-social i {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 15px !important;
    line-height: 16px !important;
    text-align: center !important;
}

/* Produkt: tytuł nie może przejmować starych ogromnych reguł */
body.single-product .single-product-page .product-title {
    max-width: 460px !important;
    margin: 0 0 22px !important;
    font-size: clamp(40px, 3.1vw, 56px) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.02em !important;
}

body.single-product .single-product-page .product-price,
body.single-product .single-product-page .product-price .woocommerce-Price-amount,
body.single-product .single-product-page .product-price .swiat-price-line {
    font-size: 28px !important;
    line-height: 1.1 !important;
}

body.single-product .single-product-page .product-description {
    font-size: 16px !important;
    line-height: 1.62 !important;
}

/* Listing: spokojna wielkość nazw produktów */
body.woocommerce ul.products li.product .woocommerce-loop-product__title,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
body .category-product-grid li.product .woocommerce-loop-product__title,
body .product-card-title {
    font-size: 18px !important;
    line-height: 1.18 !important;
    letter-spacing: 0.055em !important;
    font-weight: 500 !important;
}

body.woocommerce ul.products li.product .price,
body.post-type-archive-product ul.products li.product .price,
body.tax-product_cat ul.products li.product .price,
body .category-product-grid li.product .price {
    font-size: 18px !important;
    line-height: 1.2 !important;
}

@media (min-width: 1025px) and (max-width: 1440px) {
    .footer-top {
        grid-template-columns: 300px 140px 170px 240px 220px !important;
        column-gap: 36px !important;
    }

    body.single-product .single-product-page .product-title {
        max-width: 410px !important;
        font-size: clamp(36px, 2.9vw, 48px) !important;
    }
}

@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 1fr 1fr !important;
    }

    .footer-contact .footer-social {
        justify-content: flex-start !important;
    }
}

@media (max-width: 767px) {
    .newsletter .newsletter-field-error {
        position: static;
        margin-top: 8px;
        text-align: center;
    }

    .footer-top {
        grid-template-columns: 1fr !important;
    }

    body.single-product .single-product-page .product-title {
        font-size: clamp(34px, 9vw, 44px) !important;
    }

    body.woocommerce ul.products li.product .woocommerce-loop-product__title,
    body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
    body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
    body .category-product-grid li.product .woocommerce-loop-product__title,
    body .product-card-title {
        font-size: 16px !important;
    }
}

/* =====================================================
   SKLEP — FINALNE WYRÓWNANIE KART PRODUKTOWYCH
   Dotyczy wyłącznie głównej strony /sklep/
===================================================== */

@media (min-width: 1025px) {

    /*
     * Na stronie sklepu główny kontener ma klasę .shop-archive-page.
     * Używamy jej zamiast niepewnej klasy body .woocommerce-shop.
     */
    .shop-archive-page .category-products ul.products li.product
    > a.woocommerce-LoopProduct-link,

    .shop-archive-page .category-products ul.products li.product
    > a.woocommerce-loop-product__link {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 420px !important;
        grid-template-rows: auto minmax(54px, auto) auto !important;
        column-gap: 24px !important;
        row-gap: 0 !important;
        align-items: start !important;
        width: 100% !important;
    }

    /* zdjęcie na całą szerokość karty */
    .shop-archive-page .category-products ul.products li.product
    > a.woocommerce-LoopProduct-link img,

    .shop-archive-page .category-products ul.products li.product
    > a.woocommerce-loop-product__link img {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
    }

    /* nazwa produktu — niższy wiersz, aby cena była bliżej */
    .shop-archive-page .category-products ul.products li.product
    .woocommerce-loop-product__title {
        grid-column: 1 !important;
        grid-row: 2 !important;
        min-height: 54px !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 20px 0 0 !important;
        align-self: start !important;
        justify-self: start !important;
    }

    /* cena bliżej nazwy */
    .shop-archive-page .category-products ul.products li.product
    .price {
        grid-column: 1 !important;
        grid-row: 3 !important;
        margin: 2px 0 0 !important;
        padding: 0 !important;
        align-self: start !important;
        justify-self: start !important;
    }

    /* kolor i rozmiary — odsunięte od prawej krawędzi */
    .shop-archive-page .category-products ul.products li.product
    .swiat-loop-attributes {
        position: static !important;
        float: none !important;
        clear: none !important;

        grid-column: 2 !important;
        grid-row: 2 / 4 !important;

        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 10px !important;

        width: 180px !important;
        max-width: 180px !important;

        align-self: start !important;
        justify-self: center !important;
        align-content: start !important;
        justify-items: center !important;

        margin: 2px 0 0 !important;
        padding: 0 !important;
        transform: none !important;
        text-align: center !important;
    }

    .shop-archive-page .category-products ul.products li.product
    .swiat-loop-attribute,

    .shop-archive-page .category-products ul.products li.product
    .swiat-loop-colors,

    .shop-archive-page .category-products ul.products li.product
    .swiat-loop-sizes {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .shop-archive-page .category-products ul.products li.product
    .swiat-loop-attribute--colors,

    .shop-archive-page .category-products ul.products li.product
    .swiat-loop-attribute--sizes {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* =====================================================
   KATEGORIE SWETRY / KOSZULE — CENA BLIŻEJ NAZWY
   Zachowuje obecne położenie koloru i rozmiarów.
===================================================== */

@media (min-width: 1025px) {

    body.tax-product_cat .category-premium .category-product-grid li.product
    .woocommerce-loop-product__title {
        min-height: 54px !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 10px 0 0 !important;
    }

    body.tax-product_cat .category-premium .category-product-grid li.product
    .price {
        margin: 2px 0 0 !important;
        padding: 0 !important;
    }
}
