/* ─── Custom Styles for Roberts Building Products ─── */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fefdf8;
}
::-webkit-scrollbar-thumb {
    background: #065f46;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #047857;
}

/* ─── Header Scroll State ─── */
#site-header {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#site-header.scrolled {
    background: rgba(254, 253, 248, 0.97);
    box-shadow: 0 1px 20px rgba(6, 78, 59, 0.08);
    backdrop-filter: blur(12px);
}

#site-header.scrolled .font-serif,
#site-header.scrolled span {
    color: #064e3b !important;
}

#site-header.scrolled a:not(.bg-emerald-800):not(.bg-cream-50) {
    color: #065f46 !important;
}

#site-header.scrolled a:not(.bg-emerald-800):not(.bg-cream-50):hover {
    color: #047857 !important;
}

/* ─── Product Cards ─── */
.product-card {
    cursor: default;
}

/* ─── Service Cards ─── */
.service-card {
    cursor: default;
}

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

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

/* ─── Scroll Reveal Animations ─── */
/* Default: visible (no-JS fallback) */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Only apply hidden state when JS is active via .js class on body */
.no-js .scroll-reveal {
    opacity: 1;
    transform: none;
}

/* Stagger delays */
.scroll-reveal.delay-1 { transition-delay: 0.1s; }
.scroll-reveal.delay-2 { transition-delay: 0.2s; }
.scroll-reveal.delay-3 { transition-delay: 0.3s; }
.scroll-reveal.delay-4 { transition-delay: 0.4s; }

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .product-card,
    .service-card {
        transition: none !important;
    }
    .product-card:hover,
    .service-card:hover {
        transform: none !important;
    }
    .group:hover img {
        transform: none !important;
    }
}

/* ─── Focus Styles ─── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ─── Selection ─── */
::selection {
    background: #065f46;
    color: #fefdf8;
}
