/* photos-price-preview — styles for enhanced WTPI photo tiles.
   Everything is scoped under the .wtpp-enhanced wrapper so the rules win over
   the generic span[class^=item-type] styles from all.css without !important. */

.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced a.wtpp-card {
    position: relative;
    display: block;
}

.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced span[class^=item-type] {
    width: var(--wtpp-size, 100px);
    height: var(--wtpp-size, 100px);
    border-radius: var(--wtpp-radius, 10px); /* rounded square instead of the 40px circle */
    /* reset the `margin: 2px 0` from all.css — .wtpp-price is anchored to the
       anchor's bottom edge, so a bottom margin on the span would leave the bar
       hanging 2px below the tile image */
    margin: 0;
    border: 1px solid #e5e5e5;
    background-size: contain;
    background-position: center;
    box-shadow: 0 0 6px rgba(0, 0, 0, .1);
}

/* discount flag — full-width bar across the top of the tile, black by default */
.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced .wtpp-flag {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: var(--wtpp-flag-bg, #000);
    color: var(--wtpp-flag-color, #fff);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    padding: 4px;
    border-radius: calc(var(--wtpp-radius, 10px) - 1px) calc(var(--wtpp-radius, 10px) - 1px) 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* discounted price — bar across the bottom of the tile, red background by default */
.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced .wtpp-price {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: var(--wtpp-price-bg, #fb0201);
    color: var(--wtpp-price-color, #fff);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    padding: 3px 4px;
    border-radius: 0 0 calc(var(--wtpp-radius, 10px) - 1px) calc(var(--wtpp-radius, 10px) - 1px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* client's alternative: price text in the availability color, neutral background */
.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced.is-avail-color .wtpp-price {
    background: #f5f5f5;
    color: var(--wtpp-avail, #3c840f);
}

/* current product — override the green border + SVG checkmark from all.css */
.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced a.is-current span[class^=item-type] {
    border: 2px solid var(--wtpp-current-border, #000);
}

.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced a.is-current span[class^=item-type]::before {
    content: none;
}

/* hover: image zoom like the reference is not possible (background-image) — light lift instead */
.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced a.wtpp-card:hover span[class^=item-type] {
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
}

/* item-label tooltip stays above the discount flag on hover */
.c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced .item-label {
    z-index: 3;
}

@media (max-width: 575px) {
    .c-product-interconnection-detail-params__products.is-type--photos.wtpp-enhanced span[class^=item-type] {
        /* redefined on the tile itself so it wins over the inline value on the
           wrapper; the mobile size itself comes from config (sizeMobile) via
           the inherited --wtpp-size-mobile custom property */
        --wtpp-size: var(--wtpp-size-mobile, 80px);
    }
}
