/* Blitz product switcher + unified header lockup.
   Shared verbatim between blitzdocflow.top and blitztrade.top — keep both copies in sync.

   Desktop: a 3x3 grid button in the header opens a popover listing the Blitz products.
   Mobile (<=980px): the header block (t228 / t456) unfolds vertically on burger tap,
   so the popover flattens into an always-visible "Продукти Blitz" section inside it. */

/* --- header lockup: icon + wordmark, identical on both sites ---------------- */
/* Spacing inside the flex rows uses margins, not `gap`: flex gap only landed in
   Safari 14.1, and these sites still serve plenty of older iOS devices. */
.blitz-brand {
    display: inline-flex;
    align-items: center;
    /* inline-flex baseline-aligns to the icon's bottom edge, which left the lockup ~2px
       above the optical centre of the header row; middle puts it back where the old
       .t228__imglogo used to sit */
    vertical-align: middle;
    text-decoration: none;
    line-height: 1;
}

.blitz-brand__icon {
    display: block;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    margin-right: 11px;
}

.blitz-brand__name {
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #00adf2;
    white-space: nowrap;
}

/* --- switcher ------------------------------------------------------------- */
.blitz-switcher {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    text-align: left;
    font-family: 'Open Sans', Arial, sans-serif;
}

.blitz-switcher__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.blitz-switcher__toggle:hover,
.blitz-switcher.is-open .blitz-switcher__toggle {
    background: rgba(0, 173, 242, .12);
    /* a shade darker than the brand #00adf2 so the dots keep 3:1 against the tinted
       background (WCAG 1.4.11); the hue still reads as the same accent */
    color: #0092cc;
}

/* :focus-visible stays in rules of its own — a browser that does not know the selector
   (Safari < 15.4) discards the whole selector list it appears in, which would otherwise
   take the hover and open-state styling down with it. */
.blitz-switcher__toggle:focus-visible {
    background: rgba(0, 173, 242, .12);
    color: #0092cc;
    outline: 2px solid #0092cc;
    outline-offset: 2px;
}

.blitz-switcher__grid {
    display: grid;
    grid-template-columns: repeat(3, 3px);
    grid-gap: 3px;
    gap: 3px;
}

.blitz-switcher__grid i {
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
}

.blitz-switcher__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1000;
    width: 306px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid rgba(16, 32, 64, .07);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(16, 32, 64, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.blitz-switcher.is-open .blitz-switcher__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hover-to-open is driven from JS rather than a :hover rule so that the open state has a
   single source of truth: a CSS :hover would keep the panel visible after Escape had
   already cleared .is-open. (:focus-within would not help either — the panel is
   visibility:hidden while closed, so nothing inside it can take focus.) */

.blitz-switcher__title {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #6b7280;
}

.blitz-switcher__item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background-color .16s ease;
}

.blitz-switcher__item:hover {
    background: #f1f7fd;
}

.blitz-switcher__item:focus-visible {
    background: #f1f7fd;
    outline: 2px solid #0092cc;
    outline-offset: -2px;
}

.blitz-switcher__item img {
    display: block;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin-right: 12px;
}

.blitz-switcher__text {
    min-width: 0;
    flex: 1 1 auto;
}

.blitz-switcher__name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    color: #1f2937;
}

.blitz-switcher__desc {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.3;
    color: #64707f;
}

.blitz-switcher__mark {
    flex: 0 0 auto;
    margin-left: 12px;
    color: #7f8da0;
}

.blitz-switcher__item[aria-current] .blitz-switcher__mark {
    color: #0b8ec4;
}

.blitz-switcher__mark svg {
    display: block;
}

/* --- host adapters -------------------------------------------------------- */
/* t228 (blitzdocflow) lays its right-hand side out as a table row; t456
   (blitztrade) as an inline row. Both files carry both rules so the component
   stays byte-identical across the two sites. */
.t228__rightcontainer > .blitz-switcher {
    display: table-cell;
    vertical-align: middle;
    padding-left: 30px;
}

.t456__rightwrapper > .t456__list {
    display: inline-block;
    vertical-align: middle;
}

.t456__rightwrapper > .blitz-switcher {
    display: inline-block;
    vertical-align: middle;
    margin-left: 18px;
}

/* --- inside the unfolded mobile menu -------------------------------------- */
@media screen and (max-width: 980px) {
    .t456__rightwrapper > .t456__list {
        display: block;
    }

    /* The unfolded burger menu is a fixed-position box with no scrolling of its own, and
       the built-in overflow guard (t228_checkOverflow) only runs for submenu records these
       pages don't have. With the product section added the content can outgrow a short
       viewport, so give the menu its own scroll. */
    .t228.t228__positionfixed,
    .t456.t456__positionfixed {
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack the right-hand column and push the product list below the CTA, so adding it
       does not shove the header's only call to action off a small screen. Flex also takes
       the panel out of the shrink-to-fit table sizing that ignores its max-width. */
    .t228__rightcontainer {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .blitz-switcher,
    .t228__rightcontainer > .blitz-switcher,
    .t456__rightwrapper > .blitz-switcher {
        display: block;
        order: 2;
        margin: 0;
        padding: 15px 0 0;
        text-align: center;
    }

    .blitz-switcher__toggle {
        display: none;
    }

    .blitz-switcher__panel {
        position: static;
        /* an explicit width, not 100%: t228 wraps this in a shrink-to-fit context where a
           percentage would collapse to the CTA button's width. The viewport-unit cap is
           what actually bites on sub-306px screens (Galaxy Fold cover display, 280px). */
        width: 306px;
        max-width: calc(100vw - 32px);
        margin: 0 auto;
        padding: 6px;
        border-radius: 14px;
        border-color: rgba(16, 32, 64, .08);
        box-shadow: none;
        background: #f7fafd;
        opacity: 1;
        visibility: visible;
        transform: none;
        text-align: left;
    }

    .blitz-switcher__item {
        background: #fff;
    }

    .blitz-switcher__item + .blitz-switcher__item {
        margin-top: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .blitz-switcher__toggle,
    .blitz-switcher__panel,
    .blitz-switcher__item {
        transition: none;
    }
}

/* --- header call to action ------------------------------------------------ */
/* blitzdocflow ships a CTA in its header; blitztrade did not, so one was added there in
   the same slot. These rules give the added button the sizing the docflow header rule
   already provides for its own. */
.blitz-header-cta {
    display: inline-block;
    vertical-align: middle;
    margin-left: 18px;
}

/* #allrecords wins the id, so the label needs it too — the block's own "#allrecords
   .t456 a { color: #000 }" otherwise turns the text black once the menu unfolds. */
#allrecords .blitz-header-cta .t-btn,
.blitz-header-cta .t-btn {
    height: 40px;
    padding: 0 24px;
    font-size: 14px;
    color: #ffffff;
    background-color: #00adf2;
    white-space: nowrap;
}

#allrecords .blitz-header-cta .t-btn:hover,
.blitz-header-cta .t-btn:hover {
    color: #ffffff;
    background-color: #0092cc;
}

/* Buttons were square while the switcher next to them is rounded. One small radius across
   the real buttons — header, hero, forms, popups — settles that down. Scoped to anchors
   inside the hero blocks so it never rounds the artboard's images. */
.t-btn,
.t-submit,
.t651__submit,
.t396 a.tn-atom {
    border-radius: 8px !important;
}

@media screen and (max-width: 980px) {

    .blitz-header-cta {
        display: block;
        order: 1;
        margin: 0;
        padding: 15px 0 0;
        text-align: center;
    }

    .t456__rightwrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .t456__rightwrapper > .t456__list {
        order: 0;
    }
}

/* --- footer + floating call button --------------------------------------- */
/* The footer shipped as a fixed 70px row plus a 60px bottom pad — 130px tall for
   ~40px of text, with the empty band swallowing the floating call button. The row is
   now content-height (the inline height and pad were dropped from the markup) and the
   spacing comes from here. */
.t389__maincontainer {
    /* the stylesheet's own default is a fixed 80px row */
    height: auto;
    padding: 18px 0;
}

/* Contact under the copyright, tight against it — the block used to separate the two
   with a pair of <br>, which cost a whole blank line. */
.blitz-footer__mail {
    display: inline-block;
    margin-top: 2px;
}

/* The call button stays in its corner and only steps up when the footer scrolls into
   view — blitz-switcher.js sets --blitz-call-lift to however much of the footer is on
   screen. Parking it high permanently would leave it floating mid-edge on the first
   screen, which is where this started. */
.t651 .t651__btn {
    bottom: calc(30px + var(--blitz-call-lift, 0px));
    transition: bottom .18s ease-out;
}

@media screen and (max-width: 960px) {

    /* the widget's own mobile rule pins it 10px off the bottom with !important */
    .t651 .t651__btn {
        bottom: calc(16px + var(--blitz-call-lift, 0px)) !important;
    }
}

@media (prefers-reduced-motion: reduce) {

    .t651 .t651__btn {
        transition: none;
    }
}
