.main {
    display: block;
}

.main {
    display: flex;
    gap: 5%;
    flex-wrap: wrap;
}

.main-image {
    position: relative;
    flex: 0 0 25%;
    max-width: 25%;
}

.main-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.available-fillings {
    display: flex;
    flex-direction: column;
    flex: 0 0 70%;
    max-width: 70%;
}

.fillings-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filling-item {
    border: 1px solid var(--kbps-global-color-main);
    padding: 4px;
    overflow: hidden;
    transition: color 0.3s ease;
    cursor: pointer;
}

.filling-item > a.select-filling-link {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.filling-item > a.select-filling-link:hover {
    color: var(--kbps-global-color-main);
}

.filling-thumbnail {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-right: 4px;
    overflow: hidden;
}

.filling-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.filling-item h3.filling-title {
    font-weight: 200;
    font-size: small;
    margin: 0;
    flex-grow: 1;
}

@media (max-width: 768px) {
    .main { flex-direction: column; gap: 20px; }
    .main-image, .available-fillings { flex: 0 0 100%; max-width: 100%; }
    .filling-item > a.select-filling-link {
        flex-wrap: nowrap;
    }
}


/* Modal Container */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem; /* отступ от краёв экрана */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    box-sizing: border-box;
}

.modal-content {
    width: 400px;
    height: auto;
    max-height: none;
    overflow: hidden;
    display: block;
    padding: 1.4rem;
    box-sizing: border-box;
}

/* Кнопка закрытия */
.modal-content .close-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    background: none;
    border: none;
    padding: 0;
    z-index: 1;
}

.modal-content .close-button:hover {
    color: #777;
}

/* Вся внутренняя часть модалки */
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

/* Блок изображения */
.modal-image-section {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Контейнер под картинку */
.image-placeholder-container {
    width: 300px;
    height: auto;
    max-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Картинка */
#modal-filling-image-full {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Заглушка на время загрузки */
.image-placeholder-square {
    width: 300px;
    height: 400px;
    background-color: #ccc;
    animation: pulse-grey 1.5s infinite alternate;
    display: none;
    position: relative;
}

@keyframes pulse-grey {
    0% { background-color: #eee; }
    100% { background-color: #bbb; }
}

/* Текстовая часть */
.modal-details-section {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
















.entry-header {
    position: relative;
    margin-top: 4rem;
}

.back-to-archive-link {
    position: absolute;
    top: -50px;
    left: 20px;
    z-index: 10;
    display: block;
}


.back-to-archive {
    width: 32px;
    height: 32px;
    /*
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #ccc;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;*/
}



.back-to-archive i {
    font-size: 18px;
    color: #ffffff;
}

/* Медиазапрос для мобильных, если нужно изменить положение или размер */
@media (max-width: 600px) {
    .back-to-archive-link {
        top: 10px;
        left: 10px;
    }

    .back-to-archive {
        width: 30px;
        height: 30px;
    }

    .back-to-archive i {
        font-size: 14px;
    }
}

/* Остальные ваши стили для торта и модального окна */
/* ... */