/* Блок с тремя фото */
.boys-features {
    width: auto;
    padding: 40px 20px;
    background-color: #151039;
}

.boys-features-title {
    font-family: 'Benzin', Arial, sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 2px 2px 8px rgba(0,0,0,.8);
    padding: 0 20px;
}

.boys-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 3/4;
    cursor: pointer;
    transition: transform .3s ease;
    border: 1px solid #fff;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter .4s ease, transform .4s ease;
}

.feature-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    background: rgba(0,0,0,0);
    transition: background .4s ease;
    box-sizing: border-box;
}

.feature-title {
    font-family: 'Benzin', Arial, sans-serif;
    font-weight: 500;
    font-size: 36px;
    color: #fff;
    margin: 0 0 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,.8);
    opacity: 1;
    transform: translateY(0);
    transition: opacity .4s ease, transform .4s ease;
    width: 100%;
    box-sizing: border-box;
}

.feature-text {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #fff;
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .4s ease, transform .4s ease;
    max-width: 90%;
    box-sizing: border-box;
}

/* Эффекты при наведении */
.feature-card:hover .feature-image {
    filter: blur(15px) brightness(.4);
    transform: scale(1.05);
}

.feature-card:hover .feature-overlay {
    background: rgba(21,16,57,.3);
}

.feature-card:hover .feature-title {
    opacity: .9;
    transform: translateY(-15px);
}

.feature-card:hover .feature-text {
    opacity: 1;
    transform: translateY(0);
}

/* Адаптив под меньший размер */
@media screen and (max-width: 1024px) {
    .boys-features-grid {
        gap: 20px;
        padding: 0 10px;
    }
    
    .boys-features-title {
        font-size: 42px;
        margin-bottom: 35px;
    }
}

/* Адаптив под планшет */
@media screen and (max-width: 768px) {
    .boys-features {
        padding: 60px 15px;
    }
    
     .feature-card {
        border: none;
    }
    
    .boys-features-title {
        font-size: 36px;
        margin-bottom: 30px;
        padding: 0 15px;
    }
    
    .boys-features-grid {
        gap: 15px;
        max-width: 100%;
    }
    
    .feature-card {
        aspect-ratio: auto;
        border-radius: 0;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        transform: none;
    }
    
    .feature-card:hover {
        transform: none;
    }
    
    /* Круглое изображение */
    .feature-image-wrapper {
        position: relative;
        width: 100%;
        padding-bottom: 100%;
        border-radius: 50%;
        overflow: visible;
    }
    
    /* Эффект расходящихся кругов */
    .feature-image-wrapper::before,
    .feature-image-wrapper::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,.3);
        pointer-events: none;
        animation: ripple 3s ease-out infinite;
        z-index: 1;
    }

    .feature-image-wrapper::before {
        width: 110%;
        height: 110%;
    }
    
    .feature-image-wrapper::after {
        width: 120%;
        height: 120%;
        animation-delay: 1s;
    }
    
    .feature-image-wrapper .ripple-effect {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 130%;
        height: 130%;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,.3);
        pointer-events: none;
        animation: ripple 3s ease-out infinite;
        animation-delay: 2s;
        z-index: 1;
    }
    
    @keyframes ripple {
        0% {
            transform: translate(-50%, -50%) scale(.95);
            opacity: 0;
        }
        25% {
            opacity: .3;
        }
        50% {
            opacity: .5;
        }
        100% {
            transform: translate(-50%, -50%) scale(1.3);
            opacity: 0;
        }
    }
    
    .feature-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        filter: brightness(.7);
        z-index: 2;
    }
    
    .feature-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        padding: 15px;
        background: rgba(21,16,57,0);
        transition: background .3s ease;
        z-index: 3;
        display: flex;
        justify-content: center;
        align-items: center;
        pointer-events: none;
    }
    
    .feature-card.active .feature-overlay {
        background: rgba(21,16,57,.85);
        pointer-events: auto;
    }

    .feature-card.active .feature-image {
        filter: brightness(.5);
    }

    .feature-card.active.expanded .feature-image {
        filter: brightness(1);
    }
    
    .feature-title {
        font-size: 18px;
        margin: 0;
        opacity: 1;
        transform: none;
        text-shadow: 1px 1px 4px rgba(0,0,0,.9);
        position: static;
        text-align: center;
        width: 100%;
        z-index: 4;
    }

    .feature-card .feature-text {
        font-size: 11px;
        line-height: 1.4;
        opacity: 0;
        transform: translate(-50%, -50%) scale(.8);
        transition: opacity .3s ease, transform .3s ease;
        display: -webkit-box;
        -webkit-line-clamp: 5;
        -webkit-box-orient: vertical;
        overflow: hidden;
        position: absolute;
        top: 50%;
        left: 50%;
        width: 80%;
        text-align: center;
        pointer-events: none;
        z-index: 5;
    }

    .feature-card.active:not(.expanded) .feature-text {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    
    /* Убираем hover эффекты на мобильных */
    .feature-card:hover .feature-image {
        filter: brightness(.7);
        transform: none;
    }
    
    .feature-card:hover .feature-overlay {
        background: rgba(21,16,57,0);
    }
    
    .feature-card:hover .feature-title {
        opacity: 1;
        transform: none;
    }
    
    .feature-card:hover .feature-text {
        opacity: 0;
        transform: scale(.8);
    }
    
    .feature-card.active:hover .feature-image {
        filter: brightness(.5);
    }
    
    .feature-card.active:hover .feature-overlay {
        background: rgba(21,16,57,.85);
    }
    
    .feature-card.active:hover .feature-text {
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптив для мобилки */
@media screen and (max-width: 480px) {
    .boys-features {
        padding: 50px 10px;
    }
    
    .boys-features-title {
        font-size: 28px;
        margin-bottom: 25px;
        padding: 0 10px;
    }
    
    .feature-card {
        border: none;
    }
    
    .boys-features-grid {
        gap: 12px;
    }
    
    .feature-title {
        font-size: 16px;
    }
    
    .feature-text {
        font-size: 10px;
        -webkit-line-clamp: 4;
    }
    
    /* Развернутое состояние */
    .feature-card.active.expanded {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(21,16,57,.95);
        z-index: 1000;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        border-radius: 0;
        overflow: hidden;
        padding-top: 80px;
        box-sizing: border-box;
    }

    .feature-card.active.expanded .feature-image-wrapper {
        width: 70vw;
        max-width: 300px;
        height: 70vw;
        max-height: 300px;
        margin-bottom: 30px;
        transition: all .4s ease;
        border-radius: 50%;
        overflow: visible;
        padding-bottom: 0;
        position: relative;
        order: 1;
    }
    
    .feature-card.active.expanded .feature-image {
        filter: brightness(1);
        border-radius: 50%;
    }

    .feature-card.active.expanded .feature-overlay {
        display: none;
    }

    .feature-card.active.expanded .feature-text {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 1;
        font-size: 16px;
        line-height: 1.6;
        color: #fff;
        margin: 10px 0 20px;
        width: 90%;
        max-width: 500px;
        text-align: center;
        display: block !important;
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
        white-space: normal !important;
        max-height: 40vh;
        overflow-y: auto;
        order: 3;
        z-index: 10;
    }

    .feature-card.active.expanded .feature-title {
        position: relative;
        font-size: 24px;
        color: #fff;
        text-align: center;
        width: 100%;
        margin: 20px 0 15px;
        order: 2;
    }
    
    /* Кнопка закрытия */
    .close-expand-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,.2);
        border: none;
        border-radius: 50%;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        z-index: 1001;
        display: none;
        align-items: center;
        justify-content: center;
        transition: background .3s ease;
    }

    .close-expand-btn:hover {
        background: rgba(255,255,255,.3);
    }

    .feature-card.active.expanded .close-expand-btn {
        display: flex;
    }
    
    .feature-image-wrapper.ripple-ready::before,
    .feature-image-wrapper.ripple-ready::after {
        animation-play-state: running;
    }

    /* Отключаем круги при развернутом состоянии */
    .feature-card.active.expanded .feature-image-wrapper::before,
    .feature-card.active.expanded .feature-image-wrapper::after,
    .feature-card.active.expanded .ripple-effect {
        display: none;
    }
    
    /* Анимация разворачивания */
    .feature-card {
        transition: transform .3s ease, opacity .3s ease;
    }

    .feature-card.active.expanded {
        animation: expandCard .4s ease forwards;
    }

    @keyframes expandCard {
        from {
            opacity: 0;
            transform: scale(.8);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }
}