/* ===== Industrial Green — Main Stylesheet ===== */

/* CSS Variables (fallback for non-Tailwind contexts) */
:root {
  --color-primary: #0099AF;
  --color-primary-hover: #007D90;
  --color-primary-light: #E0F7FA;
  --color-secondary: #00838F;
  --color-accent: #FF6F00;
  --color-dark: #212121;
}

/* ===== Base ===== */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* line-clamp polyfill for older browsers */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Desktop Nav Dropdown (slide down / up) ===== */
.nav-dropdown {
  transform: scaleY(0);
  transform-origin: top center;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
  pointer-events: none;
}

.nav-item:hover .nav-dropdown {
  transform: scaleY(1);
  opacity: 1;
  pointer-events: auto;
}

.nav-arrow {
  transition: transform 0.3s ease;
}

.nav-item:hover > a .nav-arrow {
  transform: rotate(180deg);
}

/* ===== Mobile Fullscreen Drawer ===== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  visibility: hidden;
  background: rgba(0, 0, 0, 0);
  transition: visibility 0.35s, background 0.35s ease;
}

.mobile-overlay.open {
  visibility: visible;
  background: rgba(0, 0, 0, 0.4);
}

.mobile-drawer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  overflow-y: auto;
}

.mobile-overlay.open .mobile-drawer {
  transform: translateX(0);
}

/* ===== Mobile Sub-Menu Panel (breadcrumb) ===== */
.sub-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 0;
  transform: translateX(-110%);
  transition: transform 0.3s ease;
  z-index: 50;
}

.sub-menu-panel.open {
  transform: translateX(0);
}

/* ===== Banner Slider ===== */
.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.banner-slide.active {
  position: relative;
  opacity: 1;
}

.banner-slide.hidden {
  display: block;
  position: absolute;
  opacity: 0;
}

/* ===== Partner Marquee ===== */
.partner-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.partner-track {
  animation: marqueeScroll 30s linear infinite;
}

.partner-marquee:hover .partner-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ===== Tab Styles ===== */
.product-tab,
.news-tab {
  background-color: #ffffff;
  color: #333;
}

.product-tab {
  display: inline-block;
  width: 160px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  font-size: 15px;
  border: 1px solid #e5e5e5;
  margin-left: -1px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  text-decoration: none;
  position: relative;
}

.product-tab:first-child {
  margin-left: 0;
}

.product-tab:hover,
.product-tab.tab-active {
  z-index: 1;
}

@media (min-width: 768px) {
  .product-tab {
    width: 200px;
    height: 60px;
    line-height: 60px;
    font-size: 16px;
  }
}

.product-tab:hover,
.product-tab.tab-active {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.news-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 122px;
  height: 42px;
  text-align: center;
  font-size: 16px;
  background-color: #ffffff;
  color: #666;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  text-decoration: none;
  border-radius: 0;
}

.news-tab:hover {
  background-color: var(--color-primary);
  color: #ffffff;
}

.news-tab.tab-active {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* ===== Breadcrumb Arrow ===== */
.breadcrumb-sep::before {
  content: "/";
  margin: 0 0.5rem;
  color: #d1d5db;
}

/* ===== Sidebar Category Active ===== */
.category-item.active > a {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* ===== Responsive Table ===== */
.prose table {
  width: 100%;
  border-collapse: collapse;
}

.prose th,
.prose td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose th {
  background-color: var(--color-primary-light);
  font-weight: 600;
}

/* ===== Product Detail Thumbnail ===== */
.thumbnail-item {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 0.375rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.thumbnail-item.active,
.thumbnail-item:hover {
  border-color: var(--color-primary);
}

/* ===== Scroll to Top Button ===== */
#scrollTopBtn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#scrollTopBtn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Right Side Toolbar (matches original zcqiti.com) ===== */
#toolbar {
  position: fixed;
  z-index: 9999;
  right: 17px;
  bottom: 10%;
}
#toolbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#toolbar li {
  margin-bottom: 3px;
  font-size: 0;
  width: 57px;
  height: 57px;
  right: 0;
  position: relative;
}
#toolbar li a {
  display: block;
  position: absolute;
  z-index: 9;
  right: 0;
  top: 0;
  width: 57px;
  height: 57px;
  overflow: hidden;
  background: #292e39;
  transition: all .5s ease;
  white-space: nowrap;
  font-size: 0;
  text-decoration: none;
}
#toolbar li .tb-icon {
  display: inline-block;
  vertical-align: middle;
  width: 57px;
  height: 57px;
  background-color: #d9d9d9;
  position: relative;
  transition: background-color .3s;
}
/* Icon pseudo-element base — sprite image */
#toolbar li .tb-icon::after {
  content: '';
  width: 30px;
  height: 30px;
  background-image: url(../images/icon_spirit.png);
  background-repeat: no-repeat;
  position: absolute;
  left: calc(50% - 15px);
  top: calc(50% - 15px);
}
/* QQ icon */
#toolbar li .tb-icon-qq::after { background-position: 0 -150px; }
#toolbar li:hover .tb-icon-qq::after { background-position: -30px -150px; }
/* Phone icon */
#toolbar li .tb-icon-phone::after { background-position: 0 -90px; }
#toolbar li:hover .tb-icon-phone::after { background-position: -30px -90px; }
/* WeChat icon */
#toolbar li .tb-icon-wechat { cursor: pointer; }
#toolbar li .tb-icon-wechat::after { background-position: 0 -30px; }
#toolbar li.tb-ewm:hover .tb-icon-wechat::after { background-position: -30px -30px; }
/* Message icon */
#toolbar li .tb-icon-msg::after { background-position: 0 -120px; }
#toolbar li:hover .tb-icon-msg::after { background-position: -30px -120px; }
/* Top icon */
#toolbar li .tb-icon-top { cursor: pointer; }
#toolbar li .tb-icon-top::after { background-position: 0 -60px; }
#toolbar li:hover .tb-icon-top::after { background-position: -30px -60px; }
#toolbar li .tb-wz {
  display: inline-block;
  line-height: 57px;
  font-size: 14px;
  color: #fff;
  vertical-align: middle;
  padding-left: 10px;
}
/* Hover — expand button width to show text */
#toolbar li:hover a {
  width: 200px;
}
#toolbar li:hover .tb-icon {
  background-color: #292e39;
}
/* WeChat QR code panel */
#toolbar li.tb-ewm .tb-ewm-box {
  position: absolute;
  z-index: 1;
  padding: 5px;
  background: #292e39;
  width: 120px;
  right: 120%;
  bottom: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition: all .5s ease;
  text-align: center;
}
#toolbar li.tb-ewm .tb-ewm-box img {
  max-width: 100%;
  display: block;
}
#toolbar li.tb-ewm .tb-ewm-box p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #ccc;
}
#toolbar li.tb-ewm .tb-ewm-box::after {
  content: '';
  position: absolute;
  right: -5px;
  bottom: 20px;
  width: 0;
  height: 0;
  border-width: 5px;
  border-style: dashed dashed dashed solid;
  border-color: transparent transparent transparent #292e39;
  border-right: none;
}
#toolbar li.tb-ewm:hover .tb-ewm-box {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#toolbar li.tb-ewm:hover .tb-icon {
  background-color: #292e39;
}
/* Back to top — hidden by default, shown on scroll */
#toolbar li.tb-backtop {
  cursor: pointer;
  display: none;
}
#toolbar li.tb-backtop.visible {
  display: list-item;
}

@media (max-width: 990px) {
  #toolbar {
    display: none;
  }
}

/* ===== Print Styles ===== */
@media print {
  header, footer, .breadcrumb, .sidebar, #scrollTopBtn, #toolbar {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
  }
}

/* ===== Mobile Bottom Bar Spacing ===== */
@media (max-width: 767px) {
  body {
    padding-bottom: 50px;
  }
}

/* ===== Language Switch ===== */
.lang-switch:hover .lang-dropdown {
  display: block;
}
