/**
 * Faretti - Анимации и эффекты интерактивности
 * Файл с дополнительными анимациями для улучшения пользовательского опыта
 */

/* Базовые анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes borderAnimation {
    0% { box-shadow: 0 0 0 0 rgba(0, 150, 136, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 150, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 150, 136, 0); }
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Классы анимаций */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out both;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out both;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out both;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out both;
}

/* Анимации с задержкой */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Улучшения для продуктовых карточек */
.product-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-image {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.product-weight {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.product-weight:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.product-card:hover .product-weight:before {
    transform: translateX(0);
}

/* Анимации для кнопок */
.btn-primary {
    overflow: hidden;
    position: relative;
}

.btn-primary:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: all 0.3s ease;
}

.btn-primary:hover:after {
    width: 100%;
}

/* Улучшения для блоков преимуществ */
.advantage-item {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.advantage-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.advantage-icon [data-eva] {
    transition: all 0.3s ease;
}

.advantage-item:hover .advantage-icon [data-eva] {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* Анимации для блоков статистики */
.stat-item {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.stat-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    transition: all 0.3s ease;
}

.stat-item:hover .stat-icon {
    animation: wave 1s ease infinite;
}

/* Анимации для контактных карточек */
.contact-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.contact-card-icon [data-eva] {
    transition: all 0.3s ease;
}

.contact-card:hover .contact-card-icon [data-eva] {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* Мобильное меню */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--background-color);
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        gap: 15px;
        z-index: 999;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Улучшения для мобильной версии */
@media (max-width: 576px) {
    .cake-line {
        padding: 30px 0;
    }
    
    .section-header h2 {
        font-size: 28px;
    }
    
    .product-grid {
        gap: 15px;
        padding-bottom: 15px;
    }
    
    .advantage-item {
        padding: 30px 20px;
    }
    
    .stat-item {
        width: 100%;
        max-width: none;
    }
    
    .contact-card {
        padding: 30px 20px;
    }
    
    .footer {
        padding: 50px 0 20px;
    }
    
    .footer-content {
        gap: 30px;
    }
}

/* Плавное появление для разделов при скролле */
@media (min-width: 992px) {
    .about-content, .advantages-items, .product-grid, .contact-cards {
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.8s ease-out;
    }
    
    .about-content.show, .advantages-items.show, .product-grid.show, .contact-cards.show {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Эффект для фоновых элементов */
.section-header:before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(0, 150, 136, 0.1) 0%, rgba(0, 150, 136, 0) 70%);
    border-radius: 50%;
    top: -30px;
    left: -30px;
    z-index: -1;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

/* Анимации для меню */
@keyframes menuItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-nav ul li {
    animation: menuItemFadeIn 0.5s ease forwards;
    opacity: 0;
}

/* Задержка для каждого элемента меню */
.main-nav ul li:nth-child(1) { animation-delay: 0.1s; }
.main-nav ul li:nth-child(2) { animation-delay: 0.2s; }
.main-nav ul li:nth-child(3) { animation-delay: 0.3s; }
.main-nav ul li:nth-child(4) { animation-delay: 0.4s; }
.main-nav ul li:nth-child(5) { animation-delay: 0.5s; }
.main-nav ul li:nth-child(6) { animation-delay: 0.6s; }
.main-nav ul li:nth-child(7) { animation-delay: 0.7s; }
.main-nav ul li:nth-child(8) { animation-delay: 0.8s; }

/* Анимация подчеркивания для активного элемента */
@keyframes activeItemHighlight {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: calc(100% - 28px);
        opacity: 1;
    }
}

.nav-item.active a:before {
    animation: activeItemHighlight 0.6s ease-out forwards;
}

/* Анимация при наведении для остальных элементов */
@keyframes hoverHighlight {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: calc(100% - 28px);
        opacity: 1;
    }
}

.nav-item:not(.active):hover a:before {
    animation: hoverHighlight 0.3s ease-out forwards;
} 