/**
 * File: /wp-content/plugins/sveton-product-promotions/assets/css/frontend.css
 * Module: Frontend styles — акции товаров SvetON.
 * Version: 0.4.0
 *
 * Принцип UX:
 * - Акция заметна, но не конкурирует с ценой и кнопкой покупки.
 * - На мобильном блок максимально компактный, короткий текст ограничен двумя строками.
 * - Бейдж каталога не перекрывает большую часть изображения товара.
 */

/* Карточка товара в каталоге должна быть точкой позиционирования для бейджа. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    position: relative;
}

.spp-loop-badge {
    position: absolute;
    z-index: 8;
    top: 10px;
    left: 10px;
    max-width: 76%;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ff9f1a;
    color: #fff;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .10);
    pointer-events: none;
}

.spp-single-promo {
    margin: 10px 0 14px;
    padding: 0;
    border: 0;
}

.spp-single-promo__content {
    position: relative;
    padding: 12px 14px 11px 16px;
    border: 1px solid #ffd7a1;
    border-left: 4px solid #ff9f1a;
    border-radius: 12px;
    background: #fff9f1;
}

.spp-single-promo__badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin: 0 0 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #ff9f1a;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: .01em;
}

.spp-single-promo__badge-link {
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.spp-single-promo__badge-link:hover,
.spp-single-promo__badge-link:focus {
    background: #e88d0a;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(216, 115, 0, .18);
}

.spp-single-promo__badge-link:focus-visible {
    outline: 2px solid #d87300;
    outline-offset: 2px;
}

.spp-single-promo__headline {
    margin: 0;
    color: #1d1d1f;
    font-size: 16px;
    line-height: 1.28;
    font-weight: 600;
}

.spp-single-promo__text {
    margin: 5px 0 0;
    color: #656565;
    font-size: 13px;
    line-height: 1.42;
}

.spp-single-promo__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    color: #d87300;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    text-decoration: none;
}

.spp-single-promo__link:hover,
.spp-single-promo__link:focus {
    color: #aa5900;
    text-decoration: underline;
}

@media (max-width: 767px) {
    .spp-loop-badge {
        top: 7px;
        left: 7px;
        max-width: 72%;
        padding: 5px 8px;
        font-size: 10.5px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
    }

    .spp-single-promo {
        margin: 7px 0 9px;
    }

    .spp-single-promo__content {
        padding: 9px 10px 8px 11px;
        border-left-width: 3px;
        border-radius: 10px;
    }

    .spp-single-promo__badge {
        min-height: 20px;
        margin-bottom: 4px;
        padding: 3px 7px;
        font-size: 10px;
    }

    .spp-single-promo__headline {
        font-size: 14px;
        line-height: 1.24;
    }

    .spp-single-promo__text {
        display: -webkit-box;
        margin-top: 3px;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        color: #666;
        font-size: 12px;
        line-height: 1.32;
    }

    .spp-single-promo__link {
        margin-top: 5px;
        font-size: 12px;
    }
}

/* v0.3.3: явная CTA «Условия акции» на single product. */
.spp-single-promo__link {
    padding: 2px 0;
    text-underline-offset: 3px;
}

.spp-single-promo__link::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 5px;
}

/*
 * v0.4.0 — безопасное визуальное отображение цены/выгоды.
 * Эти стили применяются только к HTML, который добавляет SPP.
 * Числовая цена WooCommerce не меняется.
 */
.spp-price-display {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 7px 9px;
    max-width: 100%;
}

.spp-price-display--marketing {
    align-items: center;
}

.spp-price-benefit {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff1df;
    color: #b65c00;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.spp-price-display--compare {
    row-gap: 4px;
}

.spp-price-reference,
.spp-price-current {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.spp-price-reference {
    color: #7b7b7b;
    font-size: .88em;
}

.spp-price-reference__label {
    font-size: .78em;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.spp-price-reference del {
    color: inherit;
    opacity: .78;
}

.spp-price-current ins {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 767px) {
    .spp-price-display {
        gap: 5px 7px;
    }

    .spp-price-benefit {
        min-height: 21px;
        padding: 3px 7px;
        font-size: 10.5px;
    }

    .spp-price-reference {
        font-size: .84em;
    }
}
