/* ═══════════════════════════════════════════
   RPMT Products — Custom Styles
   Industrial B2B Website
   ═══════════════════════════════════════════ */

/* ── Base ──────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: #1A8FC4;
    color: #ffffff;
}

/* ── Custom Scrollbar ─────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #0D4B6E;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #093A56;
}

/* ── Preloader ────────────────────────── */
#preloader {
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1),
                opacity 0.4s ease;
}

#preloader.loaded {
    transform: translateY(-100%);
    opacity: 0;
}

body.loading {
    overflow: hidden;
}

/* ── Navigation ───────────────────────── */
.h-18 {
    height: 4.5rem;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 20px rgba(13, 75, 110, 0.06);
}

#navbar.scrolled .nav-link-text {
    color: #4b5563;
}

#navbar.scrolled .nav-link-text:hover {
    color: #0D4B6E;
}

#navbar.scrolled .nav-cta-btn {
    border-color: #0D4B6E;
    color: #0D4B6E;
}

#navbar.scrolled .nav-cta-btn:hover {
    background-color: #0D4B6E;
    color: #ffffff;
}

/* Active nav link */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2px;
    background: #1A8FC4;
    border-radius: 1px;
}

/* ── Hero Grid ────────────────────────── */
.hero-grid {
    background-size: 60px 60px;
    background-image:
        linear-gradient(rgba(26, 143, 196, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 143, 196, 0.08) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
    animation: grid-pulse 8s ease-in-out infinite;
}

@keyframes grid-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ── Animated Grid (light sections) ───── */
.animated-grid {
    background-size: 50px 50px;
    background-image:
        linear-gradient(rgba(13, 75, 110, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 75, 110, 0.06) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 10%, transparent 70%);
    animation: grid-fade 10s ease-in-out infinite;
}

@keyframes grid-fade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ── Float Animations ─────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}

/* ── Hero Product Float ──────────────── */
.hero-product-float {
    animation: hero-float 4s ease-in-out infinite;
}

@keyframes hero-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* ── Navbar Logo (scrolled state) ─────── */
#navbar.scrolled .nav-logo-img {
    filter: none;
}

/* ── Dot Pattern ──────────────────────── */
.dot-pattern {
    background-image: radial-gradient(circle, #0D4B6E 0.8px, transparent 0.8px);
    background-size: 20px 20px;
}

/* ── Grid Pattern (dark sections) ─────── */
.grid-pattern {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ── Noise Texture ────────────────────── */
.noise {
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* ── WhatsApp Pulse ───────────────────── */
@keyframes wa-breathe {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
    }
}

#whatsapp-btn {
    animation: wa-breathe 2.5s ease-in-out infinite;
}

/* ── Back to Top ──────────────────────── */
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Form Focus Glow ──────────────────── */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(26, 143, 196, 0.12);
}

/* ── Responsive Adjustments ───────────── */
@media (max-width: 767px) {
    .hero-grid {
        background-size: 40px 40px;
    }
    .animated-grid {
        background-size: 35px 35px;
    }
}

/* ── Print Styles ─────────────────────── */
@media print {
    #navbar,
    #preloader,
    #whatsapp-btn,
    #back-to-top {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
    }
}

/* ── Reduced Motion ───────────────────── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-grid,
    .animated-grid {
        animation: none !important;
    }

    #whatsapp-btn {
        animation: none !important;
    }
}