/* ============================================================
   PRODUCT CARDS – podstránky
   ============================================================ */

/* Product list — hlavný grid */
#products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

/* Product list — Najpredávanejšie slider */
#productsTop {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    overflow-x: auto;
}

/* Karta — vonkajší .product */
#products .product,
#productsTop .product {
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    width: 100% !important;
    min-width: 0;
    height: auto;
    align-self: stretch;
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 0 2px #F1F1F6;
    transition: box-shadow 0.2s ease;
}

#products .product:hover,
#productsTop .product:hover {
    box-shadow: 0 0 0 2px #EF1022;
}

/* Karta — vnútorný .p */
#products .product .p,
#productsTop .product .p {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    width: 100% !important;
    height: 100%;
    background: #FFFFFF;
    border: none;
    outline: none !important;
    border-radius: 0;
    overflow: visible;
    transition: none;
}

/* Kód produktu — skryť */
#products .product .p-code,
#productsTop .product .p-code {
    display: none;
}

/* Image sekcia */
#products .product .p a.image,
#productsTop .product .p a.image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 180px;
    padding: 16px;
    background: #FFFFFF;
    box-sizing: border-box;
    text-decoration: none;
    position: relative;
}

#products .product .p a.image img,
#productsTop .product .p a.image img {
    max-width: 100%;
    max-height: 148px;
    object-fit: contain;
    mix-blend-mode: darken;
}

/* Info sekcia */
#products .product .p .p-in,
#productsTop .product .p .p-in {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    padding: 12px 16px 16px;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    flex: 1 !important;
    justify-content: space-between !important;
}

/* Názov + hodnotenia */
#products .product .p .p-in-in,
#productsTop .product .p .p-in-in {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    align-items: center !important;
}

/* Názov */
#products .product .p .name,
#productsTop .product .p .name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    text-align: center !important;
    color: #14141F;
    text-decoration: none;
    display: block;
    width: 100%;
}

#products .product .p .name:hover,
#productsTop .product .p .name:hover {
    color: #EF1022;
}

/* Hodnotenia + dostupnosť */
#products .product .p .ratings-wrapper,
#productsTop .product .p .ratings-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    gap: 2px;
    width: 100%;
}

#products .product .p .availability,
#productsTop .product .p .availability {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 18px;
    color: #0C8D28;
    text-align: center !important;
    width: 100% !important;
}

/* Spodná časť */
#products .product .p .p-bottom,
#productsTop .product .p .p-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: auto;
    padding-bottom: 16px;
}

#products .product .p .p-bottom > div,
#productsTop .product .p .p-bottom > div {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* Offer div — kľúčové pre správne zobrazenie */
#products .product .p .p-bottom > div[data-micro="offer"],
#productsTop .product .p .p-bottom > div[data-micro="offer"] {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Cena */
#products .product .p .prices,
#productsTop .product .p .prices {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 8px !important;
}

#products .product .p .price-final strong,
#productsTop .product .p .price-final strong {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #2B2B40;
}

/* Tlačidlo košík */
#products .product .p .p-tools,
#products .product .p .pr-action,
#productsTop .product .p .p-tools,
#productsTop .product .p .pr-action {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
}

#products .product .p .btn-cart,
#productsTop .product .p .btn-cart {
    display: flex !important;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 8px 20px;
    gap: 8px;
    height: 34px;
    width: auto !important;
    background: #CD0E1D;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 20px;
    text-transform: uppercase;
    color: #FFFFFF;
    transition: background 0.2s ease;
}

#products .product .p .btn-cart:hover,
#productsTop .product .p .btn-cart:hover {
    background: #a50b17;
}

/* Ikona košíka */
#products .product .p .btn-cart::before,
#productsTop .product .p .btn-cart::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}

/* Badge / Labels */
#products .product .p .labels,
#products .product .p .label,
#productsTop .product .p .labels,
#productsTop .product .p .label {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

#products .product .p .label span,
#products .product .p .labels span,
#productsTop .product .p .label span,
#productsTop .product .p .labels span {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #14141F;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 12px;
    color: #FFFFFF;
}

/* ── Responzívnosť ── */
@media (max-width: 1280px) {
    #products {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    #products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        padding: 0 8px !important;
    }

    #products .product,
    #productsTop .product {
        width: 100% !important;
    }

    #products .product .p a.image,
    #productsTop .product .p a.image {
        height: 140px;
    }

    #products .product .p .name,
    #productsTop .product .p .name {
        font-size: 13px;
    }

    #products .product .p .p-in,
    #productsTop .product .p .p-in {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 10px 12px 12px !important;
        box-sizing: border-box !important;
        align-items: center !important;
    }

    #products .product .p .p-bottom,
    #productsTop .product .p .p-bottom {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        box-sizing: border-box !important;
        align-items: center !important;
        margin-top: 8px !important;
        padding-bottom: 0 !important;
    }

    #products .product .p .p-bottom > div[data-micro="offer"],
    #productsTop .product .p .p-bottom > div[data-micro="offer"] {
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #products .product .p .prices,
    #productsTop .product .p .prices {
        width: 100% !important;
        justify-content: center !important;
        margin-bottom: 8px !important;
    }

    #products .product .p .p-tools,
    #products .product .p .pr-action,
    #productsTop .product .p .p-tools,
    #productsTop .product .p .pr-action {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    #products .product .p .btn-cart,
    #productsTop .product .p .btn-cart {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px 12px !important;
        margin: 0 0 8px 0 !important;
    }
}