/* ==========================================================================
   PROJECTS SECTION
   ========================================================================== */
.projects {
    width: 100%;
    padding: 30px 0 0;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0c0c0c 100%);
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* Фоновые элементы */
.projects__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.projects__gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 60, 30, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(207, 123, 60, 0.05) 0%, transparent 50%);
}

/* Общий заголовок секции - НОВЫЙ СТИЛЬ */
.projects__header {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 5px;
    padding-top: 5px;
}

.projects__title {
    color: #fff;
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

/* Черточки по бокам заголовка */
.projects__title::before,
.projects__title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 1px;
    background: #cf7b3c;
    transform: translateY(-50%);
}

.projects__title::before {
    left: -30px;
}

.projects__title::after {
    right: -30px;
}

.projects__title-line {
    width: 80px;
    height: 2px;
    background: #cf7b3c;
    margin: 0 auto 10px;
}

.projects__subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
    margin: 0; /* Убрали лишние отступы */
}

.projects__container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 100px;
    position: relative;
    z-index: 2;
}

/* Адаптивность для заголовка */
@media (max-width: 1024px) {
    .projects__title {
        font-size: 3rem;
        margin-bottom: 8px;
    }

    .projects__subtitle {
        font-size: 1rem;
    }

    .projects__title::before,
    .projects__title::after {
        width: 20px;
    }

    .projects__title::before {
        left: -30px;
    }

    .projects__title::after {
        right: -30px;
    }

    .projects__title-line {
        width: 80px;
        height: 2px;
        margin: 0 auto 10px;
    }

    .projects__header {
        margin-bottom: 40px;
        margin-top: 20px;
        padding-top: 20px;
    }
}

@media (max-width: 768px) and (min-width: 600px) {
    .projects__title {
        font-size: 2.5rem;
        margin-bottom: 6px;
    }

    .projects__subtitle {
        font-size: 0.9rem;
    }

    .projects__title::before,
    .projects__title::after {
        width: 20px;
    }

    .projects__title::before {
        left: -30px;
    }

    .projects__title::after {
        right: -30px;
    }

    .projects__title-line {
        width: 80px;
        height: 2px;
        margin: 0 auto 10px;
    }

    .projects__header {
        margin-bottom: 40px;
        margin-top: 20px;
        padding-top: 20px;
    }
}

@media (max-width: 576px) {
    .projects__title {
        font-size: 2rem;
        margin-bottom: 5px;
    }

    .projects__subtitle {
        font-size: 0.8rem;
    }

    .projects__title::before,
    .projects__title::after {
        width: 20px;
    }

    .projects__title::before {
        left: -30px;
    }

    .projects__title::after {
        right: -30px;
    }

    .projects__title-line {
        width: 80px;
        height: 2px;
        margin: 0 auto 10px;
    }

    .projects__header {
        margin-bottom: 40px;
        margin-top: 20px;
        padding-top: 20px;
    }
}

@media (max-width: 480px) {
    .projects__title {
        font-size: 2rem;
        margin-bottom: 5px;
    }

    .projects__subtitle {
        font-size: 0.8rem;
    }

    .projects__title::before,
    .projects__title::after {
        width: 20px;
    }

    .projects__title::before {
        left: -30px;
    }

    .projects__title::after {
        right: -30px;
    }

    .projects__title-line {
        width: 80px;
        height: 2px;
        margin: 0 auto 10px;
    }

    .projects__header {
        margin-bottom: 40px;
        margin-top: 20px;
        padding-top: 20px;
    }
}

@media (max-width: 375px) {
    .projects__title {
        font-size: 1.9rem;
        margin-bottom: 5px;
    }

    .projects__subtitle {
        font-size: 0.8rem;
    }

    .projects__title::before,
    .projects__title::after {
        width: 20px;
    }

    .projects__title::before {
        left: -30px;
    }

    .projects__title::after {
        right: -30px;
    }

    .projects__title-line {
        width: 80px;
        height: 2px;
        margin: 0 auto 10px;
    }

    .projects__header {
        margin-bottom: 40px;
        margin-top: 20px;
        padding-top: 20px;
    }
}

@media (max-width: 320px) {
    .projects__title {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }

    .projects__subtitle {
        font-size: 0.8rem;
    }

    .projects__title::before,
    .projects__title::after {
        width: 20px;
    }

    .projects__title::before {
        left: -30px;
    }

    .projects__title::after {
        right: -30px;
    }

    .projects__title-line {
        width: 80px;
        height: 2px;
        margin: 0 auto 10px;
    }

    .projects__header {
        margin-bottom: 40px;
        margin-top: 20px;
        padding-top: 20px;
    }
}

.projects__grid {
    display: flex;
    flex-direction: column;
    gap: 60px;
    margin-bottom: 60px;
}

.project {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project--reverse {
    flex-direction: row-reverse;
}

/* Контейнер для слайдера - ИСПРАВЛЕНО: Убрали черный фон */
.project__media-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

/* Главный слайдер проекта */
.project__slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.project__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    /* Убрали черный фон */
}

.project__slide.active {
    opacity: 1;
}

/* ИСПРАВЛЕНО: Заставляем изображение заполнять весь контейнер */
.project__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Используем cover для заполнения */
    transition: transform 0.5s ease;
    display: block; /* Убираем лишние отступы */
}

.project:hover .project__slide img {
    transform: scale(1.05);
}

/* Стрелки навигации главного слайдера */
.project__slider-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 5;
}

.project__slider-arrow {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    font-weight: bold;
}

.project__slider-arrow:hover {
    background: rgba(207, 123, 60, 0.8);
    border-color: #cf7b3c;
}

/* Контейнер для информации о проекте */
.project__info-container {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    min-height: 400px;
}

.project__title {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* ИСПРАВЛЕНО: Ограничение описания до 9 строк */
.project__description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 2rem;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.project__description p {
    display: -webkit-box;
    -webkit-line-clamp: 9;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.6em * 9);
}

/* Кнопка Подробнее */
.project__link {
    display: inline-block;
    padding: 12px 24px;
    background: #cf7b3c;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
    border: none;
    cursor: pointer;
    margin-top: auto;
}

.project__link:hover {
    background: #b86a2f;
    transform: translateY(-2px);
}

/* Отступ для кнопки "Показать еще" */
.projects__load-more {
    text-align: center;
    margin-bottom: 40px;
}

.projects__load-more-btn {
    padding: 15px 30px;
    background: transparent;
    color: #cf7b3c;
    border: 2px solid #cf7b3c;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.projects__load-more-btn:hover {
    background: #cf7b3c;
    color: #fff;
}

/* Навигационная панель - исправленное позиционирование */
.projects__nav-panel {
    width: 100%;
    height: 100px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    background: rgba(0, 0, 0, 0.95);
    flex-shrink: 0;
    position: absolute;
    bottom: 0;
    left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.projects__nav-line {
    position: absolute;
    top: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cf7b3c, transparent);
    opacity: 0.7;
}

.projects__nav-line--left {
    left: 3rem;
    right: 50%;
    margin-right: 100px;
}

.projects__nav-line--right {
    right: 3rem;
    left: 50%;
    margin-left: 100px;
}

.projects__nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projects__scroll-down {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.projects__nav-label {
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.projects__nav-arrow {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(207, 123, 60, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.projects__nav-arrow:hover {
    border-color: #cf7b3c;
    transform: scale(1.1);
}

/* Анимация пульсации для стрелки */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(207, 123, 60, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(207, 123, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(207, 123, 60, 0);
    }
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .project {
        flex-direction: column;
        min-height: auto;
    }

    .project--reverse {
        flex-direction: column;
    }

    .project__media-container {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        min-height: auto;
    }

    .project__info-container {
        flex: none;
        width: 100%;
        padding: 30px;
        min-height: auto;
    }

    .project__slider-arrow {
        width: 45px;
        height: 45px;
    }
    
    .project__description p {
        -webkit-line-clamp: 7;
        max-height: calc(1.6em * 7);
    }
}

/* Общий адаптив для мобильных и планшетов (до 768px) */
@media (max-width: 768px) {
    .projects {
        padding: 30px 0 0;
    }

    .projects__container {
        padding-bottom: 90px;
    }

    .projects__title {
        font-size: 2.5rem;
        margin-bottom: 6px;
    }

    .projects__subtitle {
        font-size: 0.9rem;
    }

    .projects__grid {
        gap: 40px;
        margin-bottom: 40px;
    }

    .project__media-container {
        aspect-ratio: 4/3;
        height: auto;
    }

    .project__slide img {
        object-fit: cover;
        width: 100%;
        height: 100%;
    }

    .project__info-container {
        padding: 25px;
    }

    .project__title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .project__description {
        margin-bottom: 1.5rem;
    }

    .project__description p {
        -webkit-line-clamp: 6;
        max-height: calc(1.6em * 6);
    }

    .project__slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    /* ===== НАВИГАЦИЯ (стили из секции услуг) ===== */
    .projects__nav-panel {
        padding: 0 2rem;
        height: 90px;
    }

    .projects__nav-line--left {
        left: 2rem;
        margin-right: 80px;
    }

    .projects__nav-line--right {
        right: 2rem;
        margin-left: 80px;
    }
}

/* ------------------------------------ */
/*   Очень маленькие (до 480px)         */
/* ------------------------------------ */
@media (max-width: 480px) {
    .projects__title {
        font-size: 2rem;
        margin-bottom: 5px;
    }

    .projects__subtitle {
        font-size: 0.8rem;
    }

    .project__media-container {
        aspect-ratio: 1/1;
    }

    .projects__container {
        padding-bottom: 80px;
    }

    .project__info-container {
        padding: 20px;
    }
    
    .project__description p {
        -webkit-line-clamp: 5;
        max-height: calc(1.6em * 5);
    }

    .project__slider-arrow {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    /* ===== НАВИГАЦИЯ (стили из секции услуг) ===== */
    .projects__nav-panel {
        padding: 0 1rem;
        height: 75px; /* как в сервисе */
    }

    .projects__nav-line--left {
        left: 1rem;
        margin-right: 50px; /* как в сервисе */
    }

    .projects__nav-line--right {
        right: 1rem;
        margin-left: 50px; /* как в сервисе */
    }

    .projects__nav-label {
        font-size: 0.75rem;
        margin-bottom: 5px;
        display: block; /* явно показываем */
    }

    .projects__nav-arrow {
        width: 30px;
        height: 30px;
    }
}

/* ------------------------------------ */
/*   Экстремально маленькие (до 375px)  */
/* ------------------------------------ */
@media (max-width: 375px) {
    .projects__title {
        font-size: 1.8rem;
    }

    .project__media-container {
        aspect-ratio: 1/1;
    }

    .projects__container {
        padding-bottom: 70px;
    }

    .project__info-container {
        padding: 18px;
    }

    .project__description p {
        -webkit-line-clamp: 4;
        max-height: calc(1.5em * 4);
    }

    .project__slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    /* ===== НАВИГАЦИЯ (стили из секции услуг) ===== */
    .projects__nav-panel {
        padding: 0 0.8rem;
        height: 70px;
    }

    .projects__nav-line--left {
        left: 0.8rem;
        margin-right: 40px;
    }

    .projects__nav-line--right {
        right: 0.8rem;
        margin-left: 40px;
    }

    .projects__nav-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .projects__nav-arrow {
        width: 28px;
        height: 28px;
    }
}

/* ------------------------------------ */
/*   До 320px – минимальные экраны      */
/* ------------------------------------ */
@media (max-width: 320px) {
    .projects__title {
        font-size: 1.6rem;
    }

    .project__media-container {
        aspect-ratio: 1/1;
    }

    .projects__container {
        padding-bottom: 60px;
    }

    .project__info-container {
        padding: 15px;
    }

    .project__description p {
        -webkit-line-clamp: 3;
        max-height: calc(1.4em * 3);
    }

    .project__slider-arrow {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    /* ===== НАВИГАЦИЯ (стили из секции услуг) ===== */
    .projects__nav-panel {
        padding: 0 0.6rem;
        height: 65px;
    }

    .projects__nav-line--left {
        left: 0.6rem;
        margin-right: 30px;
    }

    .projects__nav-line--right {
        right: 0.6rem;
        margin-left: 30px;
    }

    .projects__nav-label {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }

    .projects__nav-arrow {
        width: 24px;
        height: 24px;
    }
}

/* ==========================================================================
   LIGHTBOX SECTION - REDESIGNED
   ========================================================================== */

/* Лайтбокс на весь экран */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
}

.lightbox__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    overflow: hidden;
    border-radius: 0;
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #cf7b3c; /* оранжевая обводка */
    border-radius: 50%;
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox__close:hover {
    background: #cf7b3c;
    transform: scale(1.1);
}

.lightbox__body {
    width: 100%;
    height: 100%;
    padding: 0;
}

/* Контейнер лайтбокса */
.lightbox-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Боковая панель с миниатюрами */
.lightbox-sidebar {
    width: 150px;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    flex-direction: column;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-thumbnails-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-thumb-nav {
    display: flex;
    justify-content: center;
    padding: 8px;
    z-index: 5;
    flex-shrink: 0;
}

.lightbox-thumb-nav-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
}

.lightbox-thumb-nav-btn:hover {
    background: rgba(207, 123, 60, 0.2);
    border-color: #cf7b3c;
    color: #cf7b3c;
}

/* Контейнер миниатюр */
.lightbox-thumbnails-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: #cf7b3c rgba(255, 255, 255, 0.05);
    min-height: 0;
}

.lightbox-thumbnails-container::-webkit-scrollbar {
    width: 5px;
}

.lightbox-thumbnails-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 2px;
}

.lightbox-thumbnails-container::-webkit-scrollbar-thumb {
    background: #cf7b3c;
    border-radius: 2px;
}

.lightbox-thumbnails-container::-webkit-scrollbar-thumb:hover {
    background: #b86a2f;
}

.lightbox-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lightbox-thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.lightbox-thumb:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: #cf7b3c;
    transform: scale(1.03);
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Основная область лайтбокса */
.lightbox-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.95);
}

.lightbox-slider {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.lightbox-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: #000;
}

.lightbox-slide.active {
    display: flex;
}

.lightbox-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-slide iframe {
    width: 90%;
    height: 90%;
    border: none;
    border-radius: 8px;
}

/* Навигационные кнопки для основного слайдера */
.lightbox-slider-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    transform: translateY(-50%);
    z-index: 10;
}

.lightbox-slider-nav-btn {
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 1.2rem;
}

.lightbox-slider-nav-btn:hover {
    background: rgba(207, 123, 60, 0.4);
    border-color: #cf7b3c;
}

/* НОВАЯ СТРУКТУРА ПАНЕЛИ УПРАВЛЕНИЯ */
.lightbox-controls {
    height: 130px;
    background: rgba(10, 10, 10, 0.98);
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Левая секция - счетчики */
.lightbox-controls-left {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Счетчики - оранжевые названия */
.lightbox-counters {
    display: flex;
    gap: 25px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.lightbox-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 80px;
}

/* Уменьшенные анимированные цифры */
.lightbox-counter-value {
    color: #fff;
    font-size: 1.6rem; /* Уменьшено с 2rem */
    font-weight: 700;
    text-align: center;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 1s cubic-bezier(0.22, 0.61, 0.36, 1);
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    opacity: 0;
    transform: translateY(10px);
}

.lightbox-counter-value.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ОРАНЖЕВЫЕ НАЗВАНИЯ СЧЕТЧИКОВ */
.lightbox-counter-label {
    color: #cf7b3c; /* Оранжевый цвет */
    font-size: 0.8rem; /* Немного уменьшено */
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Правая секция - информация о медиа */
.lightbox-controls-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px 20px; /* Уменьшены отступы */
    overflow: hidden;
}

/* Контейнер заголовка медиа - уменьшенные отступы */
.lightbox-media-header {
    flex: 0 0 auto;
    margin-bottom: 10px; /* Уменьшен отступ снизу */
}

/* Оранжевый заголовок */
.lightbox-current-title {
    color: #cf7b3c; /* Оранжевый цвет */
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    padding-right: 10px; /* Уменьшен отступ справа */
}

/* Контейнер описания медиа - убран видимый контейнер */
.lightbox-media-description {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px; /* Отступ для скроллбара */
}

.lightbox-current-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Стили для скроллбара описания - тонкий */
.lightbox-media-description::-webkit-scrollbar {
    width: 4px; /* Уменьшена толщина */
}

.lightbox-media-description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.lightbox-media-description::-webkit-scrollbar-thumb {
    background: #cf7b3c;
    border-radius: 2px;
}

.lightbox-media-description::-webkit-scrollbar-thumb:hover {
    background: #b86a2f;
}

/* ЗАГОЛОВОК ПРОЕКТА - на слайдере слева внизу */
.lightbox-project-title-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7); /* Темный полупрозрачный */
    backdrop-filter: blur(10px); /* Размытие */
    padding: 10px 15px;
    border-radius: 6px;
    z-index: 5;
    max-width: 400px;
    /* Убрана обводка */
}

.lightbox-project-title {
    color: #fff;
    font-size: 1.3rem; /* Оптимальный размер */
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* КНОПКА ОПИСАНИЯ ПРОЕКТА - на слайдере справа внизу */
.lightbox-description-btn-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 5;
}

/* Кнопка с оранжевым контуром без фона */
.lightbox-description-btn {
    background: transparent; /* Убран фон */
    border: 2px solid #cf7b3c; /* Оранжевый контур */
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 150px;
}

.lightbox-description-btn:hover {
    background: rgba(207, 123, 60, 0.1); /* Легкий фон при наведении */
    transform: translateY(-2px);
}

/* Модальное окно с описанием проекта */
.lightbox-description-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.lightbox-description-content {
    max-width: 700px;
    max-height: 75vh;
    background: rgba(15, 15, 15, 0.97);
    border-radius: 10px;
    padding: 35px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    position: relative;
}

.lightbox-description-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-description-close:hover {
    background: rgba(207, 123, 60, 0.7);
    transform: scale(1.1);
}

.lightbox-description-full {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.lightbox-description-full p {
    margin-bottom: 1.2em;
}

.lightbox-description-full p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   АДАПТИВНОСТЬ — ИСПРАВЛЕННАЯ
   ========================================================================== */

/* Планшеты */
@media (max-width: 1024px) {
    .lightbox-sidebar {
        width: 130px;
    }
    
    .lightbox-controls-left {
        padding: 15px;
    }
    
    .lightbox-counter-value {
        font-size: 1.5rem;
    }
    
    .lightbox-counter-label {
        font-size: 0.75rem;
    }
    
    .lightbox-project-title-overlay {
        bottom: 25px;
        left: 25px;
        padding: 10px 16px;
    }
    
    .lightbox-project-title {
        font-size: 1.2rem;
    }
    
    .lightbox-description-btn-overlay {
        bottom: 25px;
        right: 25px;
    }
    
    .lightbox-description-btn {
        padding: 8px 16px;
        min-width: 140px;
        font-size: 0.85rem;
    }
    
    .lightbox-controls-right {
        padding: 12px 15px;
    }
    
    .lightbox-current-title {
        font-size: 1.1rem;
        padding-right: 8px;
    }
}

/* Мобильные устройства (портретная ориентация) */
@media (max-width: 768px) and (orientation: portrait) {
    .lightbox__content {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .lightbox-container {
        flex-direction: column;
    }
    
    /* Миниатюры в горизонтальный ряд */
    .lightbox-sidebar {
        width: 100%;
        height: 120px;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .lightbox-thumbnails-wrapper {
        flex: 1;
        flex-direction: row;
    }
    
    .lightbox-thumb-nav {
        flex-direction: column;
        justify-content: center;
        padding: 5px;
        width: 40px;
    }
    
    .lightbox-thumbnails-container {
        flex: 1;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
    }
    
    .lightbox-thumbnails {
        flex-direction: row;
        height: 100%;
        gap: 8px;
    }
    
    .lightbox-thumb {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
        aspect-ratio: 1;
    }
    
    /* Панель управления в колонку */
    .lightbox-controls {
        height: auto;
        flex-direction: column;
    }
    
    .lightbox-controls-left {
        flex: none;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px;
        min-height: 90px;
    }
    
    .lightbox-controls-right {
        padding: 12px 12px;
        height: 140px; /* фиксированная высота для появления скролла */
        min-height: unset;
        display: flex;
        flex-direction: column;
        overflow: visible; /* РАЗРЕШАЕМ ВНУТРЕННИЙ СКРОЛЛ */
    }
    
    .lightbox-counters {
        gap: 15px;
    }
    
    .lightbox-counter {
        min-width: 60px;
    }
    
    .lightbox-counter-value {
        font-size: 1.3rem;
        min-height: 1.8rem;
    }
    
    .lightbox-counter-label {
        font-size: 0.7rem;
    }
    
    .lightbox-current-title {
        font-size: 1rem;
        padding-right: 6px;
    }
    
    .lightbox-media-header {
        margin-bottom: 8px;
    }
    
    /* Контейнер описания с прокруткой */
    .lightbox-media-description {
        flex: 1;
        overflow-y: auto;
        padding-right: 8px;
        margin-bottom: 4px;
    }
    
    .lightbox-current-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Оверлеи — возвращаем исходное положение внизу слайдера */
    .lightbox-project-title-overlay {
        bottom: 10px; /* как на десктопе */
        left: 10px;
        padding: 8px 12px;
        max-width: 250px;
        backdrop-filter: blur(8px);
    }
    
    .lightbox-project-title {
        font-size: 1rem;
    }
    
    .lightbox-description-btn-overlay {
        bottom: 10px;
        right: 10px;
    }
    
    .lightbox-description-btn {
        padding: 6px 12px;
        min-width: 120px;
        font-size: 0.8rem;
        border-width: 1.5px;
    }
    
    .lightbox-slider-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .lightbox-description-modal {
        padding: 15px;
    }
    
    .lightbox-description-content {
        padding: 25px 20px;
        max-height: 80vh;
        width: 90%;
    }
    
    .lightbox-description-full {
        font-size: 0.95rem;
    }
    
    /* Стили для скроллбара в описании */
    .lightbox-media-description::-webkit-scrollbar {
        width: 4px;
    }
    
    .lightbox-media-description::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 2px;
    }
    
    .lightbox-media-description::-webkit-scrollbar-thumb {
        background: #cf7b3c;
        border-radius: 2px;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .lightbox__content {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .lightbox-container {
        flex-direction: column;
    }
    
    /* Миниатюры в горизонтальный ряд */
    .lightbox-sidebar {
        width: 100%;
        height: 120px;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .lightbox-thumbnails-wrapper {
        flex: 1;
        flex-direction: row;
    }
    
    .lightbox-thumb-nav {
        flex-direction: column;
        justify-content: center;
        padding: 5px;
        width: 40px;
    }
    
    .lightbox-thumbnails-container {
        flex: 1;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
    }
    
    .lightbox-thumbnails {
        flex-direction: row;
        height: 100%;
        gap: 8px;
    }
    
    .lightbox-thumb {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
        aspect-ratio: 1;
    }
    
    /* Панель управления с фиксированной высотой */
    .lightbox-controls {
        height: 230px;            /* фиксированная высота всей панели */
        flex-direction: column;
        min-height: unset;
    }
    
    .lightbox-controls-left {
        flex: 0 0 auto;            /* размер по содержимому (счетчики) */
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px;
        min-height: unset;
    }
    
    .lightbox-controls-right {
        flex: 1;                   /* занимает оставшуюся высоту */
        padding: 12px;
        display: flex;
        flex-direction: column;
        min-height: 0;             /* важно для flex-потомка */
        /* overflow: hidden убран — теперь не мешает внутреннему скроллу */
    }
    
    .lightbox-counters {
        gap: 15px;
    }
    
    .lightbox-counter {
        min-width: 60px;
    }
    
    .lightbox-counter-value {
        font-size: 1.3rem;
        min-height: 1.8rem;
    }
    
    .lightbox-counter-label {
        font-size: 0.7rem;
    }
    
    .lightbox-current-title {
        font-size: 1rem;
        padding-right: 6px;
    }
    
    .lightbox-media-header {
        margin-bottom: 8px;
    }
    
    /* Контейнер описания с прокруткой */
    .lightbox-media-description {
        flex: 1;
        overflow-y: auto;
        padding-right: 8px;
        margin-bottom: 4px;
    }
    
    .lightbox-current-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Оверлеи — внизу слайдера, над панелью */
    .lightbox-project-title-overlay {
        bottom: 10px;
        left: 10px;
        padding: 8px 12px;
        max-width: 250px;
        backdrop-filter: blur(8px);
    }
    
    .lightbox-project-title {
        font-size: 1rem;
    }
    
    .lightbox-description-btn-overlay {
        bottom: 10px;
        right: 10px;
    }
    
    .lightbox-description-btn {
        padding: 6px 12px;
        min-width: 120px;
        font-size: 0.8rem;
        border-width: 1.5px;
    }
    
    .lightbox-slider-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .lightbox-description-modal {
        padding: 15px;
    }
    
    .lightbox-description-content {
        padding: 25px 20px;
        max-height: 80vh;
        width: 90%;
    }
    
    .lightbox-description-full {
        font-size: 0.95rem;
    }
    
    /* Стили для скроллбара в описании */
    .lightbox-media-description::-webkit-scrollbar {
        width: 4px;
    }
    
    .lightbox-media-description::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 2px;
    }
    
    .lightbox-media-description::-webkit-scrollbar-thumb {
        background: #cf7b3c;
        border-radius: 2px;
    }
}

/* Очень маленькие экраны (ширина до 480px) */
@media (max-width: 480px) {
    .lightbox__close {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
        top: 10px;
        right: 10px;
    }
}

/* Высокие экраны (большие планшеты в портрете) */
@media (min-height: 800px) and (max-width: 768px) and (orientation: portrait) {
    .lightbox-controls-right {
        height: 160px; /* больше места для описания */
    }
}

/* Общие стили для скроллбаров (десктоп) */
.lightbox-description-content::-webkit-scrollbar {
    width: 6px;
}
.lightbox-description-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.lightbox-description-content::-webkit-scrollbar-thumb {
    background: #cf7b3c;
    border-radius: 3px;
}
.lightbox-description-content::-webkit-scrollbar-thumb:hover {
    background: #b86a2f;
}