.img-container-template{
    max-width: 200px;
    background-color: rgb(245, 245, 245);
    padding: 10px;
    overflow: visible; /* вместо hidden */
    position: relative;
}

.img-container-template img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* или cover, если хотите заполнения */
    display: block;
}

.img-container {
    width: 100%;
    aspect-ratio: 3 / 5;
    /*border: 1px solid #ccc;*/
    background-color: rgb(245, 245, 245);
    padding: 10px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    /* ИЗМЕНЕНИЕ: делаем overflow: visible, чтобы хвостик не обрезался */
    overflow: visible; /* вместо hidden */
    position: relative;
}

.img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* или cover, если хотите заполнения */
    display: block;
}

.img-container img:hover {
    cursor: pointer;
}

.icon-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    color: #444;
    text-decoration: none;
    font-size: 1.2rem;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s, background-color 0.2s;
    cursor: pointer;
    z-index: 6;
}

/* Псевдоэлемент для подсказки */
.icon-btn::after {
    content: attr(data-tooltip);
    position: absolute;

    /* ИЗМЕНЕНИЕ: делаем z-index побольше, чтобы было выше картинки */
    z-index: 5;

    /* Точка привязки подсказки. "Ниже" иконки, поэтому берём bottom: 120%. */
    bottom: 50px;

    left: 50%;
    transform: translateX(-50%);

    /* Тёмная подсказка */
    background-color: #333;
    color: #fff;

    /* ИЗМЕНЕНИЕ: побольше скругление углов */
    border-radius: 8px;

    padding: 6px 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.icon-btn::before {
    content: "";
    position: absolute;

    /* ИЗМЕНЕНИЕ: тоже сделаем z-index чуть выше */
    z-index: 4;

    /* «Треугольник» будет чуть выше иконки */
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);

    /* Настраиваем стрелку */
    border-width: 10px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
    opacity: 0;
    transition: opacity 0.2s;
}

/* При наведении на иконку – показываем подсказку и хвостик */
.icon-btn:hover::after,
.icon-btn:hover::before {
    opacity: 1;
}

/*
  При наведении на .img-container, иконка становится видимой
  (если это логика с "появлением иконок"):
*/
.img-container:hover .icon-btn, .img-container-template:hover .icon-btn {
    opacity: 1;
}

/* При наведении на саму иконку – фон чуть светлеет */
.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.save-shift {
    right: 50px; /* Или сколько нужно пикселей */
}

/* Универсальное модальное окно */
.modal {
    position: fixed; /* перекрывает весь экран */
    z-index: 9999;   /* выше всех остальных элементов */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* затемнённый фон */
    overflow: auto;
    display: none; /* по умолчанию скрыто, JS включает display:block */
}

/* Кнопка закрытия (крестик) */
.modal-close {
    position: absolute;
    top: 10px;
    right: 30px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

/* Картинка внутри модального окна */
.modal-content {
    display: block;
    width: auto;  /* не выходить за экран */
    height: auto; /* чтобы влезло по высоте */
    max-width: none;
    max-height: none;
    position: absolute;

    /* Чтобы картинка не прилипала к самому верху: */
    margin: 50px auto;
    border: 2px solid #fff;
}

.fit-screen {
    /* Чтобы ширина не превышала 90% окна */
    margin-left: 50px;
    max-width: 90vw;
    /* Высоту не трогаем, пусть будет auto: */
    height: auto;
    /* Если используете object-fit: contain, оно
       учитывается, когда выставлены width/height,
       но здесь height:auto – значит пропорции сохранятся */
    object-fit: contain;
    /* Убираем/не указываем max-height,
       чтобы картинка могла быть выше экрана */
}

/* Плавающая подсказка */
.hover-tooltip {
    position: fixed; /* чтобы всегда опиралась на окно */
    z-index: 9999;
    background-color: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    pointer-events: none; /* чтобы мышь проходила сквозь */
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.preview-zone{
    position: relative;
    width: 40vw;
    aspect-ratio: 3 / 4;
    min-height: 240px;/* или aspect-ratio */
    border: 2px dashed #ccc;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    margin-top: 1.5rem;
}

@media (max-width: 768px){
    .preview-zone{ width: 100%; }
}

.preview-item{
    width: 150px;
    position: relative;
    box-shadow: 4px 6px 10px rgba(0,0,0,.75);   /* тень справа-снизу */
    border: none;
    background: transparent;
    border-radius:2px;
    overflow: visible;
}

.icon-xxl {
    width: 4rem;   /* то же, что 'fa-4x' */
    height: 4rem;
}

.btn-success {
    background-color: #5d92c6;   /* ярко-голубой фон */
    border-color:     #5d92c6;   /* такая же рамка   */
}

.btn-success:hover {
    background-color: #2074c6;   /* чуть темнее при наведении */
    border-color:     #2074c6;
}