/* --- ОСНОВНАЯ СЕКЦИЯ --- */
.trainers-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 700px;
    color: var(--color-light);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    display: flex;
}

.trainers-section__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

/* --- СОСТОЯНИЕ 1: ИНТРО (Во весь экран) --- */
.trainers-intro {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 120px 0 60px;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.js-trainers-section.grid-active .trainers-intro {
    opacity: 0;
    visibility: hidden;
}

.trainers-intro__inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.trainers-intro__header {
    text-align: center;
}

.trainers-intro__title {
    font-size: clamp(2.5rem, 4vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.trainers-intro__subtitle {
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
}

.trainers-intro__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.trainers-intro__text-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Стили для кнопки на главном экране */
.trainers-intro .js-btn-show-trainers {
    background-color: var(--color-primary);
    color: var(--color-light);
    border: none;
}

.trainers-intro .js-btn-show-trainers:hover {
    background-color: #2c3345;
}

/* --- СОСТОЯНИЕ 2: СЕТКА (Выезжает поверх) --- */
.trainers-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: 5;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.js-trainers-section.grid-active .trainers-grid {
    transform: translateY(0);
}

.trainers-grid__container {
    padding: 4rem var(--container-padding);
    position: relative;
    min-height: 100%;
}

.trainers-grid__close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--color-light);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}

.trainers-grid__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.trainers-grid__close::before {
    content: '✕';
}

.trainers-grid__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 2rem;
}

/* --- КАРТОЧКА ТРЕНЕРА (СВЕТЛАЯ) --- */
.trainer-card {
    width: 100%;
    max-width: 320px;
    background-color: var(--color-light);
    color: var(--color-primary);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border: none;
}

.trainer-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.3);
}

.trainer-card__photo-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.trainer-card__photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Бейдж и иконка ТГ */
.trainer-card__top-badge {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background-color: var(--color-accent);
    color: var(--color-light);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 8px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(200, 59, 59, 0.3);
}

.trainer-card__tg-link {
    position: absolute;
    top: 1.2rem;
    right: 4.5rem;
    background-color: var(--color-primary);
    color: var(--color-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.2s ease, background-color 0.2s;
}

.trainer-card__tg-link:hover {
    transform: scale(1.1);
    background-color: #2c3345;
}

.trainer-card__info {
    padding: 2rem 1.5rem 0;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.trainer-card__name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.trainer-card__position {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.trainer-card__desc {
    margin-top: auto;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.75;
    padding-top: 1rem;
    border-top: 1px solid rgba(65, 74, 98, 0.1);
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 768px) {
    .trainers-intro__text-cols {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .trainer-card {
        max-width: 100%;
    }

    .trainers-intro {
        padding: 100px 0 40px;
    }
}