:root {
    --primary-accent: rgba(205,175,115,255);
    --primary-color: rgba(239,239,239,255);
    --secondary-accent: rgba(37,99,235,255);
}

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden; /* Убираем возможность прокрутки */
}

.main-container {
    width: 100vw;
    height: 100vh; /* Занимаем всю высоту viewport */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Убираем прокрутку контейнера */
}

.main-image-container {
    position: relative;
    flex: 0 0 40%; /* Занимает 40% высоты контейнера */
    min-height: 0; /* Важно для flex-элементов */
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-sizing: border-box;
    background-size: cover;
    box-shadow: inset 4px 4px 50px #454545;
}

.main-image-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0) 85%,
        rgba(0, 0, 0, 0.25) 100%
    );
}

.main-description-container {
    margin: 8px 16px; /* Уменьшаем вертикальные отступы */
    flex: 0 0 auto; /* Не растягивается */
}

.title-text-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.main-title {
    font-size: min(32px, 5vw); /* Адаптивный размер шрифта */
    color: var(--primary-accent);
    margin: 0;
    font-family: 'Gilroy';
    font-weight: 200;
    line-height: 1;
}

.main-title-secondary {
    font-size: min(32px, 5vw); /* Адаптивный размер шрифта */
    color: var(--primary-accent);
    margin: 0;
    font-family: 'Gilroy';
    font-weight: 600;
    line-height: 1;
}

.main-subtitle {
    font-size: min(9px, 2vw); /* Адаптивный размер шрифта */
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    margin-left: 3px;
    font-family: 'Gilroy';
    font-weight: 600;
}

.main-footer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 0 0 auto; /* Не растягивается */
    margin: 8px 0; /* Уменьшаем отступы */
}

.catalog-button {
    color: var(--primary-color);
    background-color: var(--secondary-accent);
    padding: min(18px, 3vh) min(36px, 5vw); /* Адаптивные padding */
    border-radius: 8px;
    width: 80%;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: min(12px, 3vw); /* Адаптивный размер шрифта */
    line-height: 100%;
    font-family: 'Gilroy';
    font-weight: 600;
}

.main-description-title {
    font-size: min(22px, 4vw); /* Адаптивный размер шрифта */
    margin-bottom: 4px; /* Уменьшаем отступ */
    font-family: "Gilroy";
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--primary-accent);
    line-height: 1.2;
}

.main-description-text {
    font-size: min(13px, 3vw); /* Адаптивный размер шрифта */
    font-weight: 400;
    font-family: "Gilroy";
    color: var(--primary-color);
    margin: 4px 0; /* Уменьшаем отступы */
    line-height: 1.3;
}

.overlay-container {
    position: absolute;
    margin-left: 16px;
    margin-top: 10px;
}

/* Matrix */
.images-matrix-container {
    width: 80%;
    box-sizing: border-box;
    flex: 1; /* Занимает оставшееся пространство */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
    padding: 0 8px; /* Уменьшаем боковые отступы */
}

.row-container {
    width: 100%;
    display: flex;
    gap: 2px;
    perspective: 1500px;
    box-sizing: border-box;
    overflow: hidden;
    margin: 2px 0; /* Уменьшаем вертикальные отступы */
}

.first-row {
    justify-content: end;
}

.second-row {
    justify-content: center;
}

.third-row {
    justify-content: start;
}

.card-image {
    width: min(114px, 20vw); /* Адаптивная ширина */
    height: min(64px, 12vh); /* Адаптивная высота */
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    transform: rotateY(-10deg) rotateX(30deg);
    flex-shrink: 0; /* Предотвращает сжатие */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Медиа-запросы для очень маленьких экранов */
@media (max-height: 600px) {
    .main-image-container {
        flex: 0 0 35%; /* Уменьшаем высоту изображения на маленьких экранах */
    }
    
    .main-description-container {
        margin: 4px 16px;
    }
    
    .main-footer-container {
        margin: 4px 0;
    }
    
    .images-matrix-container {
        padding: 0 4px;
    }
}

@media (max-width: 480px) {
    .overlay-container {
        margin-left: 12px;
        margin-top: 8px;
    }
    
    .main-description-container {
        margin: 8px 12px;
    }
    
    .catalog-button {
        width: 80%;
        padding: 12px 24px;
    }
}

@media (min-width: 680px) {
    .images-matrix-container {
        width: 60%;
    }
}

@media (min-width: 1050px) {
    .images-matrix-container {
        width: 50%;
    }
}
