/* ============================================================
   AromaVote — голосование на странице товара
   ============================================================ */

.aromavote {
    --av-accent: #7c5cff;
    --av-bar-bg: #eceef3;
    --av-text: #1f2330;
    --av-muted: #8a90a2;
    --av-line: #e7e8ee;
    --av-radius: 14px;

    width: 100%;
    margin: 28px 0;
    font-family: inherit;
    color: var(--av-text);
    -webkit-font-smoothing: antialiased;
}

.aromavote *,
.aromavote-modal * { box-sizing: border-box; }

/* ---------- Шапка ---------- */
.aromavote__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.aromavote__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.aromavote__results-btn {
    flex: none;
    border: 1px solid var(--av-accent);
    background: transparent;
    color: var(--av-accent);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.aromavote__results-btn:hover { background: var(--av-accent); color: #fff; }

/* ---------- Сетка блоков: ПК в 2–3 колонки, моб. в 1 ---------- */
.aromavote__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}

/* ---------- Категория-карточка ---------- */
.aromavote__group {
    --av-bar: var(--av-accent);
    border: 1px solid var(--av-line);
    border-radius: var(--av-radius);
    background: #fff;
    padding: 2px 14px 8px;
}
.aromavote__group-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 0;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
    color: inherit;
}
.aromavote__group-title {
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    flex: 1 1 auto;
}
.aromavote__group-total {
    font-size: 12px;
    font-weight: 600;
    color: var(--av-muted);
    background: var(--av-bar-bg);
    border-radius: 999px;
    padding: 2px 9px;
    min-width: 28px;
    text-align: center;
}
.aromavote__chevron {
    flex: none;
    width: 9px; height: 9px;
    border-right: 2px solid var(--av-muted);
    border-bottom: 2px solid var(--av-muted);
    transform: rotate(45deg);
    transition: transform .2s ease;
    margin-right: 2px;
}

/* без JS — раскрыто; с JS управляем классом is-open */
.aromavote--js .aromavote__group-body { display: none; }
.aromavote--js .aromavote__group.is-open .aromavote__group-body { display: block; }
.aromavote--js .aromavote__group:not(.is-open) .aromavote__chevron { transform: rotate(-45deg); }
.aromavote__group-body { padding-bottom: 6px; }

/* ---------- Строка варианта ---------- */
.aromavote__row {
    display: grid;
    grid-template-columns: minmax(96px, 1.3fr) 30px 1fr 30px;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
}
.aromavote__label { font-size: 12.5px; line-height: 1.25; }
.aromavote__count {
    font-size: 12px;
    font-weight: 600;
    color: var(--av-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: color .2s ease;
}
.aromavote__bar {
    height: 6px;
    background: var(--av-bar-bg);
    border-radius: 999px;
    overflow: hidden;
}
.aromavote__bar > i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--av-bar);
    border-radius: 999px;
    transition: width .55s cubic-bezier(.22,.61,.36,1);
}
.aromavote__add {
    position: relative;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid var(--av-line);
    background: #fff;
    color: var(--av-accent);
    font-size: 18px; line-height: 1;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.aromavote__add:hover:not(:disabled) {
    background: var(--av-accent);
    border-color: var(--av-accent);
    color: #fff;
    transform: scale(1.1);
}
.aromavote__add:active:not(:disabled) { transform: scale(.9); }
.aromavote__row.is-voted .aromavote__add,
.aromavote__add:disabled {
    background: var(--av-accent);
    border-color: var(--av-accent);
    color: #fff;
    cursor: default;
}
/* галочка вместо плюса у проголосованного варианта */
.aromavote__row.is-voted .aromavote__add { font-size: 0; }
.aromavote__row.is-voted .aromavote__add::after {
    content: "";
    position: absolute;
    left: 50%; top: 46%;
    width: 5px; height: 9px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translate(-50%, -55%) rotate(45deg);
}

/* ---------- Анимации голоса (#4) ---------- */
@keyframes av-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.45); }
    100% { transform: scale(1); }
}
.aromavote__add.is-clicked { animation: av-pop .35s ease; }

@keyframes av-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.aromavote__count.is-bumped {
    display: inline-block;
    animation: av-bump .4s ease;
    color: var(--av-accent);
}

@keyframes av-rise {
    0%   { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -26px) scale(.9); }
}
.aromavote__plus1 {
    position: absolute;
    left: 50%; top: -4px;
    transform: translate(-50%, 0);
    font-size: 12px;
    font-weight: 800;
    color: var(--av-accent);
    pointer-events: none;
    animation: av-rise .6s ease forwards;
    white-space: nowrap;
}

/* ---------- Pop-up ---------- */
.aromavote-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.aromavote-modal[hidden] { display: none; }
.aromavote-modal__overlay {
    position: absolute; inset: 0;
    background: rgba(20, 22, 34, .55);
    backdrop-filter: blur(2px);
}
.aromavote-modal__dialog {
    position: relative;
    width: 100%; max-width: 560px; max-height: 86vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(20, 22, 34, .35);
    padding: 22px 22px 26px;
    -webkit-overflow-scrolling: touch;
}
.aromavote-modal__head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.aromavote-modal__title { font-size: 17px; font-weight: 700; }
.aromavote-modal__close {
    border: 0; background: none;
    font-size: 26px; line-height: 1;
    color: #9aa0b0; cursor: pointer; padding: 0 4px;
}
.aromavote-modal__close:hover { color: #1f2330; }
.aromavote-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}
.aromavote-modal__cat {
    --av-block-color: var(--av-accent);
    border: 1px solid #eceef3;
    border-radius: 12px;
    padding: 14px 14px 12px;
    background: #fff;
    position: relative;
}
.aromavote-modal__cat::before {
    content: "";
    position: absolute;
    left: 0; top: 14px; bottom: 14px;
    width: 3px;
    background: var(--av-block-color);
    border-radius: 0 3px 3px 0;
}
.aromavote-modal__cat-title {
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    color: #6b6f7e;
    margin: 0 0 6px;
}
.aromavote-modal__winner {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}
.aromavote-modal__winner .w-label {
    font-size: 15px; font-weight: 700; color: #1f2330;
    line-height: 1.2;
}
.aromavote-modal__winner .w-pct {
    flex: none; font-size: 14px; font-weight: 700;
    color: var(--av-block-color);
    font-variant-numeric: tabular-nums;
}
.aromavote-modal__chart {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    align-items: center;
}
.aromavote-donut { width: 100%; max-width: 140px; height: auto; display: block; }
.aromavote-modal__legend {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 4px;
}
.aromavote-modal__legend li {
    display: grid;
    grid-template-columns: 10px 1fr 36px;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #1f2330;
}
.aromavote-modal__legend .dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.aromavote-modal__legend .lbl {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aromavote-modal__legend .pct {
    text-align: right; font-weight: 600; color: #6b6f7e;
    font-variant-numeric: tabular-nums;
}
.aromavote-modal__cat-total {
    margin-top: 10px;
    font-size: 11px;
    color: #9aa0b0;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.aromavote-modal__empty { color: #8a90a2; font-size: 14px; padding: 12px 0; }

/* ---------- Мобильная версия ---------- */
@media (max-width: 600px) {
    .aromavote { margin: 20px 0; }
    .aromavote__grid { grid-template-columns: 1fr; gap: 10px; }
    .aromavote__results-btn { padding: 7px 12px; }
}
