/* Custom styles for Màquines De Cosir López */

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

/* Navbar scroll effect */
#navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
}

#navbar.scrolled {
    border-bottom-color: #e5e7eb;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

/* Hero animations */
.hero-fade-in {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeUp 0.7s ease forwards;
}

.hero-fade-in:nth-child(2) { animation-delay: 0.1s; }
.hero-fade-in:nth-child(3) { animation-delay: 0.2s; }
.hero-fade-in:nth-child(4) { animation-delay: 0.3s; }
.hero-fade-in:nth-child(5) { animation-delay: 0.4s; }

.hero-image-fade-in {
    opacity: 0;
    transform: translateX(32px);
    animation: fadeLeft 0.8s ease 0.2s forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered scroll reveal for grid items */
.scroll-reveal:nth-child(1) { transition-delay: 0.05s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.3s; }

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

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

.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-link:last-child {
    border-bottom: none;
}

/* Back to top */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:not(.visible) {
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(8px);
}

#back-to-top.visible {
    transform: translateY(0);
}

/* Form focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* Custom select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Image hover zoom */
.rounded-2xl.overflow-hidden img {
    transition: transform 0.6s ease;
}

.rounded-2xl.overflow-hidden:hover img {
    transform: scale(1.03);
}

/* Selection color */
::selection {
    background-color: #ff6b2e;
    color: white;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #a1a5aa;
}
