/* =========================================================
   PITA CHLÉB – modernější produktové karty na kategoriích
   (body.type-category – Pita chléb, Pomazánky)
   Nahrává se do: /user/documents/upload/category.css
   Připojit přes <link> v editoru kódu.

   Fotobanner s názvem kategorie řeší page-hero.css/js.
   ========================================================= */

/* ---------- Mřížka produktů ---------- */
body.type-category #products.products-page {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    margin-top: 10px;
}
@media screen and (max-width: 980px) {
    body.type-category #products.products-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}
@media screen and (max-width: 560px) {
    body.type-category #products.products-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Vyřadit původní šířky/floaty dlaždic – řídí je mřížka. */
body.type-category #products .product {
    width: auto !important;
    margin: 0 !important;
    float: none !important;
    padding: 0 !important;
}

/* ---------- Karta ---------- */
body.type-category #products .product .p {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #ece5dc;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
body.type-category #products .product .p:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* Obrázek */
body.type-category #products .product .image {
    display: block;
    overflow: hidden;
}
body.type-category #products .product .image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
body.type-category #products .product .p:hover .image img {
    transform: scale(1.04);
}

/* Vnitřek karty – flex sloupec, ať jdou tlačítka zarovnat dolů. */
body.type-category #products .product .p-in {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 4px;
}

/* Název produktu */
body.type-category #products .product .name { text-decoration: none; }
body.type-category #products .product .name span {
    display: block;
    color: #2c241d;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    margin-bottom: 8px;
}
body.type-category #products .product .name:hover span { color: #4b2500; }

/* Dostupnost */
body.type-category #products .product .ratings-wrapper { margin-bottom: 4px; }
body.type-category #products .product .availability { font-size: 13px; }

/* Spodní část karty – desc nahoře, cena + tlačítko dole. */
body.type-category #products .product .p-bottom {
    display: flex;
    flex: 1;
}
body.type-category #products .product [data-micro="offer"] {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

/* Popis – useknout na 3 řádky, ať mají karty podobnou výšku. */
body.type-category #products .product .p-desc {
    order: 1;
    color: #6b6157;
    font-size: 13px;
    line-height: 1.5;
    margin: 4px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cena – odsunout dolů, ať jsou tlačítka napříč kartami zarovnaná. */
body.type-category #products .product .prices {
    order: 2;
    margin-top: auto;
    padding-top: 12px;
}
body.type-category #products .product .price-final strong {
    color: #3b2a1a;
    font-size: 22px;
    font-weight: 800;
}

/* Tlačítko Do košíku (vzhled řeší buttons.css) – vystředit. */
body.type-category #products .product .p-tools {
    order: 3;
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}
/* Pružná šířka tlačítka – pevných 230px z buttons.css by v úzké
   kartě (2 sloupce na mobilu) přetékalo. */
body.type-category #products .product .p-tools .btn,
body.type-category #products .product .p-tools .btn-cart,
body.type-category #products .product .p-tools .add-to-cart-button {
    width: 100% !important;
    max-width: 240px;
}

/* Kód produktu – decentně dole. */
body.type-category #products .product .p-code {
    display: block;
    text-align: center;
    color: #b3a99c;
    font-size: 12px;
    padding: 0 0 14px;
}
