/* === Custom Styles for Desguace Peñíscola J. Pellicer === */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Navbar scroll effect */
nav.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

nav.scrolled .nav-link {
    color: #1f3115;
}

nav.scrolled .nav-link:hover {
    background: #e3ecd3;
}

/* Mobile menu animation */
#mobileMenu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Service card hover */
.service-card {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
}

/* Intersection Observer animations */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children */
.fade-up:nth-child(1) { transition-delay: 0.05s; }
.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.15s; }
.fade-up:nth-child(4) { transition-delay: 0.2s; }
.fade-up:nth-child(5) { transition-delay: 0.25s; }
.fade-up:nth-child(6) { transition-delay: 0.3s; }

/* Back to top button */
#backToTop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile link active state */
.mobile-link.active {
    background: #e3ecd3;
    color: #1f3115;
}

/* Form focus styles */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 4px rgba(77, 124, 47, 0.1);
}

/* Selection color */
::selection {
    background: #c5d9ad;
    color: #1f3115;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fdf9ed;
}

::-webkit-scrollbar-thumb {
    background: #c5d9ad;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9dbe78;
}

/* Hero image parallax-like subtle movement */
@media (prefers-reduced-motion: no-preference) {
    @keyframes float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-10px); }
    }
    
    .floating-element {
        animation: float 4s ease-in-out infinite;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .fade-up {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .service-card {
        transition: none;
    }
    
    #mobileMenu {
        animation: none;
    }
}
