/* Scoped under .oilgaz-inquiry-* so it does not collide with the
   art-design / lk template button styles. */

.oilgaz-inquiry-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #d23030;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease;
}
.oilgaz-inquiry-btn:hover,
.oilgaz-inquiry-btn:focus {
    background: #b62828;
    outline: none;
}
.oilgaz-inquiry-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(210, 48, 48, 0.35);
}
.oilgaz-inquiry-btn[disabled] {
    background: #999;
    cursor: not-allowed;
}

/* Standalone "Связаться с компанией" CTA at the top of news.detail
   pages (equipment-detail, technology-detail, customers-detail, etc.)
   is hidden everywhere — operators contact suppliers through the
   per-row buttons in the providers list instead. The wrapper class
   may still leak into the DOM from cached parent component output;
   hide it unconditionally so stale cache entries can't resurrect
   the button after we removed the IncludeComponent call. */
.equipment-detail__inquiry-action,
.technology-detail__inquiry-action,
.customers-detail__inquiry-action,
.innovation-detail__inquiry-action,
.programm-detail__inquiry-action,
.client-detail__inquiry-action,
.material-detail__inquiry-action {
    display: none !important;
}

/* --- Modal --- */
.oilgaz-inquiry-modal[hidden] { display: none; }

/* z-index has to clear the site's fixed header (z-index:30 today) AND
   any third-party widgets that ship at z-index:9999. The site doesn't
   define a stacking-context-creating ancestor for the modal in the
   public templates, so a single very high value keeps it above
   anything in the chrome without forcing a CSS variable contract. */
.oilgaz-inquiry-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto; /* let the viewport scroll the modal itself when
                         the panel is taller than the visible area */
}
.oilgaz-inquiry-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 28, 0.62);
    /* fixed (not absolute) so the backdrop fully covers the viewport
       even when the modal container itself starts to scroll. */
}

/* Apply on <html> when the modal is open. <body>-only overflow:hidden
   is unreliable on layouts that scroll on the html element (this site
   does); locking both is the safe choice. */
html.oilgaz-inquiry-modal-open,
html.oilgaz-inquiry-modal-open body {
    overflow: hidden !important;
}
.oilgaz-inquiry-modal__panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    /* Panel itself no longer scrolls — scrolling is delegated to
       `__panel-scroll`. Keeping overflow:hidden here so the scroll
       hints can be absolute-positioned children of `__panel` without
       being dragged by scroll, and so the panel's rounded corners
       still clip inner content. */
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}
.oilgaz-inquiry-modal__panel-scroll {
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px 32px 24px;
    box-sizing: border-box;
    /* Hide the native scrollbar — the up/down chevrons in the panel
       are the only scroll affordance the spec calls for. The element
       still scrolls, both via wheel/touch and programmatically;
       nothing here disables the scroll behavior itself. */
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE / legacy Edge */
}
.oilgaz-inquiry-modal__panel-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;     /* Chrome / Safari */
}

/* --- Scroll-direction hints ---
   Floating chevrons that appear at the top and bottom edges of the
   panel when more content exists in that direction. Sit on top of the
   scrolling content via z-index but never block clicks/scroll thanks
   to pointer-events:none. JS toggles `is-scrollable-up`/`-down` on
   the panel; both classes can be active simultaneously when content
   is taller than the panel and the user has scrolled into the middle. */
.oilgaz-inquiry-modal__scroll-hint {
    position: absolute;
    left: 0;
    right: 0;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: 16px;
    color: #1f3a68;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 140ms ease;
}
.oilgaz-inquiry-modal__scroll-hint--up {
    top: 0;
    /* fade the chevron over a soft white-to-transparent gradient so
       it doesn't visually clash with the form labels behind it */
    background: linear-gradient(to bottom, rgba(255,255,255,0.96) 40%, rgba(255,255,255,0));
    border-radius: 8px 8px 0 0;
}
.oilgaz-inquiry-modal__scroll-hint--down {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.96) 40%, rgba(255,255,255,0));
    border-radius: 0 0 8px 8px;
}
.oilgaz-inquiry-modal__panel.is-scrollable-up .oilgaz-inquiry-modal__scroll-hint--up,
.oilgaz-inquiry-modal__panel.is-scrollable-down .oilgaz-inquiry-modal__scroll-hint--down {
    opacity: 1;
}
.oilgaz-inquiry-modal__close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    /* 44×44 hits the iOS / Material tap-target minimum so the close
       control is reliably reachable on touch devices. */
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.oilgaz-inquiry-modal__close:hover { color: #444; }
.oilgaz-inquiry-modal__close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 58, 104, 0.25);
    border-radius: 4px;
}

.oilgaz-inquiry-modal__header { margin-bottom: 18px; }
.oilgaz-inquiry-modal__title {
    font-size: 22px;
    line-height: 1.25;
    margin: 0 0 4px;
    color: #1f3a68;
    font-weight: 700;
}
.oilgaz-inquiry-modal__supplier {
    font-size: 14px;
    margin: 6px 0 0;
    color: #1f3a68;
    font-weight: 600;
}
.oilgaz-inquiry-modal__product {
    font-size: 13px;
    margin: 4px 0 0;
    color: #4a5562;
}

/* --- Form --- */
.oilgaz-inquiry-form { display: block; }
.oilgaz-inquiry-form__row { margin-bottom: 14px; }
.oilgaz-inquiry-form__label {
    display: block;
    font-size: 13px;
    color: #1f3a68;
    margin-bottom: 6px;
    font-weight: 700;
}
.oilgaz-inquiry-form__req { color: #e92525; margin-left: 2px; }
.oilgaz-inquiry-form__input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d6dde6;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    color: #1a1d21;
    background: #fff;
    box-sizing: border-box;
}
.oilgaz-inquiry-form__input::placeholder {
    color: #9aa3b0;
    opacity: 1;
}
.oilgaz-inquiry-form__input:focus {
    border-color: #1f3a68;
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 58, 104, 0.18);
}
.oilgaz-inquiry-form__textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.45;
}
.oilgaz-inquiry-form__error {
    display: block;
    color: #c0392b;
    font-size: 12px;
    line-height: 1.2;
    margin-top: 4px;
}
/* Collapse the error slot when empty so it does not permanently
   reserve ~14px under every field — that previously bloated the form
   even when there were no errors. The slot is filled by the JS
   validators and grows back to its single-line height of ~14px when
   an error appears. Setting margin: 0 prevents the 4px margin-top
   from leaving a phantom gap below the input in the empty state. */
.oilgaz-inquiry-form__error:empty {
    display: none;
    margin: 0;
}
.oilgaz-inquiry-form__row--has-error .oilgaz-inquiry-form__input,
.oilgaz-inquiry-form__row--has-error .oilgaz-inquiry-form__drop {
    border-color: #c0392b;
}
.oilgaz-inquiry-form__row--has-error .oilgaz-inquiry-form__label {
    color: #c0392b;
}

/* --- Drag-drop file area ---
   Per the spec the file row has three pieces stacked above the drop
   target: a bold label, a single muted hint line, and the drop area
   itself. Inside the drop area the paperclip icon + "Прикрепить файл"
   render as a centered link-style row, with "или перетащите файл сюда"
   in muted gray below it. */
.oilgaz-inquiry-form__file-hint {
    display: block;
    font-size: 12px;
    color: #8b95a3;
    margin: -4px 0 8px;
    line-height: 1.4;
}
.oilgaz-inquiry-form__drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 18px 16px;
    border: 1.5px dashed #cfd4db;
    border-radius: 8px;
    background: #fff;
    color: #4a5562;
    text-align: center;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
    box-sizing: border-box;
}
.oilgaz-inquiry-form__drop:hover {
    border-color: #1d8afa;
    background: #f4f9ff;
}
.oilgaz-inquiry-form__drop--active {
    border-color: #1d8afa;
    background: #e8f2ff;
}
.oilgaz-inquiry-form__drop--has-file {
    border-style: solid;
    border-color: #1d8afa;
    background: #f4f9ff;
    color: #1f3a68;
}
/* When a file is attached, the chosen filename takes the place of
   the "Прикрепить файл" link text. The "or drop a file here" hint
   would be misleading at that point, so hide it; the inline clear
   button takes its slot below the filename. */
.oilgaz-inquiry-form__drop--has-file .oilgaz-inquiry-form__drop-or {
    display: none;
}
.oilgaz-inquiry-form__drop--has-file .oilgaz-inquiry-form__drop-text {
    color: #1f3a68;
}
.oilgaz-inquiry-form__drop-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1d8afa;
    font-weight: 600;
}
.oilgaz-inquiry-form__drop-icon {
    display: inline-flex;
    align-items: center;
    color: #1d8afa;
}
.oilgaz-inquiry-form__drop-text {
    font-size: 14px;
    font-weight: 600;
    color: #1d8afa;
    word-break: break-word;
}
.oilgaz-inquiry-form__drop-or {
    display: block;
    font-size: 12px;
    color: #8b95a3;
}
.oilgaz-inquiry-form__drop-clear {
    margin-top: 4px;
    background: transparent;
    border: 0;
    color: #c0392b;
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}
.oilgaz-inquiry-form__file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* JS-managed per-file list. Rendered below the drop area; one <li> per
   attached file with filename + × remove button. Empty (no files) state
   is rendered as an empty <ul> with zero height and zero margin so the
   form layout collapses cleanly. */
.oilgaz-inquiry-form__file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.oilgaz-inquiry-form__file-list:empty {
    margin: 0;
}
.oilgaz-inquiry-form__file-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid #d6dde6;
    border-radius: 6px;
    margin-top: 6px;
    background: #fff;
    font-size: 13px;
    color: #1f3a68;
}
.oilgaz-inquiry-form__file-list-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Keep the × glyph visually distinct — small padding-right gives the
       remove button room without forcing a wide gap. */
    padding-right: 10px;
}
.oilgaz-inquiry-form__file-list-remove {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: #c0392b;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: background-color 120ms ease, color 120ms ease;
}
.oilgaz-inquiry-form__file-list-remove:hover,
.oilgaz-inquiry-form__file-list-remove:focus {
    background: #fef2f2;
    color: #991b1b;
    outline: none;
}
.oilgaz-inquiry-form__file-list-remove:focus-visible {
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.35);
}

/* --- Feedback / banner --- */
.oilgaz-inquiry-form__feedback {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
}
.oilgaz-inquiry-form__feedback--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

/* --- Submit / consent --- */
/* Cloudflare Turnstile slot: the widget is a fixed ~300x65px card, so
   center it in the form column; light theme is forced in script.js.
   min-height reserves the widget's height so the slot can NEVER collapse to
   nothing — if a managed challenge is briefly emptied (during a re-render
   after a failed/expired verification) the space is held and the fresh
   widget renders straight back into it instead of vanishing. */
.oilgaz-inquiry-form__turnstile {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
    min-height: 65px;
}

.oilgaz-inquiry-form__actions {
    margin-top: 18px;
}
.oilgaz-inquiry-form__btn {
    padding: 12px 20px;
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
}
.oilgaz-inquiry-form__btn--primary {
    display: block;
    width: 100%;
    background: #1f3a68;
    color: #fff;
    font-size: 15px;
    padding: 14px 20px;
    border-radius: 8px;
    transition: background-color 120ms ease;
}
.oilgaz-inquiry-form__btn--primary:hover { background: #15294a; }
.oilgaz-inquiry-form__btn--primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 58, 104, 0.35);
}
.oilgaz-inquiry-form__btn--primary[disabled] { background: #6b7892; cursor: not-allowed; }

.oilgaz-inquiry-form__consent {
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}
.oilgaz-inquiry-form__consent-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8b95a3;
    margin-top: 1px;
}
.oilgaz-inquiry-form__consent-text { flex: 1 1 auto; }
.oilgaz-inquiry-form__consent-link {
    color: #1d8afa;
    font-weight: 600;
    text-decoration: none;
}
.oilgaz-inquiry-form__consent-link:hover { text-decoration: underline; }

/* Honeypot — visually hidden but still part of the DOM. */
.oilgaz-inquiry-form__hp {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* --- Success state ---
   Matches spec рис. 6: green circle-with-check icon, headline, body line,
   supplier card, close button. The SVG itself is plain stroke-on-current
   — color the wrapper, not the path, so the same icon survives theming. */
.oilgaz-inquiry-modal__success {
    text-align: center;
    padding: 8px 0;
}
.oilgaz-inquiry-modal__success-icon {
    color: #16a34a;
    display: block;
    margin: 8px auto 18px;
}
.oilgaz-inquiry-modal__success-title {
    color: #1a1d21;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 10px;
}
.oilgaz-inquiry-modal__success-body {
    margin: 0 0 18px;
    color: #4a4f57;
}
.oilgaz-inquiry-modal__success-supplier {
    /* Card sits below the reassurance line; only renders when JS has
       resolved a supplier name. Border-top + light bg matches the spec
       screenshot's quiet card; no shadow since it lives inside the modal
       panel which already has elevation. */
    margin: 0 auto 18px;
    padding: 12px 16px 14px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.oilgaz-inquiry-modal__success-supplier-name {
    color: #2563eb;
    font-weight: 600;
}
.oilgaz-inquiry-modal__success-supplier-meta {
    color: #6b7280;
    font-size: 13px;
}
.oilgaz-inquiry-modal__success-supplier[hidden] { display: none; }

/* --- Short-viewport compaction ---
   QA flagged that at ~800×950 the modal exceeds the available height
   and the user can't see fields above ФИО (the on-page focus()
   auto-scrolled the panel down). Two-part fix: trim vertical spacing
   here, and defer the scrollTop=0 reset on open until after focus()
   side-effects (see script.js openModal). Numbers picked to keep the
   form rendering legible at 16px input font + 18px line-height —
   nothing here changes input font sizing, only the spacing chrome. */
@media (max-height: 980px) {
    .oilgaz-inquiry-modal__panel-scroll {
        padding: 18px 28px 16px;
    }
    .oilgaz-inquiry-modal__header { margin-bottom: 10px; }
    .oilgaz-inquiry-modal__title  { font-size: 19px; }
    .oilgaz-inquiry-form__row     { margin-bottom: 10px; }
    .oilgaz-inquiry-form__textarea { min-height: 72px; }
    .oilgaz-inquiry-form__actions { margin-top: 12px; }
}

@media (max-width: 600px) {
    /* Container provides the side gutter so the panel can be a clean
       width: 100% inside it — using `margin` on a flex item with
       width:100% overflowed the viewport horizontally. Anchoring the
       modal to the top (instead of center) keeps the form header
       visible when the on-screen keyboard pushes the layout. */
    .oilgaz-inquiry-modal {
        align-items: flex-start;
        padding: 12px;
    }
    .oilgaz-inquiry-modal__panel {
        max-width: 100%;
        max-height: calc(100vh - 24px);
        margin: 0;
        border-radius: 6px;
    }
    .oilgaz-inquiry-modal__panel-scroll {
        max-height: calc(100vh - 24px);
        padding: 20px 16px 18px;
    }
    .oilgaz-inquiry-modal__title { font-size: 19px; }

    /* Inputs at <16px trigger Safari's auto-zoom on focus, which
       displaces the layout and is hard to recover from. 16px is the
       documented threshold to opt out. */
    .oilgaz-inquiry-form__input {
        font-size: 16px;
        padding: 11px 12px;
    }
    .oilgaz-inquiry-form__textarea { min-height: 96px; }

    .oilgaz-inquiry-form__drop      { padding: 16px 12px; }
    .oilgaz-inquiry-form__drop-text { font-size: 13.5px; }
    .oilgaz-inquiry-form__drop-or   { font-size: 11.5px; }
    .oilgaz-inquiry-form__file-hint { font-size: 11.5px; }

    .oilgaz-inquiry-form__btn--primary {
        font-size: 15px;
        padding: 14px 16px;
    }
    .oilgaz-inquiry-form__consent { font-size: 11px; }

    /* Trigger button: ensure tappable height even when the host page
       template scales the surrounding row/column down. */
    .oilgaz-inquiry-btn {
        min-height: 44px;
        padding: 11px 18px;
    }
}

/* --- Providers anchor CTA (spec рис. 7/8/9) ------------------------------
   "Связаться с поставщиками →" arrow link at the top of a product detail
   page. Anchors to the providers section below; only rendered when the
   product has at least one linked supplier (the detail template's
   $hasProviders check). Smooth scroll lands the user on the providers
   block past the fixed header offset. */
.oilgaz-providers-cta {
    /* Spec рис. 8 layout: H1 takes the full width of the header block
       and wraps naturally. Below the title, a 2-column row places the
       classification number on the LEFT and the CTA column on the
       RIGHT. The CTA column itself is a vertical stack: chip «Есть
       поставщики» on top (aligned with the number row), blue button
       below. The grid layout is applied by the
       :has(.oilgaz-providers-cta) rules further down — this base rule
       just makes the CTA an inline flex column. On templates without a
       position:relative __header-block (equipment, programms) the CTA
       falls back to flowing inline via .oilgaz-providers-cta-flow. */
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.oilgaz-providers-cta__hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4a4f57;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}
.oilgaz-providers-cta__hint-icon {
    flex: 0 0 18px;
    color: #6b7280;
}
.oilgaz-providers-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    transition: background-color 120ms ease, transform 120ms ease;
}
.oilgaz-providers-cta:hover .oilgaz-providers-cta__btn {
    background: #1d4ed8;
}
.oilgaz-providers-cta:hover .oilgaz-providers-cta__btn-arrow {
    transform: translateX(2px);
}
.oilgaz-providers-cta__btn-arrow {
    transition: transform 120ms ease;
}

/* Inline-flow variant for templates whose header isn't a positioned
   block. Sits on its own row, right-aligned, sized to its content. */
.oilgaz-providers-cta-flow {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: -8px 70px 24px;
}
.oilgaz-providers-cta-flow .oilgaz-providers-cta {
    position: static;
    transform: none;
    right: auto;
    top: auto;
}

/* рис. 8 layout (2-row grid + 1 absolute button):
   row 1: H1 spans both cols
   row 2: classification number (left)   |   chip «Есть поставщики» (right)
   button: position:absolute, bottom:0 of __header-block, translateY(50%)
           — vertical center sits ON the bottom-edge underline divider.

   The <a class="oilgaz-providers-cta"> wrapper is rendered layout-
   transparent (display:contents) so its children — chip and button —
   become direct grid items / positioned elements of __header-block.
   Click semantics still work: any click on chip or button bubbles up
   to the <a> and triggers the anchor scroll.

   When there are no providers (рис. 7) the chip isn't rendered at all
   — the button is the only CTA element, still pinned at bottom-right
   over the underline level. */
/* Header block becomes the positioning anchor for the chip+button stack.
   Reserve just enough bottom padding to clear the absolutely-positioned
   CTA stack (chip on top, button below, anchored at right/bottom with
   translateY(24px)). Stack height is ~78px (chip 30 + gap 8 + button 40),
   shifted down 24px — so the chip top sits 54px above the header-block
   bottom edge. 60px padding clears that with a small margin while
   avoiding the giant empty band the old 100px value was leaving inside
   the header on technology / projects / customers pages. */
.technology-detail__header-block:has(.oilgaz-providers-cta),
.innovations-detail__header-block:has(.oilgaz-providers-cta),
.projects-detail__header-block:has(.oilgaz-providers-cta),
.customers-detail__header-block:has(.oilgaz-providers-cta),
.oilgaz-cta-header-block:has(.oilgaz-providers-cta) {
    position: relative;
    padding-bottom: 60px;
    /* QA flagged the CTA button visually touching the first
       paragraph of the article description because the button is
       translateY(24px)'d below the header-block bottom edge while
       .article-content-snippet starts right at that edge. 40px
       margin-bottom on the header-block clears the 24px translate
       overflow + adds ~16px breathing room before the article. */
    /* QA slide C wanted a small, deliberate gap between the CTA
       button bottom and the first paragraph of the article — not
       a huge band. 56px on the header-block leaves ~32px of clean
       whitespace below the button (after subtracting the button's
       translateY(24px) overflow), matching the slide's green-box
       reference. */
    margin-bottom: 56px;
}
/* On equipment/programms the <a> CTA is wrapped in
   .oilgaz-providers-cta-flow as a flow-after-H1+number row; neutralize
   that wrapper so the inner <a> can position itself directly. */
.oilgaz-cta-header-block .oilgaz-providers-cta-flow {
    display: block;
    margin: 0;
}
/* The actual <a class="oilgaz-providers-cta">: absolutely positioned
   at the bottom-right corner of the header block, vertically extending
   upward as a flex column with chip on top and button below.
   translateY(50%) drops the whole stack so the button's vertical
   center sits on the underline-divider level (рис. 8). */
.technology-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
.innovations-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
.projects-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
.customers-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
.oilgaz-cta-header-block .oilgaz-providers-cta-flow .oilgaz-providers-cta {
    position: absolute;
    right: 70px;
    bottom: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    z-index: 1;
}
/* Push the absolute stack down by half its height so the button center
   sits on the bottom edge of the header block (matching the underline
   divider on technologies/innovations/projects/customers). */
.technology-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
.innovations-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
.projects-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
.customers-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta {
    transform: translateY(24px);
}
/* Equipment / programms wrapper needs bottom padding so the absolute
   CTA stack doesn't collide with the body content below. Same 60px
   budget as the technology/projects/customers header-block rule;
   40px margin-bottom mirrors the same spacing fix the inline-flow
   variant gets on the dev-flagged QA slide. */
.oilgaz-cta-header-block {
    padding-bottom: 60px;
    /* QA slide C wanted a small, deliberate gap between the CTA
       button bottom and the first paragraph of the article — not
       a huge band. 56px on the header-block leaves ~32px of clean
       whitespace below the button (after subtracting the button's
       translateY(24px) overflow), matching the slide's green-box
       reference. */
    margin-bottom: 56px;
    position: relative;
}
/* The CTA stack (chip + button) sits in the bottom-right corner
   via `position:absolute; right:70px; bottom:0`. When the long
   classification number sits just above the stack vertically,
   the chip «Есть поставщики» visually crowds the number's last
   characters (QA: MP.07.01.01.01.01.01.01-001.712). Push the
   whole stack down by `translateY(40px)` so the chip ends up
   BELOW the number's bottom edge instead of beside it; the
   button shifts with it and lands further from the header
   block's bottom edge. Bumped the wrapper's bottom padding so
   the article body below still gets the same clearance. */
.oilgaz-cta-header-block {
    /* Extra room at the bottom to absorb the translated CTA
       stack without it visually colliding with the body text
       that starts right under the header block. */
    padding-bottom: 100px;
}
.oilgaz-cta-header-block .oilgaz-providers-cta-flow .oilgaz-providers-cta {
    transform: translateY(40px);
}

/* The legacy fixedBlock() in custom.js toggles a .fixed class on
   .new-fixed-block as the user scrolls, which makes the right column
   become `position: fixed; top: 64px; max-height: 90vh; overflow-y:
   auto` — yanking it out of document flow and trapping the providers
   list inside an inner-scroll box. Lock both states (.new-fixed-block
   and .new-fixed-block.fixed) to identical in-flow values so the JS
   toggle has zero visual effect: the column stays in flow at its
   natural content height regardless of scroll position, and the
   default Bitrix `.footer { margin-top:-61px } + .content-wrapper
   { min-height:100% }` sticky-footer pattern keeps working as
   designed. Scoped via :has() to product-detail pages with the
   providers CTA so other layouts that depend on the sticky catalog
   behavior are untouched. */
/* Right column is a fixed-height (90vh) in-flow scrollable container.
   This matches production's vertical sizing (the article doesn't grow
   past viewport) while keeping the column in document flow (so the
   footer still pins below the row, not under a position:fixed
   floater). Internal overflow scrolls the article + providers +
   tiles content within the column.

   Locking BOTH `.new-fixed-block` and `.new-fixed-block.fixed` to
   identical values neutralizes the legacy fixedBlock() scroll-handler
   toggle in custom.js — the JS still adds/removes the .fixed class
   but the visual outcome is the same, so the column doesn't jump
   between two heights as the user scrolls the page.

   `scroll-padding-top` reserves 100px at the top of the inner scroll
   when the browser auto-scrolls to #providers-list-anchor, so the
   anchor lands just below the section header instead of being pinned
   to the very top of the box. */
body:has(.technology-detail__header-block .oilgaz-providers-cta) .new-fixed-block,
body:has(.innovations-detail__header-block .oilgaz-providers-cta) .new-fixed-block,
body:has(.projects-detail__header-block .oilgaz-providers-cta) .new-fixed-block,
body:has(.customers-detail__header-block .oilgaz-providers-cta) .new-fixed-block,
body:has(.oilgaz-cta-header-block .oilgaz-providers-cta) .new-fixed-block,
body:has(.technology-detail__header-block .oilgaz-providers-cta) .new-fixed-block.fixed,
body:has(.innovations-detail__header-block .oilgaz-providers-cta) .new-fixed-block.fixed,
body:has(.projects-detail__header-block .oilgaz-providers-cta) .new-fixed-block.fixed,
body:has(.customers-detail__header-block .oilgaz-providers-cta) .new-fixed-block.fixed,
body:has(.oilgaz-cta-header-block .oilgaz-providers-cta) .new-fixed-block.fixed {
    /* Keep the content column as a ~viewport-tall INTERNAL-SCROLL box (the user
       wants the block scrollable), but in NORMAL FLOW — position:static, NOT
       the legacy position:fixed. The only real bug was the footer being pinned
       (position:fixed) over the box; with the footer back in flow it sits
       directly below this scroll box and follows it. */
    position: static !important;
    top: auto !important;
    width: 100% !important;
    max-height: 90vh !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-padding-top: 16px !important;
}

/* Footer stays in normal document flow on these pages so it follows the
   bottom of the content (the user's explicit requirement). A previous
   iteration pinned it to the viewport bottom with position:fixed ("always
   visible") and reserved body padding-bottom for it — but that left the
   footer overlapping/cutting off the content above it on tall provider
   pages. Reverted: the stock Bitrix sticky-footer (.footer{margin-top:-61px}
   pulling into .page{padding-bottom:61px}) now places the footer directly
   below the content row. No body padding-bottom override and no position:
   fixed, so there is no extra gap and no floating bar. */




/* Smooth scroll to the providers anchor. Offset accounts for the site's
   fixed header (~80px) so the section title isn't pinned under the bar.
   `scrollbar-gutter: stable` reserves the vertical scrollbar's width
   even on pages short enough not to scroll — without it, expanding the
   sidebar tree (or any other height-changing interaction) crosses the
   viewport-height threshold and the scrollbar pops in/out, shifting the
   whole content column by ~15px and producing the jump the user keeps
   seeing on /technologies/.../ pages. */
#providers-list-anchor {
    display: block;
    scroll-margin-top: 100px;
}
html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    overflow-y: scroll; /* fallback for browsers without scrollbar-gutter */
}

@media (max-width: 900px) {
    /* On narrow viewports drop the grid and stack everything block-style.
       The <a> wrapper becomes a normal flex container again so chip and
       button render under each other below the number row. */
    .technology-detail__header-block:has(.oilgaz-providers-cta),
    .innovations-detail__header-block:has(.oilgaz-providers-cta),
    .projects-detail__header-block:has(.oilgaz-providers-cta),
    .customers-detail__header-block:has(.oilgaz-providers-cta) {
        display: block;
    }
    .technology-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
    .innovations-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
    .projects-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta,
    .customers-detail__header-block:has(.oilgaz-providers-cta) > .oilgaz-providers-cta {
        display: inline-flex;
        margin: 12px 0 8px;
        align-items: flex-start;
    }
    .oilgaz-providers-cta-flow {
        margin: 8px 20px 16px;
    }
}
