/* public/stylesheets/photo-modal.css */
/* Стили для модального окна просмотра фото с размытым фоном */

/* Размытие фона при открытии модального окна */
.modal-backdrop.show {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.7);
}

.photo-modal .modal-dialog {
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
}

.photo-modal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
}

.photo-modal .modal-body {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.photo-modal .modal-body img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* Кнопки управления поверх изображения */
.modal-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.modal-controls .btn {
    pointer-events: auto;
    margin: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(79, 96, 165, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-controls .btn:hover {
    background-color: rgba(79, 96, 165, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.modal-controls .btn:active {
    transform: translateY(0);
}

/* Кнопка закрытия в правом верхнем углу */
.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 11;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    opacity: 0.9;
}

.btn-close-modal:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* Кнопка Telegram в правом нижнем углу - ОБНОВЛЕННЫЙ СТИЛЬ */
.btn-telegram-modal {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none !important;
    z-index: 11;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: #496AB0;
    border: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    font-size: 0.95rem;
}

.btn-telegram-modal:hover,
.btn-telegram-modal:focus,
.btn-telegram-modal:active {
    background-color: #637cb2;
    color: white;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.btn-telegram-modal:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.btn-telegram-modal i {
    font-size: 1.1rem;
}

/* Информация о продукте в левом верхнем углу */
.product-info {
    position: absolute;
    top: 15px;
    left: 15px;
    max-width: 70%;
    z-index: 11;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 12px;
    color: white;
    pointer-events: auto;
}

.product-info h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.product-info p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

/* Анимация появления модального окна */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal.fade .modal-dialog {
    animation: modalFadeIn 0.3s ease-out;
}

/* Анимация появления изображения */
@keyframes imageFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.photo-modal .modal-body img {
    animation: imageFadeIn 0.4s ease-out 0.1s both;
}

/* Индикатор загрузки */
.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1rem;
    z-index: 1;
}

.image-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .photo-modal .modal-dialog {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .photo-modal .modal-body img {
        max-height: 80vh;
    }
    
    .btn-close-modal {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
    
    .btn-telegram-modal {
        bottom: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    .product-info {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
        max-width: 65%;
    }
    
    .product-info h5 {
        font-size: 1rem;
    }
    
    .product-info p {
        font-size: 0.85rem;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .photo-modal .modal-body {
        border-radius: 8px;
    }
    
    .btn-telegram-modal {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .btn-telegram-modal i {
        font-size: 1rem;
    }
    
    .btn-telegram-modal span {
        display: inline;
    }
    
    .product-info {
        max-width: 75%;
    }
    
    .product-info p {
        display: none;
    }
}

/* Эффект при клике на карточку */
.hover.hover-1 {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.hover.hover-1:active {
    transform: scale(0.98);
}