/* =====================================================
   mobilComm.cz — Vlastní úpravy v3
   ===================================================== */

/* --- 1. ČERNÁ CENA (všude) --- */
.price-final,
.price-final *,
.price-final-holder,
.price-final-holder *,
.p-detail-inner .price-final-holder,
.p-detail-inner .price-final-holder * {
    color: #000000 !important;
}

/* --- 2. OPRAVA OBRÁZKŮ V OBSAHU --- */
.content-inner img,
.custom-content img,
#content img {
    max-width: 100% !important;
    height: auto !important;
}

/* --- 3. MOBILNÍ ÚPRAVY (do 768px) --- */
@media (max-width: 768px) {

    /* --- HOMEPAGE CAROUSEL: rozšířené tlačítko --- */
    .products-block .slick-slide .p-tools,
    .products-block .slick-slide .p-tools form,
    .products-block .slick-slide .p-tools .pr-action {
        width: 100% !important;
    }

    .products-block .slick-slide .add-to-cart-button,
    .products-block .slick-slide .btn-cart {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 10px 4px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        border-radius: 4px !important;
        box-sizing: border-box !important;
    }

    /* ================================================
       KATEGORIE — kompletní reset a nový layout
       ================================================ */

    /* Mřížka */
    body.type-category #products {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        padding: 8px !important;
        margin: 0 !important;
    }

    body.type-category #products .product {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
        position: static !important;
    }

    /* Bílá karta */
    body.type-category #products .product .p {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
        background: #fff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px !important;
        padding: 8px !important;
        overflow: visible !important;
    }

    /* Obrázek */
    body.type-category #products .product .image {
        position: static !important;
        float: none !important;
        width: 100% !important;
        height: 130px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 0 8px 0 !important;
        padding: 0 !important;
    }

    body.type-category #products .product .image img {
        position: static !important;
        max-height: 100% !important;
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        float: none !important;
    }

    /* p-in: flex sloupec */
    body.type-category #products .product .p-in {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
    }

    body.type-category #products .product .p-in-in {
        position: static !important;
        display: block !important;
        width: 100% !important;
        float: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Název */
    body.type-category #products .product .name {
        position: static !important;
        display: block !important;
        width: 100% !important;
        float: none !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
        text-align: center !important;
        margin: 0 0 6px 0 !important;
        padding: 0 !important;
        max-height: 4em !important;
        overflow: hidden !important;
    }

    /* Skrytí zbytečností */
    body.type-category #products .product .p-desc,
    body.type-category #products .product .p-short-description,
    body.type-category #products .product .p-params,
    body.type-category #products .product .availability,
    body.type-category #products .product .p-code,
    body.type-category #products .product .old-price,
    body.type-category #products .product .ratings-wrapper,
    body.type-category #products .product .stars-placeholder {
        display: none !important;
    }

    /* p-bottom: KOMPLETNÍ RESET pozicování */
    body.type-category #products .product .p-bottom {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        float: none !important;
        margin-top: 6px !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }

    /* Kontejner ceny — RESET absolutní pozice */
    body.type-category #products .product .prices {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        float: none !important;
        text-align: center !important;
        margin: 0 0 4px 0 !important;
        padding: 0 !important;
        height: auto !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }

    /* Přeškrtnutá cena */
    body.type-category #products .product .old-price {
        display: block !important;
        text-align: center !important;
        font-size: 11px !important;
        color: #999 !important;
        text-decoration: line-through !important;
        margin: 0 0 1px 0 !important;
        font-weight: 400 !important;
        line-height: 1.2 !important;
    }

    /* Cena — RESET absolutní pozice */
    body.type-category #products .product .price-final,
    body.type-category #products .product .price-final strong {
        position: static !important;
        display: block !important;
        width: 100% !important;
        float: none !important;
        text-align: center !important;
        font-size: 20px !important;
        font-weight: 800 !important;
        color: #000 !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        line-height: 1.2 !important;
    }

    /* p-tools */
    body.type-category #products .product .p-tools {
        position: static !important;
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.type-category #products .product .p-tools form,
    body.type-category #products .product .p-tools .pr-action {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Tlačítko */
    body.type-category #products .product .add-to-cart-button,
    body.type-category #products .product .p-tools a.btn,
    body.type-category #products .product .btn-cart {
        position: static !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 10px 4px !important;
        margin: 4px 0 0 0 !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        text-align: center !important;
        text-transform: uppercase !important;
        text-indent: 0 !important;
        letter-spacing: 0.5px !important;
        border-radius: 4px !important;
        color: #ffffff !important;
        background-color: #548994 !important;
        border: none !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        float: none !important;
        transform: none !important;
    }

    body.type-category #products .product .add-to-cart-button span,
    body.type-category #products .product .p-tools a.btn span {
        position: static !important;
        display: inline !important;
        color: #ffffff !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        text-indent: 0 !important;
        float: none !important;
        width: auto !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* ================================================
   OPRAVY: sleva badge + přeškrtnutá cena
   ================================================ */
@media (max-width: 768px) {

    /* Sleva badge — ukotvit k obrázku */
    body.type-category #products .product .image {
        position: relative !important;
    }

    body.type-category #products .product .flags-extra {
        position: absolute !important;
        bottom: 6px !important;
        right: 6px !important;
        z-index: 5 !important;
        pointer-events: none !important;
    }

    body.type-category #products .product .flag-discount {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: #4caf50 !important;
        color: #fff !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        padding: 4px 6px !important;
        border-radius: 4px !important;
        line-height: 1.3 !important;
        min-width: 38px !important;
        text-align: center !important;
    }

    body.type-category #products .product .flag-discount .price-standard {
        display: none !important;
    }

    body.type-category #products .product .flag-discount .price-save {
        display: block !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        color: #fff !important;
    }
}
