:root {
    --primary-color: #007BFF;
    --primary-color-hover: #0056b3;
    --background-color: #000000;
    --block-bg: #ffffff;
    --block-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition-speed: 0.3s;
    --animation-duration-block: 0.5s;
    --animation-duration-modal: 0.3s;
}

/* === Подключение кастомного шрифта === */
@font-face {
    font-family: 'Decima Nova Pro';
    src: url('../fonts/DecimaNovaPro.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* === Анимации === */
@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(20px) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* === Общие стили секции услуг === */
.services-section {
    font-family: 'Decima Nova Pro';
    padding: 60px 20px;
}

/* === Контейнер блоков === */
.services-section .container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Две колонки */
    grid-template-rows: auto; /* Автоматическая высота */
    gap: 40px 90px; /* Отступы между карточками */
    max-width: 1240px;
    margin: 0 auto;
    justify-content: center;
}

/* Размещаем последнюю карточку в центре */
.services-section .block:last-child {
    grid-column: span 2; /* Занимает две колонки */
    justify-self: center; /* Центрирование по горизонтали */
}

/* === Карточка блока === */
.services-section .block {
    display: flex;
    flex-direction: row;
    width: 600px;
    height: 180px;
    background-color: var(--block-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--block-shadow);
    overflow: hidden;
    position: relative;
    opacity: 0; /* Изначально скрыты */
    /* Анимация будет запускаться при добавлении класса .animate */
}

/* Анимация для нечетных блоков при добавлении класса .animate */
.services-section .block.animate:nth-child(odd) {
    animation: fadeInLeft var(--animation-duration-block) ease-out forwards;
}

/* Анимация для четных блоков при добавлении класса .animate */
.services-section .block.animate:nth-child(even) {
    animation: fadeInRight var(--animation-duration-block) ease-out forwards;
}

/* Затемнение блока при наведении */
.services-section .block::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    transition: background var(--transition-speed) ease;
    z-index: 1;
    pointer-events: none;
}

.services-section .block:hover::before {
    background: rgba(0, 0, 0, 0.2);
}

/* Отключаем эффекты нежелательных трансформаций на блоке */
.services-section .block:hover {
    transform: none;
}

/* === Изображение блока === */
.services-section .block-img {
    width: 40%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    transition: none;
}

/* === Контент блока === */
.services-section .block-content {
    width: 60%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #333;
    font-size: 16px;
    text-align: center;
    position: relative; /* Контент выше затемняющего слоя */
    z-index: 2;
}

/* === Кнопка "подробное" === */
/* Изначально скрыта и немного смещена вверх */
.services-section .details-btn {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: bold;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

/* При наведении на карточку кнопка появляется и опускается вниз */
.services-section .block:hover .details-btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(20px);
}

/* Изменение цвета кнопки при наведении */
.services-section .details-btn:hover {
    background-color: var(--primary-color-hover);
}

/* === Модальное окно === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.75);
    overflow-y: auto;
    padding: 20px;
    align-items: center;
    justify-content: center;
}

/* Модальное окно с анимацией zoomIn */
.modal-content {
    background-color: #ffffff;
    border-radius: var(--border-radius);
    padding: 30px;
    width: 95%;
    max-width: 1200px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: zoomIn var(--animation-duration-modal) ease-out forwards;
}

/* === Горизонтальное расположение изображений внутри модального окна === */
.images-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 18px;
    margin-bottom: 20px;
    scroll-behavior: smooth;
    justify-content: center;
}

.images-row img {
    width: 250px;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    flex: 0 0 auto;
}

/* === Стили для контента модального окна (например, для секции мебели) === */
.modal-content-furniture {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.modal-content-furniture h2 {
    font-size: 26px;
    font-weight: bold;
    color: #222;
    position: relative;
}

.modal-content-furniture .divider-line {
    width: 100%;
    max-width: 900px;
    height: 4px;
    background-color: #333;
    margin: 20px auto;
    border-radius: 4px;
}

.modal-content-furniture p {
    font-size: 18px;
    line-height: 1.7;
    color: #444;
    text-align: center;
    margin-bottom: 10px;
}

/* === Кнопка закрытия модального окна === */
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

.close:hover {
    color: red;
}

/* Плавное изменение трансформаций для изображений */
.block-img,
.images-row img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Эффект увеличения изображения при наведении */
.block-img:hover,
.images-row img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* === Стили для увеличенного изображения === */
.enlarged {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    background-color: white;
    padding: 10px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
}

.enlarged.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* === Фон затемнения === */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.image-overlay.show {
    opacity: 1;
}



/* === Адаптация для мобильных устройств === */
@media (max-width: 768px) {
    .enlarged {
        max-width: 95vw;
        max-height: 80vh;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .enlarged {
        max-width: 100vw;
        max-height: 75vh;
        border-radius: 5px;
    }
}
