/* =============================================
   Precision Gasket - CSS Animations
   Replaces Framer Motion with CSS + IntersectionObserver
   ============================================= */

/* ── Fade Up on Scroll ── */
[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-animate="fade-up"].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Fade In ── */
[data-animate="fade-in"] {
  opacity: 0;
  transition: opacity 1s ease;
}
[data-animate="fade-in"].in-view {
  opacity: 1;
}

/* ── Slide Left ── */
[data-animate="slide-left"] {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-animate="slide-left"].in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ── Slide Right ── */
[data-animate="slide-right"] {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-animate="slide-right"].in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ── Scale Up ── */
[data-animate="scale-up"] {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-animate="scale-up"].in-view {
  opacity: 1;
  transform: scale(1);
}

/* ── Hero Text Slide Up ── */
[data-animate="hero-text"] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-animate="hero-text"].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Button Slide Fill (hover) ── */
.btn-slide {
  position: relative;
  overflow: hidden;
}
.btn-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: black;
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
.btn-slide:hover::before {
  transform: translateX(0);
}
.btn-slide > span {
  position: relative;
  z-index: 1;
}

/* ── Button Slide Fill (white variant) ── */
.btn-slide-white::before {
  background: #f9fafb;
}
.btn-slide-white:hover > span {
  color: #1f2937 !important;
}

/* ── Infinite Logo Carousel ── */
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.logo-carousel {
  display: flex;
  animation: scroll-left 20s linear infinite;
}
.logo-carousel:hover {
  animation-play-state: paused;
}

/* ── Gasket Type Carousel ── */
@keyframes scroll-left-slow {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.gasket-carousel {
  display: flex;
  animation: scroll-left-slow 20s linear infinite;
}

/* ── Product Name Bar Hover ── */
.product-bar {
  position: relative;
  overflow: hidden;
  background: #FFC400;
}
.product-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: black;
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
.group:hover .product-bar::before {
  transform: translateX(0);
}
.product-bar > span {
  position: relative;
  z-index: 1;
}

/* ── Bottom Border Grow on Hover ── */
.border-grow {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: #FFC400;
  transition: width 0.5s ease;
}
.group:hover .border-grow {
  width: 100%;
}

/* ── Scale X from Left ── */
.scale-x-grow {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}
.group:hover .scale-x-grow {
  transform: scaleX(1);
}

/* ── Nav Dropdown ── */
.nav-dropdown {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.nav-item:hover > .nav-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Nav Sub-panel (right panel for products) ── */
.nav-subpanel {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 100%;
  transform: translateX(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  display: none;
}
.nav-subpanel.active {
  opacity: 1;
  transform: translateX(0);
  position: relative;
  left: auto;
  pointer-events: auto;
  display: block;
}

/* ── Mobile Sidebar ── */
.sidebar-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.sidebar-overlay.open {
  opacity: 0.6;
  pointer-events: auto;
}

.sidebar-panel {
  transform: translateX(100%);
  transition: transform 0.35s ease;
}
.sidebar-panel.open {
  transform: translateX(0);
}

/* ── Sidebar Accordion ── */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease;
  opacity: 0;
}
.accordion-content.open {
  max-height: 500px;
  opacity: 1;
}

/* ── Footer Get in Touch Arrow ── */
.footer-arrow {
  transform: rotate(-45deg);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.footer-cta:hover .footer-arrow {
  transform: rotate(0deg);
}

/* ── Footer Line Expand ── */
.footer-line {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.footer-cta:hover .footer-line {
  transform: scaleX(1);
}

/* ── Floating Buttons ── */
.float-btn {
  opacity: 0;
  transform: translateY(50px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.float-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.float-btn:hover {
  transform: translateY(0) scale(1.1);
}

/* ── Intro Loader ── */
.intro-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #FFC400;
  display: flex;
  transition: opacity 0.4s ease;
}
.intro-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ── Pulse Animation (Chatbot) ── */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.15); opacity: 0.2; }
  100% { transform: scale(1); opacity: 0.55; }
}
.pulse-ring {
  animation: pulse-ring 2.6s ease-in-out infinite;
}

/* ── Typing Dots ── */
@keyframes bounce-dot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.typing-dot {
  animation: bounce-dot 0.6s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

/* ── Image Carousel Fade ── */
.carousel-image {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.carousel-image.active {
  opacity: 1;
}

/* ── Tab Content ── */
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.tab-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ── Sticky Title ── */
.sticky-title {
  transition: transform 0.6s ease, opacity 0.6s ease;
}
.sticky-title.exit {
  transform: translateY(-200px);
  opacity: 0;
}

/* ── Hero Buttons (white slide from left) ── */
.hero-btn-primary:hover > span:first-child,
.hero-btn-secondary:hover > span:first-child {
  transform: translateX(0) !important;
}

/* ── Social Icon Hover ── */
.social-icon {
  transition: transform 0.3s ease, color 0.3s ease;
}
.social-icon:hover {
  transform: scale(1.2);
  color: #FFC400;
}

/* ── Hero PRECISION text animation (About page) ── */
@keyframes slide-up-text {
  from {
    opacity: 0;
    transform: translateY(80px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-slide-up {
  animation: slide-up-text 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── CSR Hand Slide ── */
@keyframes slide-from-left {
  from { transform: translateX(-120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slide-from-right {
  from { transform: translateX(150%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.animate-hand-left {
  animation: slide-from-left 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.animate-hand-right {
  animation: slide-from-right 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Scroll-to-top hover ── */
.scroll-top-btn .bg-expand {
  transform: scale(0);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.scroll-top-btn:hover .bg-expand {
  transform: scale(1.5);
  opacity: 1;
}
.scroll-top-btn:hover svg {
  transform: translateY(-4px);
}
