/* =========================================================
   АэроБин — интерактивные блоки
   Облако точек LiDAR (ВИТАМИН 330), автозамена дрона и подбор дрона («Роботы»)
   ========================================================= */

.w-panel {
    border: 1px solid var(--line);
    border-radius: var(--r-lg, 24px);
    background: linear-gradient(180deg, rgba(10, 13, 31, 0.92), rgba(5, 6, 15, 0.92));
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}
.w-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    font-size: 0.88rem;
    color: var(--muted);
}
.w-bar strong { color: var(--text) !important; font-weight: 500 !important; }
.w-hint { color: var(--muted); font-size: 0.85rem; }
.w-live::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: #7fd6a4;
    box-shadow: 0 0 10px #7fd6a4;
    vertical-align: 1px;
}
.w-caption { margin-top: 14px; text-align: center; font-size: 0.85rem; color: var(--muted) !important; max-width: none !important; }
.w-panel svg text { font-family: inherit; }

/* ---------- Облако точек ---------- */
.w-cloud { position: relative; height: 420px; cursor: grab; touch-action: pan-y; }
.w-cloud:active { cursor: grabbing; }
.w-cloud canvas { display: block; width: 100%; height: 100%; }
.w-legend {
    position: absolute;
    left: 20px;
    bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--muted);
}
.w-legend i { display: block; width: 110px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #2b5cff, #7cc6f2, #eceef6); }
.w-legend .w-defect { margin-left: 12px; color: #f3d8a8; }

/* ---------- Автозамена ---------- */
.w-swap { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.w-swap svg { display: block; width: 100%; height: auto; border-right: 1px solid var(--line); }
.w-swap-side { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.w-unit { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.w-unit-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; color: var(--text); margin-bottom: 10px; }
.w-unit-top span { color: var(--muted); font-size: 0.84rem; text-align: right; }
.w-batt { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.w-batt i { display: block; height: 100%; width: 50%; border-radius: 4px; background: #7fd6a4; transition: background-color 0.4s; }
.w-batt.is-low i { background: #f0b65a; }
.w-swap-log { font-size: 0.86rem; color: var(--muted); line-height: 1.5; min-height: 4.5em; }
.w-swap-log b { color: var(--text-2) !important; font-weight: 500 !important; }

/* ---------- Подбор дрона ---------- */
.w-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.w-pick-form { padding: 26px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; }
.w-q { font-size: 0.95rem; color: var(--text); margin-bottom: 10px; }
.w-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.w-chip {
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text-2);
    border-radius: 999px;
    padding: 8px 14px;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.w-chip:hover { border-color: rgba(236, 238, 246, 0.5); }
.w-chip[aria-pressed="true"] { background: var(--text); color: var(--night); border-color: var(--text); }
.w-range { display: flex; align-items: center; gap: 14px; }
.w-range input { flex: 1; accent-color: var(--accent); }
.w-range output { min-width: 64px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.w-pick-res { padding: 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-content: start; }
.w-m {
    position: relative;
    display: block;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 10px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.w-m img { width: 100%; height: 110px; object-fit: contain; margin-bottom: 6px; }
.w-m .w-n { color: var(--text); font-weight: 200; font-size: 2rem; letter-spacing: -0.03em; line-height: 1; }
.w-m .w-s { font-size: 0.78rem; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.w-m.is-off { opacity: 0.28; }
.w-m.is-best { border-color: var(--text); box-shadow: 0 0 0 4px rgba(236, 238, 246, 0.06); }
.w-m.is-best::before {
    content: "Подходит лучше всего";
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--night);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.w-pick-why { grid-column: 1 / -1; font-size: 0.9rem; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; max-width: none !important; }
.w-pick-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.w-pick-actions a {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--line-strong);
    color: var(--text);
}
.w-pick-actions a.is-primary { background: var(--text); color: var(--night); border-color: var(--text); }
.w-pick-actions a:hover { border-color: rgba(236, 238, 246, 0.6); }

@media (max-width: 860px) {
    .w-swap, .w-pick { grid-template-columns: 1fr; }
    .w-swap svg, .w-pick-form { border-right: 0; border-bottom: 1px solid var(--line); }
    .w-cloud { height: 320px; }
    .w-pick-res { padding: 22px 16px; gap: 8px; }
    .w-m img { height: 80px; }
    .w-m .w-n { font-size: 1.5rem; }
    .w-m.is-best::before { content: "Лучше всего"; font-size: 0.66rem; padding: 2px 8px; }
}

/* Карточка дрона целиком ведёт на страницу модели */
.drone-card.is-link { cursor: pointer; }
.drone-card.is-link:hover .specs2 a { color: #ffffff !important; }

/* Карточки дронов: характеристики сверху, «Подробнее» прижата к низу и отделена линией */
.drone-card { display: flex !important; flex-direction: column; }
.drone-card .specs { margin-bottom: 24px !important; }
.drone-card .specs2 {
    list-style: none;
    margin: auto 0 0 !important;
    padding: 20px 0 0 !important;
    border-top: 1px solid var(--line);
}
.drone-card .specs2 li { padding: 0 !important; }
.drone-card .specs2 li::before { display: none !important; }
.drone-card .specs2 li a {
    display: inline-block;
    padding: 9px 20px !important;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 0.9rem !important;
    transition: border-color 0.2s, background-color 0.2s;
}
.drone-card.is-link:hover .specs2 li a { border-color: rgba(236, 238, 246, 0.6); background: rgba(255, 255, 255, 0.04); }

/* ---------- ИК-камера ВИТАМИН 730 ---------- */
.w-th { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
.w-th-stage {
    position: relative;
    aspect-ratio: 960 / 420;
    border-right: 1px solid var(--line);
    overflow: hidden;
    cursor: crosshair;
    touch-action: pan-y;
}
.w-th-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.w-th-stage [data-cam="ir"] {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.9s cubic-bezier(0.6, 0, 0.3, 1);
}
.w-th.is-ir .w-th-stage [data-cam="ir"] { clip-path: inset(0 0 0 0); }
.w-th-scan {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    box-shadow: 0 0 14px rgba(255, 220, 160, 0.8);
    opacity: 0;
    pointer-events: none;
}
.w-th.is-ir .w-th-scan { animation: th-scan 0.9s cubic-bezier(0.6, 0, 0.3, 1) both; }
@keyframes th-scan { 0% { top: 0; opacity: 1; } 95% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.w-th-mark {
    position: absolute;
    width: 0; height: 0;
    opacity: 0;
    transition: opacity 0.4s 0.8s;
    pointer-events: none;
}
.w-th.is-ir .w-th-mark { opacity: 1; }
.w-th-mark::before, .w-th-mark::after {
    content: "";
    position: absolute;
    left: -14px; top: -14px;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
}
.w-th-mark::after { animation: alarm-ring 1.8s ease-out infinite; }
.w-th-mark b {
    position: absolute;
    left: 20px; top: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(5, 6, 15, 0.85);
    border: 1px solid rgba(240, 182, 90, 0.7);
    color: #f3d8a8;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.w-th-cross, .w-th-tip { position: absolute; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.w-th-stage.is-measuring .w-th-cross, .w-th-stage.is-measuring .w-th-tip { opacity: 1; }
.w-th-cross { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.w-th-cross::before, .w-th-cross::after { content: ""; position: absolute; background: #ffffff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.w-th-cross::before { left: 10px; top: 0; width: 2px; height: 22px; }
.w-th-cross::after { top: 10px; left: 0; height: 2px; width: 22px; }
.w-th-tip {
    margin: 14px 0 0 14px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(5, 6, 15, 0.88);
    border: 1px solid rgba(220, 226, 255, 0.35);
    color: var(--text);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.w-th-tip.is-left { transform: translateX(calc(-100% - 28px)); }
.w-th-tip.is-hot { border-color: rgba(240, 182, 90, 0.8); color: #f3d8a8; }
.w-th-side { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.w-th-scale { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #02020e, #22065c, #880e84, #d62e3e, #f6780c, #ffce2e, #fffae0); }
.w-th-scale-l { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.w-alarm {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(240, 182, 90, 0.4);
    background: rgba(240, 182, 90, 0.07);
    color: #f3d8a8;
    font-size: 0.86rem;
    line-height: 1.45;
}

/* ---------- Общие: значения и журнал в правой панели ---------- */
.w-stats { list-style: none; margin: 0; padding: 0; }
.w-stats li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.88rem;
    color: var(--muted);
}
.w-stats li:last-child { border-bottom: 0; }
.w-stats b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.w-stats b.is-warn { color: #f3d8a8; }
.w-chips-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-bottom: 1px solid var(--line); }

/* ---------- Модули ВИТАМИН 480 ---------- */
.w-mod { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.w-mod svg { display: block; width: 100%; height: auto; border-right: 1px solid var(--line); }
.w-mod-side { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.w-mod-title { font-size: 0.95rem; color: var(--text); }
.w-mod-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.w-mod-log li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-2);
    animation: log-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.w-mod-log li time { color: var(--muted); font-variant-numeric: tabular-nums; }
.w-mod-log li.is-alarm { border-color: rgba(240, 182, 90, 0.35); background: rgba(240, 182, 90, 0.07); color: #f3d8a8; }
.w-plume { transform-box: fill-box; transform-origin: center; animation: plume 2.1s ease-out infinite; }
@keyframes plume { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(3.4) translateY(-6px); opacity: 0; } }
.w-sound { transform-box: fill-box; transform-origin: center; animation: sound 1.8s ease-out forwards; }
@keyframes sound { from { transform: scale(1); opacity: 0.9; } to { transform: scale(7); opacity: 0; } }

@media (max-width: 860px) {
    .w-th, .w-mod { grid-template-columns: 1fr; }
    .w-th-stage, .w-mod svg { border-right: 0; border-bottom: 1px solid var(--line); }
    .w-chips-bar { padding: 12px 16px; }
}

/* Модули + LiDAR в одном блоке */
.w-mod-stage { position: relative; border-right: 1px solid var(--line); min-width: 0; }
.w-mod-stage svg { border-right: 0 !important; }
.w-mod-stage .w-cloud { position: absolute; inset: 0; height: auto; display: none; }
[data-modules].is-lidar .w-mod-stage .w-cloud { display: block; }
[data-modules].is-lidar .w-mod-stage svg { visibility: hidden; }
@media (max-width: 860px) { .w-mod-stage { border-right: 0; border-bottom: 1px solid var(--line); } .w-mod-stage svg { border-bottom: 0 !important; } }
