/* Supplemental styles: Tailwind handles layout; this file covers interactions and small details. */

:root {
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Navigation */
.site-header.is-scrolled {
  box-shadow: 0 10px 30px -20px rgba(7, 20, 38, 0.75);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 0;
  height: 2px;
  background: #38a5f5;
  border-radius: 999px;
  transition: width 0.25s ease, left 0.25s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  left: 0;
  width: 100%;
}

/* Hero carousel */
.hero-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

.hero-dot {
  transition: width 0.3s ease, background-color 0.3s ease;
}

.hero-dot.is-active {
  width: 32px;
  background: #56ccf2;
}

/* Cards and reveal animation */
.product-card,
.reveal-item {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, opacity 0.7s ease;
}

.product-card:hover {
  transform: translateY(-8px);
}

.reveal-item {
  opacity: 0;
  transform: translateY(24px);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Form fields */
.field-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field-input:focus {
  outline: none;
  border-color: #1e88e5;
  box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.12);
  background-color: #fff;
}

/* Back to top */
#backToTop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#backToTop.is-visible {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  transform: translateY(-3px);
}

/* Mobile menu */
#mobileMenu {
  transition: max-height 0.35s ease, opacity 0.35s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

#mobileMenu.is-open {
  max-height: 420px;
  opacity: 1;
}

/* Product category filter tabs */
.filter-btn {
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

/* Only inactive tabs react to hover. The selected tab keeps its white text
   instead of darkening on hover (the previous hover utility class did that). */
.filter-btn:not(.is-active):hover {
  border-color: #6fc2ff;
  color: #1565c0;
}

/* Admin table */
.admin-table tbody tr {
  transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
  background-color: #f2f6fb;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-slide,
  .product-card,
  .reveal-item,
  #backToTop,
  #mobileMenu {
    transition: none !important;
  }

  .reveal-item {
    opacity: 1;
    transform: none;
  }
}
