.form-response-output {
    position: relative;
    z-index: 9;
    display: none !important;
}

.form__btn {
    border: 0 !important;
}

.form input:not(.form-btn) {
    margin-bottom: 0;
}

.form label {
    margin-bottom: 23px;
    display: block;
}

.form__inputs {
    margin-bottom: 0;
}

.employee-detail-page .modals .swiper-inner {
    display: none !important;
}

.employee-detail-page .fp-arrow,
.employee-detail-page .fp-prev,
.employee-detail-page .fp-next {
    display: none !important;
}

.employee-detail-page .employee-swiper,
.employee-detail-page .employee .swiper-wrapper,
.employee-detail-page .employee .swiper-slide {
    height: auto !important;
    overflow: visible !important;
}

.contacts + .modals > .swiper-inner,
.contacts-page + .modals > .swiper-inner {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

@media (min-width: 770px) {
    .employee-detail-page .contacts-page .link {
        display: none !important;
    }

    .team-section + .contacts-page .link {
        display: none !important;
    }
}

@media (min-width: 1025px) {
    .employee-detail-page .employee__inner {
        min-height: 730px;
    }
}

@media (min-width: 1025px) and (hover: hover) {
    .description__inner:last-child {
        margin-bottom: 50px;
    }
}

.team.section .team__wrap .swiper-inner {
    display: none !important;
}

/* Do not let the transparent search wrapper block the Contacts nav item. */
.fixed .search,
.header__search.search {
    pointer-events: none;
}

.fixed .search form,
.fixed .search input,
.fixed .search button,
.header__search.search form,
.header__search.search input,
.header__search.search button {
    pointer-events: auto;
}

@media (min-width: 1026px) {
    .header__menu,
    .fixed__nav {
        position: relative;
        z-index: 3;
    }

    .header__search.search,
    .fixed .search {
        position: relative;
        z-index: 1;
        margin-left: 24px;
    }
}

@media (max-width: 1025px), (hover: none) {
    .form__inputs {
        gap: 0;
    }

    .contacts__map,
    .contacts__dot,
    .contacts__dot-inner,
    .contacts__dot-title,
    .contacts__dot-toggle {
        pointer-events: auto;
    }

    .contacts__dot {
        cursor: pointer;
        touch-action: manipulation;
    }

    .contacts__slider:not(.active) .swiper-inner {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .contacts__slider.active .swiper-inner {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}


/* Мобильная версия страницы сотрудника */
@media (max-width: 769px) {
    .employee-swiper {
        touch-action: pan-y;
    }

    .employee__wrapper .swiper-inner {
        pointer-events: auto !important;
        position: relative;
        z-index: 50;
    }

    .employee__item {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .employee__title,
    .employee__subtitle {
        padding-right: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .employee__title {
        margin-bottom: 12px !important;
        line-height: 1.2;
    }

    .employee__subtitle {
        margin-bottom: 24px !important;
        color: var(--color-orange);
    }

    .employee__contacts {
        margin-bottom: 32px !important;
        padding: 0 !important;
    }

    .employee__contacts li {
        margin-bottom: 16px !important;
    }

    .employee__inner p {
        margin-bottom: 20px !important;
        line-height: 1.6 !important;
    }

    .employee__wrapper .swiper-inner {
        position: relative !important;
        margin: 8px 0 24px !important;
        padding-top: 0 !important;
        border-top: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        pointer-events: auto !important;
        height: auto !important;
        inset: auto !important;
    }

    .employee__next-name {
        margin-left: 0 !important;
        font-size: 14px !important;
        white-space: normal !important;
        line-height: 1.3;
    }

    .employee .swiper-button-prev,
    .employee .swiper-button-next {
        position: static !important;
        transform: none !important;
        margin: 0 !important;
    }

    .employee__img-mobile {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        max-width: 315px !important;
        margin: 0 auto 24px !important;
        height: auto !important;
        overflow: hidden !important;
    }

    .employee__img-mobile img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        object-position: center bottom !important;
        display: block !important;
        border-radius: 4px;
    }

    .employee__img-mobile::before {
        position: absolute;
        content: '';
        left: 0;
        right: 0;
        bottom: 0;
        height: 100px;
        background: linear-gradient(181deg, rgba(2, 11, 43, 0) 15%, var(--color-dark-blue) 85%);
        display: block !important;
        pointer-events: none;
        z-index: 2;
    }
}

/* Фильтры на мобильных */
@media (max-width: 769px) {
    .team-section__inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 32px;
    }

    /* Search field in same grid flow as dropdowns */
    .team-section__inner .team-section__search {
        width: 100% !important;
        margin-top: 0;
    }

    .select {
        width: 100% !important;
    }

    .select__content {
        max-height: 300px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1000 !important;
        background: var(--color-dark-blue) !important;
        border: 1px solid rgba(255,255,255,0.1);
    }

    .team-section__clear {
        grid-column: 1 / -1;
        justify-content: center;
        display: none;
    }

    .team-section__clear.visible {
        display: flex !important;
    }
}



/* === Team Page: 2 flex rows + looped arrow navigation === */

.team-page-rows {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: visible;
    padding-top: 20px;
    padding-left: 80px;
    padding-right: 80px;
    box-sizing: border-box;
    margin-top: -20px;
}

/* Row: flex container, only current page cards shown via JS display:none */
.team-page-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 20px;
    overflow: hidden;
    width: 100%;
}

/* Cards fill row evenly — 4 per view on desktop, 2 on mobile */
.team-page-row .team-section__item {
    flex: 0 0 calc(50% - 10px);  /* mobile: 2 cards */
    min-width: 0;
    height: 477px;
    overflow: hidden;
    position: relative;
    transition: flex-basis 0.6s ease, opacity 0.22s ease;
}

.team-page-row .team-section__item.is-hidden {
    pointer-events: none;
}

@media (min-width: 1025px) {
    .team-page-row {
        --team-card-photo-height: 339px;
    }

    .team-page-row .team-section__item {
        flex: 0 0 calc(25% - 15px);  /* desktop: 4 cards */
        height: auto;
    }

    .team-page-row .team-section__item-inner {
        height: auto;
    }
}

/* Mobile: shorter cards */
@media (max-width: 1024px) {
    .team-page-rows {
        touch-action: pan-y;
    }

    .team-page-row .team-section__item {
        height: auto;
    }

    /* Photo height = card width × 4/3 (portrait ratio).
       Card width ≈ (100vw - 32px padding - 20px gap) / 2 */
    .team-page-row .team-section__img {
        flex: 0 0 calc((100vw - 52px) / 2 * 4 / 3);
        height: calc((100vw - 52px) / 2 * 4 / 3);
    }
}

/* Photo fills the card, name/position below */
.team-page-row .team-section__img {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: unset;
    aspect-ratio: unset;
    margin-bottom: 0;
    overflow: hidden;
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

@media (min-width: 1025px) {
    .team-page-row .team-section__img {
        display: block;
        flex: 0 0 var(--team-card-photo-height);
        height: var(--team-card-photo-height);
        position: relative;
    }

    .team-page-row .team-section__img img {
        width: 100%;
        height: 100%;
        max-width: none;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        transition: left 0.5s ease, transform 0.5s ease;
    }
}

.team-page-row .team-section__img img {
    display: block;
    height: 100%;
    width: auto;
    max-width: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center bottom;
    position: static;
    left: auto;
    top: auto;
    transform: none;
    transition: none;
}

@media (min-width: 1025px) {
    .team-page-row .team-section__img img {
        width: 100%;
        max-width: none;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        transition: left 0.5s ease, width 0.5s ease;
    }
}

/* Info block at bottom */
.team-page-row .team-section__item-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: background 0.5s ease-in-out;
}

.team-page-row .team-section__info {
    flex-shrink: 0;
    padding: 12px 0 0;
}

/* Team items container: needs relative + visible for side arrows */
.team-section__filters-form {
    margin: 0 0 40px;
}

.team-section__items {
    position: relative;
    overflow: visible;
}

.team-section__items:has(.team-section__empty) .team-page-rows,
.team-section__items:has(.team-section__empty) .team-page-nav {
    display: none;
}

.team-section__empty {
    padding: 48px 0 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 18px;
    line-height: 1.5;
}

/* Navigation buttons — absolute on sides, outside card area */
.team-page-nav {
    position: absolute;
    top: 20px; /* offset for rows padding-top */
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
    z-index: 6;
}

.team-page-nav .swiper-button-prev,
.team-page-nav .swiper-button-next {
    pointer-events: auto;
    position: relative;
    margin: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.5s;
}

.team-page-nav .swiper-button-prev {
    margin-left: 12px;
}

.team-page-nav .swiper-button-next {
    margin-right: 12px;
}

.team-page-nav .swiper-button-prev::before,
.team-page-nav .swiper-button-next::before {
    position: absolute;
    content: '';
    width: 40px;
    height: 40px;
    background: url('../img/arrow.svg') center center/cover no-repeat;
    border-radius: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(180deg);
}

.team-page-nav .swiper-button-next::before {
    transform: translate(-50%, -50%);
}

.team-page-nav .swiper-button-prev:hover,
.team-page-nav .swiper-button-next:hover {
    background: var(--color-orange);
}

.team-page-nav .swiper-button-prev:hover::before,
.team-page-nav .swiper-button-next:hover::before {
    filter: none;
}

.team-page-nav .swiper-button-disabled {
    background: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

@media (max-width: 769px) {
    .team-section__filters-form {
        margin-bottom: 32px;
    }

    .team-page-rows {
        padding-left: 0;
        padding-right: 0;
    }

    .team-page-nav {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        width: 128px;
        margin: 24px auto 0;
        pointer-events: auto;
    }
}

@media (max-width: 600px) {
    .team-page-nav {
        width: 102px;
        margin-top: 20px;
    }

    .team-page-nav .swiper-button-prev,
    .team-page-nav .swiper-button-next {
        width: 45px;
        height: 45px;
    }

    .team-page-nav .swiper-button-prev::before,
    .team-page-nav .swiper-button-next::before {
        width: 33px;
        height: 33px;
    }
}

/* Desktop: arrows on sides of card grid */
/* Hover: card glow on activation, no sibling deformation */
@media (min-width: 1025px) and (hover: hover) {

    .team-page-row {
        overflow: visible;
    }

    /* Active card expands; shrink siblings compress — everything stays in view */
    .team-page-row .team-section__item.active {
        border-radius: 8px;
        flex-basis: calc((100% - 60px) * 0.37);
        overflow: visible;
        z-index: 5;
    }

    .team-page-row .team-section__item.shrink {
        flex-basis: calc((100% - 60px) * 0.21);
    }

    .team-page-row .team-section__item.active .team-section__item-inner {
        overflow: visible;
    }

    .team-page-row .team-section__item.active .team-section__img {
        display: block;
        background: linear-gradient(90deg, #101d49 0%, #152764 100%);
        border-color: rgba(252, 89, 30, 0.65);
        box-shadow: 0 0 12px 3px var(--color-orange);
        flex: 0 0 var(--team-card-photo-height);
        height: var(--team-card-photo-height);
    }

    .team-page-row .team-section__item.active .team-section__img img {
        width: 67.57%;
        max-width: none;
        margin: 0;
        height: 100%;
        object-fit: contain;
        object-position: center bottom;
        position: relative;
        left: 50%;
        top: auto;
        transform: translateX(-50%);
    }

    .team-page-row .team-section__item.active-start .team-section__img img {
        left: 50%;
    }

    .team-page-row .team-section__item.active.active-end .team-section__img img {
        left: 50%;
    }

    .team-page-row .team-section__item.active .team-section__hidden {
        opacity: 1;
        visibility: visible;
        height: 100%;
    }

    .team-page-row .team-section__mail {
        bottom: 24px;
        left: 12px;
        right: 12px;
        width: auto;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0s linear 0.22s;
    }

    .team-page-row-bot .team-section__mail {
        bottom: 32px;
    }

    .team-page-row .team-section__item.active .team-section__mail {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-duration: 0.1s, 0s;
        transition-delay: 0.24s, 0s;
    }

    .team-page-row .team-section__item.active .team-section__mail a {
        font-size: 12px;
        line-height: 1.25;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .team-page-row .team-section__item.active .team-section__text {
        display: block;
    }
}
