/* ========================================
   優品玩具製造株式会社 - 日式企业网站样式
   Japanese-style corporate website styles
   ======================================== */

/* --- Base & Typography --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: 'Noto Sans JP', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #6E7191;
  background-color: #F7F8FA;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background-color: rgba(35, 64, 117, 0.15);
  color: #234075;
}

/* --- Header Transitions --- */
#header.scrolled {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Active nav link */
.nav-link.active {
  color: #234075;
  position: relative;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background-color: #E87566;
  border-radius: 1px;
}

/* --- Mobile Menu Button Animation --- */
#menu-btn.open span:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}
#menu-btn.open span:nth-child(2) {
  opacity: 0;
}
#menu-btn.open span:last-child {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

.animate-fadeIn {
  animation: fadeIn 0.8s ease-out;
}

.animate-scrollBounce {
  animation: scrollBounce 2s ease-in-out infinite;
}

/* Scroll-triggered reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Product Card Hover --- */
.product-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(35, 64, 117, 0.15);
}

/* --- Form Elements --- */
input:focus,
textarea:focus,
select:focus {
  border-color: #234075 !important;
  box-shadow: 0 0 0 3px rgba(35, 64, 117, 0.08) !important;
}

/* Custom select arrow */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236E7191' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* --- Service Bar --- */
.service-item {
  position: relative;
}
.service-item svg {
  width: 18px;
  height: 18px;
}

/* --- Back to Top Button Visibility --- */
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Toast --- */
#toast.show {
  opacity: 1;
  visibility: visible;
}

/* --- Responsive --- */
@media (max-width: 1023px) {
  #mobile-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  #mobile-nav.open {
    max-height: 400px;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 4rem;
  }

  #service-bar {
    right: 8px;
    gap: 8px;
  }

  .service-item {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .service-item svg {
    width: 16px;
    height: 16px;
  }
}

/* --- Print styles --- */
@media print {
  #header,
  #service-bar,
  #back-to-top,
  #toast {
    display: none !important;
  }
}
