/* ═══ EMVOLTIC – Modern Animations & Responsive ═══ */

html { scroll-behavior: smooth; }

/* Interactive element transitions */
a, button {
  transition: opacity 0.3s ease, transform 0.25s ease, 
              background 0.3s ease, box-shadow 0.3s ease, 
              border-color 0.3s ease, color 0.3s ease !important;
}
a:hover { opacity: 1 !important; }

/* Nav link underline */
header nav a { position: relative; }
header nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 50%; width: 0; height: 1.5px;
  background: #b95a2f;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
header nav a:hover::after { width: 100%; left: 0; }

/* Button hover */
a[style*="background: #14110d"][style*="padding: 1"]:hover,
a[style*="background: #f4f0e6"][style*="padding: 1"]:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 30px rgba(185, 90, 47, 0.2) !important;
}

/* Hero buttons hidden initially (GSAP will animate them in) */
#top div[style*="gap: 14px"] a {
  opacity: 0;
  transform: translateY(20px);
}
a[style*="border: 1px solid"]:hover {
  border-color: #b95a2f !important;
}

/* Card hover */
article {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), 
              box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
article:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 20px 60px rgba(20, 17, 13, 0.1), 
              0 4px 16px rgba(185, 90, 47, 0.06) !important;
}

/* KPI / intelligence tile hover */
div[style*="background: #ebe5d6"][style*="padding: 26px"],
div[style*="background: #ebe5d6"][style*="padding: 32px"] {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease !important;
}
div[style*="background: #ebe5d6"][style*="padding: 26px"]:hover,
div[style*="background: #ebe5d6"][style*="padding: 32px"]:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 36px rgba(20, 17, 13, 0.07) !important;
}

/* Header */
header { transition: box-shadow 0.4s ease, background 0.4s ease !important; }

/* SVG in cards */
article svg { transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) !important; }
article:hover svg { transform: scale(1.08) rotate(1deg) !important; }

/* Fix image-slot blocking scroll on mobile */
image-slot {
  touch-action: pan-y pan-x !important;
  -webkit-user-drag: none;
}
image-slot::part(frame) {
  touch-action: pan-y !important;
}
image-slot::part(image) {
  touch-action: pan-y !important;
  pointer-events: none !important;
}

/* ── Product & hero images proper fit ── */
img[alt^="prod-"] {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 2px;
  min-height: 0;
}
img[alt="emvoltic-hero"] {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/8 !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 2px;
}
img[alt^="pillar-"] {
  width: 100% !important;
  aspect-ratio: 4/3 !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 2px;
}

/* Make product card images fill the grid cell */
article[style*="grid-template-columns: 1fr 1fr"] > img {
  height: 100% !important;
  min-height: 200px;
  object-fit: cover !important;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  section, footer { padding-left: 24px !important; padding-right: 24px !important; }
  header > div { padding-left: 24px !important; padding-right: 24px !important; }
  div[style*="grid-template-columns: 240px 1fr"] { grid-template-columns: 1fr !important; gap: 32px !important; }
  div[style*="grid-template-columns: repeat(3, 1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  div[style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  div[style*="grid-template-columns: 1.2fr 1fr"] { grid-template-columns: 1fr !important; gap: 32px !important; }
  div[style*="grid-template-columns: 1fr 1.4fr 1fr"] { grid-template-columns: 1fr !important; gap: 24px !important; }
  article[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; }
}

/* Mobile menu button (hidden on desktop) */
.em-menu-btn {
  display: none;
  background: none; border: none; cursor: pointer; padding: 8px;
  position: relative; width: 32px; height: 32px;
}
.em-menu-btn span {
  display: block; width: 22px; height: 2px; background: #14110d;
  position: absolute; left: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.em-menu-btn span:nth-child(1) { top: 9px; }
.em-menu-btn span:nth-child(2) { top: 15px; }
.em-menu-btn span:nth-child(3) { top: 21px; }
.em-menu-btn.active span:nth-child(1) { transform: rotate(45deg); top: 15px; }
.em-menu-btn.active span:nth-child(2) { opacity: 0; }
.em-menu-btn.active span:nth-child(3) { transform: rotate(-45deg); top: 15px; }

/* Mobile nav overlay */
.em-mobile-nav {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(244, 240, 230, 0.98);
  backdrop-filter: blur(20px);
  z-index: 29;
  flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  opacity: 0; transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.em-mobile-nav.active {
  display: flex; opacity: 1; transform: translateY(0);
}
.em-mobile-nav a {
  font-size: 22px !important; font-weight: 500; color: #14110d !important;
  text-decoration: none; opacity: 1 !important;
  transition: color 0.3s ease !important;
}
.em-mobile-nav a:hover { color: #b95a2f !important; }

@media (max-width: 768px) {
  section, footer {
    padding-top: 56px !important; padding-bottom: 56px !important;
    padding-left: 16px !important; padding-right: 16px !important;
  }
  header > div { padding: 14px 16px !important; }
  header nav { display: none !important; }
  .em-menu-btn { display: block !important; }
  /* Hide the desktop CTA button on mobile header */
  header > div > a[href="#contact"] { display: none !important; }
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns: repeat(2, 1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="font-size: 64px"] { font-size: 40px !important; }
  div[style*="font-size: 48px"] { font-size: 32px !important; }
  div[style*="margin-top: 96px"] { margin-top: 40px !important; }
  div[style*="gap: 80px"] { gap: 24px !important; }
  div[style*="gap: 64px"] { gap: 20px !important; }

  /* Footer mobile layout */
  footer { padding: 40px 16px 24px !important; }
  footer div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
  footer ul { gap: 8px !important; }
  footer div[style*="padding-bottom: 64px"] { padding-bottom: 32px !important; }
  footer div[style*="gap: 48px"] { gap: 24px !important; }
}

@media (max-width: 480px) {
  section, footer {
    padding-top: 40px !important; padding-bottom: 40px !important;
    padding-left: 12px !important; padding-right: 12px !important;
  }
  header > div { padding: 10px 12px !important; }
  div[style*="display: flex"][style*="gap: 14px"][style*="flex-wrap"] {
    flex-direction: column !important;
  }
  div[style*="display: flex"][style*="gap: 14px"][style*="flex-wrap"] a {
    width: 100% !important; justify-content: center !important;
  }
  /* Footer on small mobile - full single column */
  footer div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
