/*
 * KAT-198: price lines of katonpricerules. The lowest 30-day price, the catalog price and the percentages are as
 * legible as each other and close to the price (UOKiK pp. 35-37, 52, 54): same size, dark text, never light grey.
 */
.katon-price__now--promo,
.katon-price--promo .katon-price__now,
.katon-price__now--code {
    color: #e31e25;
}

.katon-price__label {
    font-weight: 400;
}

.katon-price--catalog .katon-price__label,
.katon-price--outlet .katon-price__label {
    margin-right: 0.375rem;
    font-size: 1rem;
    color: #232323;
}

.katon-price__compare {
    margin: 0.25rem 0 0.5rem;
}

.katon-price__line {
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: #232323;
}

.katon-price__line > span + span {
    margin-left: 0.25rem;
}

.katon-price__pct {
    font-weight: 700;
}

.katon-price__old {
    font-weight: 600;
    text-decoration: line-through;
}

.katon-price__amount {
    font-weight: 600;
}

.katon-price__line--code {
    font-size: 1rem;
}

.katon-price__line--code .katon-price__now--code {
    font-weight: 700;
}

.katon-price__hint {
    font-size: 0.875rem;
    color: #232323;
}

.katon-price__outlet {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #232323;
}

/* Product lists: shorter wording, same colour as the price; a reduced price in red as on the product page */
.product-miniature .product-price-and-shipping:has(.katon-price__line--promo) .price {
    color: #e31e25;
}

.product-miniature .katon-price__line--list {
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    text-align: center;
}

.product-miniature .katon-price__line--list + .katon-price__line--list {
    margin-top: 0;
}

/* the catalog price on lists second to the price to pay, so the bold price above it needs no "Nasza cena" label (the
   user's choice): regular weight, dark grey (5.7:1 on white, still readable; the 30-day lines of promotions stay
   dark, UOKiK pp. 35-37). KAT-191: the same for "Cena od <date>:" (a product first offered during a promotion, the
   price after its end): bold and dark, it read as a second price to pay */
.product-miniature .katon-price__line--catalog,
.product-miniature .katon-price__line--catalog .katon-price__amount,
.product-miniature .katon-price__line--upcoming,
.product-miniature .katon-price__line--upcoming .katon-price__amount {
    font-weight: 400;
    color: #666;
}

/* (i) after the shortened "Najniższa cena" on lists: tooltip with the full wording (price-info.tpl) */
.katon-price__info {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.katon-price__info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* a 24px target, the icon itself 16px */
    width: 1.5rem;
    height: 1.5rem;
    margin: -0.25rem -0.25rem -0.25rem 0;
    padding: 0;
    border: 0;
    background: none;
    color: #4a4a4a;
    cursor: pointer;
}

.katon-price__info-btn .material-icons {
    font-size: 1rem;
}

.katon-price__info-btn:focus:not(:focus-visible) {
    outline: none;
}

/* below the (i), so it never covers the price above it; it opens to the left, the (i) sits on the right of the
   tile, so it stays inside its own tile instead of running under the next one */
.katon-price__tip {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.375rem);
    right: -0.25rem;
    width: 12rem;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    background: #232323;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

/* the arrow points at the (i): its centre is 0.75rem from the tip's right edge (0.25rem offset + half the 1rem icon) */
.katon-price__tip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 0.375rem;
    border: 0.375rem solid transparent;
    border-bottom-color: #232323;
}

.katon-price__info.is-open .katon-price__tip,
.katon-price__info-btn:focus-visible + .katon-price__tip {
    visibility: visible;
    opacity: 1;
}

/* the tile with an open tooltip above its neighbours (each tile stacks on its own) */
.product-miniature:has(.katon-price__info:hover),
.product-miniature:has(.katon-price__info.is-open),
.product-miniature:has(.katon-price__info-btn:focus-visible) {
    position: relative;
    z-index: 30;
}

/* opened by a tap it lies over "Dodaj do koszyka": a tap on it only closes it (katonpricerules.js) */
.katon-price__info.is-open .katon-price__tip {
    pointer-events: auto;
}

/* hover only where there is a mouse: on phones a hover would stick after the tap */
@media (hover: hover) {
    .katon-price__info:hover .katon-price__tip {
        visibility: visible;
        opacity: 1;
    }
}

/* Cart lines */
.katon-price__compare--cart {
    margin: 0.25rem 0 0;
}

.katon-price__compare--cart .katon-price__line {
    font-size: 0.875rem;
}

/* Badges: a promotion keeps the theme's discount badge, outlet has its own colour (not a promotion) */
.product-flags li.product-flag.outlet {
    background-color: #4a4a4a;
    color: #fff;
}
