/* =========================================================================
   Подстраница «Сайт-визитка» (/services/site/vizitka/) — shop.css из макета подстраниц.
   Подключается ПОСЛЕ sites.css и sites-v4.css компонента service.site (../subpage.php):
   тот же шаблон, что у «Создания сайтов», здесь только то, чего там нет. 1rem = 20px, как в sites.css.
   ========================================================================= */

/* ---------- отступы между блоками ----------
   У подстраниц часть блоков (интеграции, сравнение, кейсы) есть не везде,
   и два светлых или два тёмных блока могут оказаться рядом — тогда отступ
   складывается вдвое. Второму такому блоку убираем верхний отступ. */
.shop .sites-light + .sites-light,
.shop .sites-dark + .sites-dark { padding-top: 0; }

/* ---------- 01. цифры первого экрана: цены длиннее, чем «10 лет» ---------- */
.shop .sites-hero__stats { gap: 1.8rem; }
.shop .sites-hero__stat dt { font-size: 1.35rem; white-space: nowrap; }

/* ---------- 01. путь покупателя под первым экраном ----------
   Этапы по очереди подсвечиваются, по линии бежит красная заливка. */
.shop-path {
    --n: 6;
    --loop: 9s;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    margin: 0 0 5.6rem;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line-d);
    border-bottom: 1px solid var(--line-d);
}
.shop-path::before,
.shop-path::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    height: 2px;
}
.shop-path::before { right: 0; background: transparent; }
.shop-path::after {
    width: 100%;
    background: linear-gradient(90deg, var(--red), var(--red-2) 70%, var(--yellow));
    transform-origin: left;
    transform: scaleX(0);
    animation: shop-path-fill var(--loop) linear infinite;
}
@keyframes shop-path-fill {
    0% { transform: scaleX(0); opacity: 1; }
    85%, 96% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}
@keyframes shop-path-fill-v {
    0% { transform: scaleY(0); opacity: 1; }
    85%, 96% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(1); opacity: 0; }
}

.shop-path__step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.4rem 1.2rem 1.5rem;
    border-right: 1px solid var(--line-d);
    transition: background-color 0.35s;
}
.shop-path__step:last-child { border-right: 0; }
.shop-path__step:hover { background: rgba(255, 255, 255, 0.04); }
.shop-path__n { font-family: var(--f-mono); font-size: var(--fs-3xs); color: var(--muted-d); }
.shop-path__step b { font-size: var(--fs-body); font-weight: 600; line-height: 1.3; color: var(--paper); }
.shop-path__step small { font-size: var(--fs-xs); line-height: 1.45; color: var(--muted-d); }

/* подсветка шага, когда до него «доходит» заливка */
.shop-path__step::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 1.2rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 0 0 1px var(--line-d);
    animation: var(--loop) linear infinite;
}
.shop-path__step .shop-path__n { animation: var(--loop) linear infinite; }
/* Заливка линии доходит до шага i в момент i/6 × 85% цикла. С этого момента
   круг закрашен и остаётся закрашенным до конца цикла; сбрасываются все
   вместе, когда линия гаснет (96–100%). Текущий шаг — с кольцом. */
.shop-path__step:nth-child(1)::before { animation-name: shop-dot-1; }
.shop-path__step:nth-child(2)::before { animation-name: shop-dot-2; }
.shop-path__step:nth-child(3)::before { animation-name: shop-dot-3; }
.shop-path__step:nth-child(4)::before { animation-name: shop-dot-4; }
.shop-path__step:nth-child(5)::before { animation-name: shop-dot-5; }
.shop-path__step:nth-child(6)::before { animation-name: shop-dot-6; }
.shop-path__step:nth-child(1) .shop-path__n { animation-name: shop-num-1; }
.shop-path__step:nth-child(2) .shop-path__n { animation-name: shop-num-2; }
.shop-path__step:nth-child(3) .shop-path__n { animation-name: shop-num-3; }
.shop-path__step:nth-child(4) .shop-path__n { animation-name: shop-num-4; }
.shop-path__step:nth-child(5) .shop-path__n { animation-name: shop-num-5; }
.shop-path__step:nth-child(6) .shop-path__n { animation-name: shop-num-6; }

@keyframes shop-dot-1 {
    0%, 14% { background: var(--red-2); box-shadow: 0 0 0 4px rgba(240, 90, 74, 0.25); }
    15%, 96% { background: var(--red-2); box-shadow: 0 0 0 1px var(--red-2); }
    100% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
}
@keyframes shop-dot-2 {
    0%, 14% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
    14.2%, 28.2% { background: var(--red-2); box-shadow: 0 0 0 4px rgba(240, 90, 74, 0.25); }
    29%, 96% { background: var(--red-2); box-shadow: 0 0 0 1px var(--red-2); }
    100% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
}
@keyframes shop-dot-3 {
    0%, 28.2% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
    28.4%, 42.4% { background: var(--red-2); box-shadow: 0 0 0 4px rgba(240, 90, 74, 0.25); }
    43%, 96% { background: var(--red-2); box-shadow: 0 0 0 1px var(--red-2); }
    100% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
}
@keyframes shop-dot-4 {
    0%, 42.4% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
    42.6%, 56.6% { background: var(--red-2); box-shadow: 0 0 0 4px rgba(240, 90, 74, 0.25); }
    57%, 96% { background: var(--red-2); box-shadow: 0 0 0 1px var(--red-2); }
    100% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
}
@keyframes shop-dot-5 {
    0%, 56.6% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
    56.8%, 70.7% { background: var(--red-2); box-shadow: 0 0 0 4px rgba(240, 90, 74, 0.25); }
    71.5%, 96% { background: var(--red-2); box-shadow: 0 0 0 1px var(--red-2); }
    100% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
}
@keyframes shop-dot-6 {
    0%, 70.7% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
    70.9%, 96% { background: var(--yellow); box-shadow: 0 0 0 4px rgba(250, 246, 139, 0.25); }
    100% { background: var(--ink); box-shadow: 0 0 0 1px var(--line-d); }
}
@keyframes shop-num-1 { 0%, 96% { color: var(--red-2); } 100% { color: var(--muted-d); } }
@keyframes shop-num-2 { 0%, 14% { color: var(--muted-d); } 14.2%, 96% { color: var(--red-2); } 100% { color: var(--muted-d); } }
@keyframes shop-num-3 { 0%, 28.2% { color: var(--muted-d); } 28.4%, 96% { color: var(--red-2); } 100% { color: var(--muted-d); } }
@keyframes shop-num-4 { 0%, 42.4% { color: var(--muted-d); } 42.6%, 96% { color: var(--red-2); } 100% { color: var(--muted-d); } }
@keyframes shop-num-5 { 0%, 56.6% { color: var(--muted-d); } 56.8%, 96% { color: var(--red-2); } 100% { color: var(--muted-d); } }
@keyframes shop-num-6 { 0%, 70.7% { color: var(--muted-d); } 70.9%, 96% { color: var(--yellow); } 100% { color: var(--muted-d); } }
.shop-path__step--end b { color: var(--yellow); }

/* ---------- 02. форматы магазинов: 4 карточки ---------- */
.sites-types__grid.shop-types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shop-types .sites-type { min-height: 14rem; }
/* метка «Частая задача» не должна наезжать на длинный заголовок карточки */
.shop-types .sites-type__hot + .sites-type__name { margin-top: 1.8rem; }
.shop-type__tag {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--line-l);
    border-radius: 999px;
    font-family: var(--f-mono);
    font-size: var(--fs-3xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-l);
}
.sites-type--dark .shop-type__tag { border-color: var(--line-d); color: var(--muted-d); }
.shop-types .sites-type__flow { margin-top: auto; padding-top: 1.4rem; }

/* ---------- 03. что входит ---------- */
.shop-inc { position: relative; padding: 6.4rem 0; overflow: hidden; }
.shop-inc .sites-container { position: relative; }
.sites-reasons.shop-inc__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 3.2rem; }
.shop-inc__n { font-family: var(--f-mono); font-size: var(--fs-3xs); color: var(--red-2); }

/* ---------- 06. платформа ---------- */
.shop-cms .sites-wp.shop-cms__box { margin-top: 0; align-items: center; }
.shop-cms__box .sites-h2 { margin-top: 0.8rem; }
.shop-cms__box .sites-text { margin-top: 1.2rem; }
.shop-cms__links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; margin-top: 1.6rem; }

/* ---------- планшет ---------- */
@media (max-width: 1007px) {
    /* путь — вертикальная шкала: в сетке 3×2 / 2×3 линия шла только над первым рядом.
       Строки равной высоты, точка шага i на расстоянии (i-1)/6 от начала линии —
       совпадает с таймингом shop-dot-* без правки ключевых кадров. */
    .shop-path {
        --d: 1.35rem; /* от верха шага до центра точки */
        grid-template-columns: 1fr;
        grid-auto-rows: 1fr;
        margin-bottom: 4rem;
        padding-left: 1.6rem;
        border-top: 0;
        overflow: hidden;
    }
    .shop-path::before,
    .shop-path::after { top: var(--d); left: 7px; width: 2px; }
    .shop-path::before { right: auto; bottom: 0; height: auto; background: var(--line-d); }
    .shop-path::after {
        height: 100%;
        background: linear-gradient(180deg, var(--red), var(--red-2) 70%, var(--yellow));
        transform-origin: top;
        transform: scaleY(0);
        animation-name: shop-path-fill-v;
    }
    .shop-path__step {
        display: grid;
        grid-template-columns: 2rem minmax(0, auto) minmax(0, 1fr);
        align-items: baseline;
        column-gap: 0.8rem;
        padding: 0.9rem 0;
        border-right: 0;
    }
    .shop-path__step + .shop-path__step { border-top: 1px solid var(--line-d); }
    .shop-path__step::before { top: calc(var(--d) - 4px); left: calc(4px - 1.6rem); }
    .sites-types__grid.shop-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sites-reasons.shop-inc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shop-inc { padding: 4.6rem 0; }
}

/* ---------- телефон ---------- */
@media (max-width: 767px) {
    /* у подстраницы свой короткий маршрут — блоки идут в порядке разметки */
    .sites.shop > section { order: 0; }

    .shop-path { margin-bottom: 0; }
    /* на узком экране подпись — второй строкой под названием */
    .shop-path__step { grid-template-columns: 2rem minmax(0, 1fr); row-gap: 0.2rem; }
    .shop-path__step small { grid-column: 2; }
    .shop-path__step b { font-size: var(--fs-md); }

    .sites-types__grid.shop-types { grid-template-columns: 1fr; }
    .shop-types .sites-type { min-height: 0; }
    .shop-inc { padding: 4rem 0; }
    .sites-reasons.shop-inc__grid { grid-template-columns: 1fr; grid-auto-rows: auto; margin-top: 2rem; }
    .shop-cms__box .sites-compare { font-size: var(--fs-sm); }
}

@media (prefers-reduced-motion: reduce) {
    .shop-path::after { animation: none; transform: none; }
    .shop-path__step::before,
    .shop-path__step .shop-path__n { animation: none; }
    .shop-path__step::before { background: var(--red-2); box-shadow: 0 0 0 1px var(--red-2); }
    .shop-path__step .shop-path__n { color: var(--red-2); }
}
