/* ===== Custom Styles for Double C Family Farm ===== */

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

/* Prevent FOUC */
html.no-js .reveal {
    opacity: 1 !important;
    transform: none !important;
}

/* Reveal animations (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    /* Stagger children */
    .reveal-stagger > * {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0.1s; }
    .reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.2s; }
    .reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.3s; }
    .reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.4s; }
    .reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.5s; }
    .reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.6s; }
}

/* Floating card animations */
@media (prefers-reduced-motion: no-preference) {
    .floating-card {
        animation: float 6s ease-in-out infinite;
    }

    .card-1 {
        animation-delay: 0s;
    }

    .card-2 {
        animation-delay: -2s;
    }

    .card-3 {
        animation-delay: -4s;
    }

    .floating-leaf {
        animation: leaf-float 8s ease-in-out infinite;
    }

    .leaf-1 {
        animation-delay: 0s;
    }

    .leaf-2 {
        animation-delay: -3s;
    }
}

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

@keyframes leaf-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-15px) rotate(5deg);
    }
    66% {
        transform: translateY(8px) rotate(-3deg);
    }
}

/* Navbar styles */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.04);
}

.nav-transparent {
    background: transparent !important;
    box-shadow: none !important;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Selection color */
::selection {
    background: #99f6e4;
    color: #134e4a;
}

/* Image loading placeholder */
img {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Mobile menu transition */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Button ripple effect */
button, .group:hover button {
    position: relative;
    overflow: hidden;
}

/* Product card hover tilt effect */
@media (prefers-reduced-motion: no-preference) {
    .group {
        will-change: transform;
    }
}

/* Print styles */
@media print {
    nav, #contact-form, button, .floating-card, .floating-leaf {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    section {
        page-break-inside: avoid;
    }
}
