/* Напоминалка о скидке. Все классы с префиксом dh-, чтобы не пересечься с темой. */

.dh-hint {
    --dh-accent: #76c043;
    --dh-accent-deep: #4e8b26;
    --dh-wash: #e8f5dc;
    --dh-ink: #1b2416;
    --dh-ink-soft: #5d6b55;
    --dh-ink-faint: #8c9a85;
    --dh-line: #c6d2be;
    --dh-sunk: #eef2ea;

    position: relative;
    box-sizing: border-box;
    margin: 16px 0 0;
    padding: 16px 16px 14px;
    border: 1px solid var(--dh-line);
    border-radius: 12px;
    background: linear-gradient(160deg, var(--dh-wash) 0%, #fff 78%);
    color: var(--dh-ink);
    font-size: 15px;
    line-height: 1.45;
    overflow: hidden;
    transition: border-color .3s ease, background .3s ease;
}

.dh-hint * {
    box-sizing: border-box;
}

.dh-hint.dh-empty {
    display: none;
}

/* «совсем чуть-чуть» — тёплый акцент, не красный: красный на витрине означает ошибку */
.dh-hint.dh-hot {
    --dh-accent: #f08a24;
    --dh-accent-deep: #d97708;
    --dh-wash: #fdf0df;
    border-color: #f08a24;
}

/* добор окупается — самый выгодный для покупателя случай, усиливаем зелёный */
.dh-hint.dh-bargain {
    --dh-wash: #d3ecbc;
    border-color: var(--dh-accent);
}

/* ступень потеряна */
.dh-hint.dh-lost {
    --dh-accent: #b4653a;
    --dh-accent-deep: #b4653a;
    --dh-wash: #f7ece5;
    border-color: #b4653a;
}

.dh-hint.dh-max {
    --dh-wash: #d3ecbc;
}

/* цель далеко: спокойная строка без шкалы и призыва */
.dh-hint.dh-far {
    background: #fff;
}

.dh-head {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.dh-emoji {
    flex: none;
    font-size: 20px;
    line-height: 1.25;
}

.dh-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

/* ── шкала ─────────────────────────────────────────── */

.dh-scale {
    position: relative;
    margin: 22px 0 0;
    padding: 0 0 38px;
}

.dh-track {
    position: relative;
    height: 9px;
    border-radius: 999px;
    background: var(--dh-sunk);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08);
}

.dh-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--dh-accent) 0%, var(--dh-accent-deep) 100%);
    transition: width .6s cubic-bezier(.22, .9, .3, 1), background .3s ease;
}

.dh-hot .dh-fill {
    animation: dh-pulse 1.9s ease-in-out infinite;
}

@keyframes dh-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 138, 36, 0); }
    50%      { box-shadow: 0 0 0 5px rgba(240, 138, 36, .22); }
}

.dh-mark {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

.dh-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border: 2px solid var(--dh-line);
    border-radius: 50%;
    background: #fff;
    font-size: 9px;
    font-weight: 700;
    color: var(--dh-ink-faint);
    transition: background .35s ease, border-color .35s ease, color .35s ease;
}

.dh-mark.dh-reached .dh-dot {
    border-color: var(--dh-accent);
    background: var(--dh-accent);
    color: #12220a;
}

.dh-caption {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    text-align: center;
    font-size: 11px;
    line-height: 1.3;
    color: var(--dh-ink-faint);
}

.dh-mark.dh-reached .dh-caption {
    color: var(--dh-ink-soft);
}

/* последняя отметка стоит на самом краю шкалы: центрированная подпись уехала бы за блок */
.dh-mark:last-child .dh-caption {
    left: auto;
    right: 0;
    transform: none;
    text-align: right;
}

.dh-caption b {
    display: block;
    font-weight: 600;
    color: inherit;
}

.dh-bubble {
    position: absolute;
    top: -6px;
    transform: translate(-50%, -100%);
    padding: 3px 8px;
    border-radius: 7px;
    background: var(--dh-ink);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: left .6s cubic-bezier(.22, .9, .3, 1);
}

.dh-bubble:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--dh-ink);
}

/* ── строки ────────────────────────────────────────── */

.dh-lines {
    margin: 12px 0 0;
}

.dh-lines > p {
    margin: 0 0 5px;
}

.dh-lines > p:last-child {
    margin-bottom: 0;
}

.dh-action {
    font-size: 14px;
}

.dh-action b {
    font-weight: 700;
    white-space: nowrap;
}

/* цель далеко — призыв остаётся, но не подгоняет */
.dh-quiet {
    color: var(--dh-ink-soft);
    font-size: 13px;
}

.dh-gain {
    font-size: 14px;
    font-weight: 700;
    color: var(--dh-accent-deep);
}

.dh-current {
    font-size: 13px;
    color: var(--dh-ink-soft);
}

.dh-steps {
    font-size: 13px;
    color: var(--dh-ink-soft);
}

.dh-cta {
    display: inline-block;
    margin: 12px 0 0;
    padding: 9px 17px;
    border-radius: 9px;
    background: var(--dh-accent);
    color: #12220a;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: filter .15s ease;
}

.dh-cta:hover,
.dh-cta:focus {
    color: #12220a;
    text-decoration: none;
    filter: brightness(1.06);
}

.dh-hidden {
    display: none;
}

/* ── телефон ───────────────────────────────────────── */

@media screen and (max-width: 480px) {
    .dh-hint {
        padding: 14px 12px 12px;
    }

    .dh-title {
        font-size: 15px;
    }

    .dh-caption {
        font-size: 10px;
    }

    .dh-cta {
        display: block;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dh-hint,
    .dh-fill,
    .dh-bubble,
    .dh-dot {
        transition: none;
    }

    .dh-hot .dh-fill {
        animation: none;
    }
}

/* ── компактный вид в окне «товар добавлен» ────────── */

.dh-compact {
    margin: 12px 0;
    padding: 13px;
}

.dh-compact .dh-title {
    font-size: 15px;
}

/* в окне добавления прячем только перечисление ступеней и кнопку: у окна свои кнопки.
   Строка «сейчас вы экономите» остаётся — без неё видно будущую выгоду, но не текущую */
.dh-compact .dh-steps,
.dh-compact .dh-cta {
    display: none;
}

.dh-compact .dh-flash {
    font-size: 17px;
}

/* вспышка «ступень взята» — поверх блока, гаснет сама */
.dh-flash {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, #d3ecbc, #f4fbec);
    font-size: 18px;
    font-weight: 700;
    color: var(--dh-accent-deep);
    opacity: 0;
    pointer-events: none;
}

.dh-flash-on {
    animation: dh-flash 2.6s ease forwards;
}

@keyframes dh-flash {
    0%   { opacity: 0; transform: scale(.98); }
    10%  { opacity: 1; transform: scale(1); }
    78%  { opacity: 1; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .dh-flash-on {
        animation: none;
        opacity: 0;
    }
}

/* заглушка, пока идёт запрос: держит высоту, чтобы кнопки окна не прыгали */
.dh-loading {
    min-height: 128px;
}

.dh-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    pointer-events: none;
}

/* ── строка в мини-корзине шапки ───────────────────── */

.dh-mini {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid #c6d2be;
    border-radius: 10px;
    background: linear-gradient(160deg, #e8f5dc 0%, #fff 85%);
    box-sizing: border-box;
    clear: both;
}

.dh-mini-icon {
    flex: none;
    font-size: 15px;
    line-height: 1.3;
}

.dh-mini-body {
    flex: 1;
    min-width: 0;
}

.dh-mini-text {
    display: block;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
    color: #1b2416;
}

.dh-mini-track {
    height: 4px;
    margin: 6px 0 0;
    border-radius: 999px;
    background: #e0e7db;
    overflow: hidden;
}

.dh-mini-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #76c043, #4e8b26);
    transition: width .6s cubic-bezier(.22, .9, .3, 1);
}

/* ── строка в карточке товара ──────────────────────── */

.dh-product-line {
    margin: 10px 0;
    padding: 10px 12px;
    border: 1px solid #c6d2be;
    border-radius: 10px;
    background: #e8f5dc;
    font-size: 14px;
    line-height: 1.4;
    color: #1b2416;
}

.dh-product-line:empty {
    display: none;
}

/* ── строка после оформления заказа ────────────────── */

.dh-success {
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid #c6d2be;
    border-radius: 10px;
    background: #e8f5dc;
    font-size: 15px;
    color: #1b2416;
}
