/* --- Naprawiony Kafelek Koszulki (Zoptymalizowany pod nowy wygląd) --- */

/* Resetowanie i nadpisywanie domyślnych stylów WooCommerce dla <li> */
ul.products li.shirt-card,
.woocommerce ul.products li.product,
.shirt-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    float: none;
    clear: none;
    background-color: var(--color-white);
    border: 1px solid #eaeaea;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.shirt-card:hover,
.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    border-color: var(--color-dark);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Plakietka / Badge (Promocja / Hit) */
.shirt-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    z-index: 5;
}

/* Kontener na zdjęcie koszulki */
.shirt-card__image {
    background-color: var(--color-gray-light);
    width: 100%;
    aspect-ratio: 1 / 1; /* Kwadratowy proporcjonalny kadr */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.shirt-card__image img,
.woocommerce ul.products li.product img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Lepiej wypełnia kadr bez białych pasków */
    margin: 0;
    transition: transform var(--transition-fast);
}

.shirt-card:hover .shirt-card__image img,
.woocommerce ul.products li.product:hover img {
    transform: scale(1.03);
}

/* Treść wewnątrz kafelka */
.shirt-card__content,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    padding: 16px 16px 0 16px; /* Padding góra i boki */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
}

.shirt-card__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.3;
    color: var(--color-dark);
}

.shirt-card__title a {
    color: inherit;
    text-decoration: none;
}

.shirt-card__price,
.woocommerce ul.products li.product .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-top: auto;
    margin-bottom: 16px;
}

/* Naprawa przycisku "Dodaj do koszyka" */
.shirt-card__btn,
.woocommerce ul.products li.product .button {
    display: block;
    width: calc(100% - 32px); /* Wypełnia całą szerokość minus marginesy */
    margin: auto 16px 16px 16px; /* Margines po bokach i na dole */
    text-align: center;
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background-color var(--transition-fast);
    border: none;
}

.shirt-card__btn:hover,
.woocommerce ul.products li.product .button:hover {
    background-color: var(--color-primary);
}

/* Po dodaniu produktu otwieramy panel boczny, więc link WooCommerce w kafelku jest zbędny. */
.woocommerce ul.products li.product .added_to_cart {
    display: none;
}

/* Two products per row remain legible on narrow phone screens. */
@media (max-width: 480px) {
    .shirt-card__content { padding: 10px 10px 0; }
    .shirt-card__title {
        display: -webkit-box;
        min-height: 4.8em;
        overflow: hidden;
        font-size: .8rem;
        line-height: 1.2;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 5;
    }
    .shirt-card__price { margin-bottom: 10px; font-size: .95rem; }
    .shirt-card__btn {
        width: calc(100% - 20px);
        min-height: 38px;
        margin: auto 10px 10px;
        padding: 8px 3px;
        font-size: .56rem;
        letter-spacing: 0;
        white-space: nowrap;
    }
}
/* Pixel-stable vertical centring for the mobile add-to-cart label. */
@media (max-width: 480px) { .shirt-card__btn { display: grid; place-items: center; line-height: 1; } }
