/* =====================================================
   STRONA MAREK - NOWOCZESNY DESIGN
   Tylko dla kategorii /kategoria/marki/
   ===================================================== */

/* Ukryj domyślne elementy */
.term-description,
.woocommerce-result-count,
.woocommerce-ordering,
.woocommerce-notices-wrapper,
.wcpq_product_filter_wrap,
.products-per-page,
.wc-block-product-categories,
form.woocommerce-ordering,
.woocommerce-products-header + .woocommerce-notices-wrapper,
.site-main > .woocommerce-notices-wrapper,
.woocommerce > .woocommerce-notices-wrapper {
    display: none !important;
}

/* Ukryj "Pokaż: 24" selektor */
.woocommerce-before-shop-loop,
.woocommerce-before-shop-loop-wrapper,
[class*="products-per-page"],
[class*="product-filter"],
.before-shop-loop-wrapper,
.woocommerce .before-shop-loop {
    display: none !important;
}

/* Hero nagłówek */
.woocommerce-products-header {
    background: linear-gradient(135deg, #002347 0%, #003d7a 50%, #0056b3 100%) !important;
    padding: 60px 20px !important;
    text-align: center !important;
    margin: 0 -50vw 40px !important;
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
}

.woocommerce-products-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.woocommerce-products-header .page-title,
.woocommerce-products-header .woocommerce-products-header__title {
    color: #fff !important;
    font-size: 2.5rem !important;
    margin: 0 !important;
    position: relative;
    z-index: 1;
}

/* Grid marek */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 25px !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 1400px;
    margin: 0 auto !important;
}

/* Ukryj ::before i ::after pseudo-elementy na liście produktów */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce ul.products.columns-4::before,
.woocommerce ul.products.columns-4::after,
ul.products::before,
ul.products::after {
    display: none !important;
    content: none !important;
}

/* Ukryj puste elementy i elementy nie będące kategoriami */
.woocommerce ul.products li:not(.product-category),
.woocommerce ul.products li:empty,
.woocommerce ul.products li.product-category:empty,
.woocommerce ul.products li.product-category:not(:has(a)),
.woocommerce ul.products li.product-category:not(:has(img)) {
    display: none !important;
}

.woocommerce ul.products li.product-category.first:not(:has(img)),
.woocommerce ul.products li.product:not(.product-category) {
    display: none !important;
}

/* Pojedyncza karta marki */
.woocommerce ul.products li.product-category {
    background: #fff !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease !important;
    border: 1px solid #f0f0f0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    float: none !important;
}

.woocommerce ul.products li.product-category:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 40px rgba(0, 35, 71, 0.15) !important;
    border-color: #002347 !important;
}

.woocommerce ul.products li.product-category a {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
}

/* Logo marki - wyśrodkowane */
.woocommerce ul.products li.product-category a img {
    height: 140px !important;
    width: auto !important;
    max-width: 90% !important;
    object-fit: contain !important;
    object-position: center center !important;
    padding: 25px !important;
    background: #fafafa !important;
    border-bottom: 1px solid #f0f0f0 !important;
    filter: grayscale(30%);
    transition: filter 0.3s ease !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

.woocommerce ul.products li.product-category:hover a img {
    filter: grayscale(0%);
}

/* Nazwa marki */
.woocommerce ul.products li.product-category a h2,
.woocommerce ul.products li.product-category a .woocommerce-loop-category__title {
    padding: 20px !important;
    text-align: center !important;
    font-size: 1rem !important;
    color: #002347 !important;
    margin: 0 !important;
    font-weight: 600 !important;
    width: 100% !important;
    line-height: 1.3 !important;
    background: #fff !important;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ukryj liczbę produktów w nazwie */
.woocommerce ul.products li.product-category a .woocommerce-loop-category__title .count,
.woocommerce ul.products li.product-category .count {
    display: none !important;
}

/* Responsywność */
@media screen and (max-width: 1200px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
    }
}

@media screen and (max-width: 968px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .woocommerce-products-header .page-title,
    .woocommerce-products-header .woocommerce-products-header__title {
        font-size: 2rem !important;
    }
}

@media screen and (max-width: 768px) {
    .woocommerce-products-header {
        padding: 40px 15px !important;
        margin-bottom: 30px !important;
    }

    .woocommerce-products-header .page-title,
    .woocommerce-products-header .woocommerce-products-header__title {
        font-size: 1.7rem !important;
    }

    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .woocommerce ul.products li.product-category a img {
        height: 120px !important;
        padding: 20px !important;
    }

    .woocommerce ul.products li.product-category a h2,
    .woocommerce ul.products li.product-category a .woocommerce-loop-category__title {
        padding: 15px !important;
        font-size: 0.9rem !important;
    }
}

@media screen and (max-width: 480px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .woocommerce ul.products li.product-category a img {
        height: 100px !important;
        padding: 15px !important;
    }

    .woocommerce ul.products li.product-category a h2,
    .woocommerce ul.products li.product-category a .woocommerce-loop-category__title {
        padding: 12px !important;
        font-size: 0.85rem !important;
    }
}
