/* certs-style.css */

.certs-section {
    padding: 80px 0px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.certs-title {
    font-size: 64px;
    line-height: 64px;
    font-weight: 500;
    color: #1C1C1C;
    margin-bottom: 40px;
}

.certs-slider-container {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 50px;
}

/* 🔥 Новая обертка, которая "режет" только слайды */
.slider-mask-wrapper {
    width: 100%;
    overflow: hidden; /* Теперь режем здесь */
    padding: 20px 0;

    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 8%,
        black 92%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 8%,
        black 92%,
        transparent 100%
    );
}

/* Линия-трек для карточек */
.certs-track {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    justify-content: center;
    transition: transform 0.4s ease;
    width: max-content;
}

/* Сама карточка */
.cert-card {
    flex: 0 0 204px;
    height: 354px;
    background: #EDEDED;
    padding: 8px 8px;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.cert-image {
    width: 100%;
    background: #EDEDED;
    border: 2px solid #EDEDED;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-image img {
    max-width: 100%;
    height: 266px;
    object-fit: contain;
}

.cert-name {
    font-size: 14px;
    color: #1C1C1C;
    line-height: 20px;
    letter-spacing: 0%;
}



/* Кнопки навигации */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: #FFE6CD;
    border: 2px solid #FFE6CD; /* Светло-розовая рамка как на скрине */
    border-radius: 8px;
    color: #1C1C1C;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.nav-arrow:hover {
    background: #b01a4e;
    color: #fff;
}

.nav-arrow.prev {
    left: 10px;
}

.nav-arrow.next {
    right: 10px;
}

/* Адаптивность */
/* --- АДАПТИВ ДЛЯ БОЛЬШИХ ЭКРАНОВ И НОУТБУКОВ (1200px - 1440px) --- */

@media (min-width: 1200px) and (max-width: 1440px) {
    /* Калькулятор */
    .calc-title {
        font-size: 56px;
        line-height: 58px;
    }
    .calc-form {
        max-width: 750px;
    }
    .form-grid {
        gap: 30px 12px; /* Чуть плотнее */
    }

    /* Кейсы */
    .section-title {
        font-size: 56px;
        margin-bottom: 70px;
    }
    .case-image {
        flex: 0 0 450px;
    }

    /* Сертификаты */
    .certs-title {
        font-size: 56px;
    }
    .cert-card {
        flex: 0 0 190px;
    }
}

/* --- СТРОГИЙ ФИКС ДЛЯ СРЕДНИХ ЭКРАНОВ (ОТ 900px ДО 1200px) --- */

@media (max-width: 1200px) {
    /* Калькулятор */
    .calc-container {
        gap: 30px;
    }
    .calc-title {
        font-size: 48px;
        line-height: 50px;
    }
    .calc-subtitle {
        font-size: 32px;
    }

    /* Кейсы */
    .case-main {
        gap: 20px;
    }
    .case-image {
        flex: 0 0 220px; /* Картинка становится компактнее */
    }
    .case-name {
        font-size: 34px;
        margin-bottom: 20px;
    }
    .thumb {
        flex: 0 0 160px; /* Уменьшаем миниатюры */
        height: 160px;
    }
    
    /* Сертификаты */
    .cert-card {
        flex: 0 0 170px;
    }
}

/* 3. Малые планшеты (до 768px) */
@media (max-width: 768px) {
    .certs-title {
        font-size: 32px;
        line-height: 36px;
    }
    .certs-slider-container {
        padding: 0 40px; /* Уменьшаем отступы для стрелок */
    }
    .cert-card {
        flex: 0 0 160px;
        height: 290px;
    }
    .cert-image img {
        height: 212px;
    }
    /* Делаем маску (градиент) по краям чуть меньше */
    .slider-mask-wrapper {
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    }
}

/* 4. Мобильные устройства (до 480px) */
@media (max-width: 480px) {
    .certs-title {
        font-size: 28px; /* Компактный заголовок */
        line-height: 32px;
        margin-bottom: 20px;
        text-align: center;
    }
    .certs-slider-container {
        padding: 0 0px;
    }

    .cert-image {
        margin-bottom: 8px;
    }
    .slider-mask-wrapper {
        /* Маски удалены */
        -webkit-mask-image: none;
        mask-image: none;
    }
    .slider-mask-wrapper {
        padding: 0px 0;
    }

    .calc-title {
		width: 251px;
        font-size: 28px; /* Компактный заголовок */
        line-height: 32px;
        margin-bottom: 2px;
        text-align: left;
    }

    .calc-subtitle {
        font-size: 24px;
        line-height: 28px;
        text-align: left;
    }
	
	 .calc-container {
        gap: 20px;
    }
	
	    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-group label {
        font-size: 12px;
        line-height: 15px;
    }

    .certs-slider-container {
        padding: 0 10px;
    }
    /* Скрываем стрелки на мобилках, если есть свайп (обычно на мобилках листают пальцем) 
       Либо оставляем, но делаем совсем маленькими: */
    .cert-card {
        flex: 0 0 160px; /* Чтобы на экране было видно больше карточек */
        height: 266px;
        padding: 6px;
    }
    .cert-name {
        font-size: 12px;
        line-height: 15px;
    }
    .case-image {
        flex: 0 0 222px; /* Картинка становится компактнее */
        margin-bottom: 4px;
    }



    .certs-slider-container {
        display: flex;
        flex-direction: column; 
        align-items: center;
        padding: 0 10px;
    }


    .slider-mask-wrapper {
        order: 1;
        width: 100%; 
    }

    /* Кнопки навигации падают вниз */

    .certs-nav-mobile {
        margin-top: 20px;
        display: flex;
        order: 2; 
    }
    .nav-arrow {
        position: static; /* Отменяем абсолютное позиционирование */
        transform: none;  /* Убираем центрирование по Y */
        display: inline-flex;
        margin: 0 6px;
    }


    .nav-arrow.prev, .nav-arrow.next {
        left: auto;
        right: auto;
    }
}

@media (max-width: 480px) {
    .thumb {
        flex: 0 0 50px;
        height: 50px;
    }
    .section-title {
        text-align: left;
        line-height: 32px;
        margin-bottom: 20px;
    }
    .case-name {
        text-align: left;
        font-size: 24px;
        line-height: 28px;
        margin-bottom: 16px;
    }
    .stat {
        margin-bottom: 8px;
    }
    .case-stats {
        margin-bottom: 16px;
    }
    .case-description {
        font-size: 14px;
        line-height: 17px;
        margin-bottom: 16px;
    }
    .case-link {
        font-size: 14px;
        line-height: 17px;
    }

}

/* 5. Совсем маленькие телефоны (до 360px) */
@media (max-width: 350px) {
    .certs-title {
        font-size: 22px;
    }
    .cert-card {
        flex: 0 0 130px;
        height: 250px;
    }
}