/* =================================================================== */
/* == KOMPLETNÍ KÓD PRO PRODUKTOVÉ BLOKY (V4.0 - FINÁLNÍ) == */
/* == Zarovnání karet řešeno externím JavaScriptem == */
/* =================================================================== */

/* --- A. Nadpisy produktových bloků s podtržením --- */
.homepage-products-1 .new-section-title,
#products-favourites h2,
.products-additional-header {
    font-family: 'Open Sans', sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e50000 !important;
    text-transform: uppercase;
}

/* --- A.1 Nadpis "Související produkty" (šedočerná, bez podtržení) --- */
.products-related-header {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.6em;
    font-weight: 700;
    color: #555 !important;
    margin-bottom: 25px;
    text-transform: uppercase;
    padding-bottom: 0;
    border-bottom: none;
}

/* --- B. Kontejner pro produkty v MŘÍŽCE --- */
.products-page .products.row,
.homepage-products-1 .products.row,
#products-favourites .products.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}

/* --- C. Karta produktu (obal) v MŘÍŽCE --- */
.products-page .product,
.homepage-products-1 .product,
#products-favourites .product {
    padding: 8px;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* --- Styly pro responzivní mřížku --- */
@media (min-width: 768px) {
    .products-page .product,
    .homepage-products-1 .product,
    #products-favourites .product {
        flex-basis: 33.333%;
        max-width: 33.333%;
    }
}
@media (min-width: 992px) {
    .products-page .product,
    .homepage-products-1 .product,
    #products-favourites .product {
        flex-basis: 25%;
        max-width: 25%;
    }
}

/* --- D. Vnitřek karty produktu --- */
.product .p {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-color: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
    min-height: 400px; /* <-- TENTO ŘÁDEK PŘIDÁME */

}

.product .p:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* --- E. Obrázek produktu --- */
.product .image {
    display: block;
    padding: 0;
    flex-shrink: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.product .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product .p:hover .image img {
    transform: scale(1.05);
}

/* --- F. Obsah karty --- */
.product .p-in {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product .p-in-in {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* --- G. Název produktu --- */
/* --- G. Název produktu --- */
.product .name {
    /* Zrušení všech omezení */
    height: auto !important;
    overflow: visible !important;
    display: block !important;
    -webkit-line-clamp: unset !important;

    /* Původní styly písma, které chceme zachovat */
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
    min-height: 41px; /* Zachová minimální výšku pro zarovnání */
}

.product .p-bottom {
    margin-top: auto;
    padding-top: 10px;
}

/* --- H. Ceny a tlačítka --- */
.product .price-final strong {
    color: #333;
    font-size: 18px;
    font-weight: 700;
}

.product .price-action-before + .price-final strong {
    color: #e50000 !important;
}

.price-action-before {
    color: #333 !important;
}

.product .p-tools .btn {
    background-color: #e50000 !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 100%;
    text-align: center;
    margin-top: 10px;
}
.product .p-tools .btn:hover {
    background-color: #c00000 !important;
}

.product .availability {
    font-size: 13px;
    color: #555;
    min-height: 18px;
    margin-bottom: 8px;
}

.product .widget-parameter-wrapper,
.product .p-code {
    display: none !important;
}

/* --- I. Štítky (Flags) --- */
.flags-default { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 5px; z-index: 5; }
.flag { color: #fff; padding: 5px 10px; font-size: 12px; font-weight: 700; border-radius: 4px; line-height: 1; text-transform: uppercase; display: block; width: fit-content; }
.flag.flag-action { background-color: #e50000; }
.flag.flag-tip { background-color: #007bff; }
.flag.flag-new { background-color: #28a745; }
.flag.flag-doprodej, .flag.flag-sale { background-color: #ffc107; color: #333; }
.flag.flag-action-percentage { position: absolute; top: 10px; right: 10px; left: auto; background-color: #e50000; color: white; width: 55px; height: 55px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; text-align: center; padding: 5px; box-sizing: border-box; }
.flag.flag-action-percentage .percentage-prefix { font-size: 10px; font-weight: 600; text-transform: uppercase; }
.flag.flag-action-percentage .percentage-value { font-size: 18px; font-weight: 800; }

/* --- J. Ostatní styly --- */
.p-detail-inner .p-info-wrapper .name {
    font-family: 'Open Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    margin-bottom: 25px;
    border-bottom: none;
    padding-bottom: 0;
}

/* --- K. Sjednocení výšky karet je nyní řešeno JavaScriptem --- */