/* ═══════════════════════════════════════════════════════════════
   shared.css  —  CPInno JLIFE Detail Pages
   Industrial / precision aesthetic. Dark bg, lime accent.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Google Fonts ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=Barlow:wght@300;400;500;600&display=swap');

/* ── 2. Design Tokens ───────────────────────────────────────── */
:root {
  --green:        #b0fd30;
  --green-dim:    rgba(176, 253, 48, 0.18);
  --green-glow:   rgba(176, 253, 48, 0.08);
  --dark:         #0e0e0c;
  --dark-mid:     #181815;
  --dark-surface: #1e1e1a;
  --dark-card:    #242420;
  --border:       rgba(255,255,255,0.07);
  --border-green: rgba(176,253,48,0.25);
  --text:         #e8e5dc;
  --text-muted:   rgba(232,229,220,0.50);
  --text-dim:     rgba(232,229,220,0.30);
  --nav-h:        90px;
  --pad:          clamp(20px, 5vw, 72px);
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
}

/* ── 3. Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  overflow-x: hidden;
}
body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }

/* ── 4. Ambient background glow ─────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%,  rgba(176,253,48,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(176,253,48,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ── 5. Navigation ──────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  background: rgba(0, 0, 0, 0.52);
  transition: background 0.3s;
}
.nav.scrolled {
  background: rgba(10, 10, 8, 0.97);
}
.nav-logo img { height: 72px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 0; list-style: none; }
.nav-links li { display: flex; align-items: center; }
.nav-links li + li::before {
  content: '';
  display: block; width: 1px; height: 44px;
  background: rgba(255,255,255,0.45); margin: 0 32px;
}
.nav-links a {
  font-family: 'Inter', sans-serif;
  font-size: 22px; font-weight: 400;
  color: #ffffff; text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--green); }

/* Dropdown */
.nav-drop { position: relative; }
.nav-drop__menu {
  display: none; position: absolute;
  /* Flush to the nav bottom — no gap — then use padding-top as the invisible bridge */
  top: 100%; left: 50%;
  transform: translateX(-50%);
  padding-top: 10px; /* bridge: mouse stays "inside" element crossing the gap */
  min-width: 210px;
}
/* The visible box is a child so it doesn't interfere with the bridge padding */
.nav-drop__menu-inner {
  background: var(--dark-surface);
  border: 1px solid var(--border-green);
  border-radius: 6px; padding: 6px 0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.nav-drop:hover .nav-drop__menu { display: block; }
.nav-drop__menu a {
  display: block; padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  text-transform: none; letter-spacing: 0;
  transition: color 0.15s, background 0.15s;
}
.nav-drop__menu a:hover { color: var(--green); background: var(--green-glow); }

/* ── 6. Hamburger ───────────────────────────────────────────── */
.hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; padding: 4px; z-index: 600;
}
.hamburger span {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.25s, width 0.3s;
  transform-origin: center;
}
.hamburger span:nth-child(1) { width: 100%; }
.hamburger span:nth-child(2) { width: 100%; }
.hamburger span:nth-child(3) { width: 100%; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 100%; }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 490;
  background: rgba(8,8,6,0.97);
  flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu ul { list-style: none; text-align: center; }
.mobile-menu ul li {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.mobile-menu ul li:first-child { border-top: 1px solid rgba(255,255,255,0.12); }
.mobile-menu ul a {
  font-family: 'Inter', sans-serif;
  font-size: 28px; font-weight: 400;
  color: #ffffff; text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.mobile-menu ul a:active { color: var(--green); }

/* ── 7. Page Header ─────────────────────────────────────────── */
.page-header {
  margin-top: var(--nav-h);
  padding: 56px var(--pad) 0;
}
.page-header::after {
  content: '';
  display: block;
  height: 3px;
  margin-top: 24px;
  background: linear-gradient(90deg, var(--green) 0%, rgba(176,253,48,0.2) 60%, transparent 100%);
}
.page-header__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  line-height: 1;
}

/* ── 8. Product Sections ────────────────────────────────────── */
body { counter-reset: section; }

.product-section {
  padding: 72px var(--pad);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.product-section.visible { opacity: 1; transform: none; }
.product-section:last-of-type { border-bottom: none; }

/* Section counter label */
.product-section::before {
  counter-increment: section;
  content: '0' counter(section);
  display: block;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--green);
  opacity: 0.55;
  margin-bottom: 36px;
}

.product-section:nth-of-type(1) { transition-delay: 0ms; }
.product-section:nth-of-type(2) { transition-delay: 60ms; }
.product-section:nth-of-type(3) { transition-delay: 120ms; }
.product-section:nth-of-type(n+4) { transition-delay: 180ms; }

/* Layout grid */
.product-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 52px;
  align-items: start;
}

/* ── 9. Product Image Card ──────────────────────────────────── */
.product-card {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
/* Top shimmer line */
.product-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--green) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.product-card:hover {
  border-color: var(--border-green);
  box-shadow: 0 0 48px rgba(176,253,48,0.07), 0 8px 40px rgba(0,0,0,0.5);
}
.product-card:hover::before { opacity: 1; }

/* Corner accent lines */
.product-card::after {
  content: '';
  position: absolute; bottom: 0; right: 0;
  width: 40px; height: 40px;
  border-right: 2px solid rgba(176,253,48,0.15);
  border-bottom: 2px solid rgba(176,253,48,0.15);
  border-radius: 0 0 12px 0;
}

.product-card__img {
  width: 100%; max-width: 200px; height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
  transition: transform 0.4s var(--ease), filter 0.4s;
}
.product-card:hover .product-card__img {
  transform: scale(1.06) translateY(-5px);
  filter: drop-shadow(0 12px 32px rgba(176,253,48,0.18))
          drop-shadow(0 4px 12px rgba(0,0,0,0.7));
}
.product-card__img-placeholder {
  width: 180px; height: 180px;
  background: var(--green-glow);
  border: 1px dashed var(--border-green);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 12px;
}
.product-card__name {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--green);
  text-align: center; line-height: 1.3;
}
/* Divider above name */
.product-card__name::before {
  content: '';
  display: block;
  width: 36px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  margin: 0 auto 14px;
  opacity: 0.6;
}



/* ── 10. Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table-wrap::-webkit-scrollbar { height: 4px; }
.table-wrap::-webkit-scrollbar-track { background: var(--dark-surface); border-radius: 2px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-green); border-radius: 2px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13.5px;
  min-width: 480px;
}

/* Header row */
.data-table thead th {
  background: linear-gradient(180deg,
    rgba(176,253,48,0.14) 0%,
    rgba(176,253,48,0.08) 100%);
  color: var(--green);
  font-family: var(--font-display);
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  padding: 13px 16px;
  border: 1px solid rgba(176,253,48,0.18);
  text-align: center;
  white-space: nowrap;
}
.data-table thead th:first-child {
  border-left: 2px solid var(--green);
}

/* Body rows */
.data-table tbody td {
  padding: 11px 16px;
  border: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  background: var(--dark-surface);
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
}
.data-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.022);
}
.data-table tbody tr:hover td {
  background: var(--green-glow);
  color: var(--text);
}

/* Part number column emphasis */
.data-table tbody td:first-child {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  border-left: 2px solid rgba(176,253,48,0.20);
}
.data-table tbody tr:hover td:first-child {
  color: var(--green);
  border-left-color: var(--green);
}

/* Sub-header divider rows */
.data-table .sub-head td,
.data-table .sub-head th {
  background: rgba(176,253,48,0.07) !important;
  color: var(--green) !important;
  font-family: var(--font-display) !important;
  font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: 0.12em !important; text-transform: uppercase !important;
  padding: 8px 16px !important;
  border-top: 1px solid var(--border-green) !important;
  border-bottom: 1px solid var(--border-green) !important;
}
/* ── 11. Stacked tables (Fdetails) ──────────────────────────── */
.table-stack { display: flex; flex-direction: column; gap: 44px; min-width: 0; overflow: hidden; }

.table-label {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.table-label::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-green), transparent);
}


/* ── 12. Pagination ─────────────────────────────────────────── */
.page-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 52px var(--pad) 80px;
}
.page-nav__btn {
  min-width: 42px; height: 42px; padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--dark-surface);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease);
}
.page-nav__btn:hover {
  border-color: var(--border-green);
  background: var(--green-glow);
  color: var(--green);
  transform: translateY(-2px);
}
.page-nav__btn--active {
  background: var(--green);
  border-color: var(--green);
  color: var(--dark);
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 0 24px rgba(176,253,48,0.35);
}

/* ── 13. Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px var(--pad) 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.breadcrumb a {
  color: var(--green);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.breadcrumb a:hover { opacity: 1; }
.breadcrumb__sep { color: var(--text-dim); }
.breadcrumb__current { color: var(--text-muted); }

/* ── 14. Back-to-top ─────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 90;
  width: 44px; height: 44px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--dark-surface);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  font-size: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  border-color: var(--border-green);
  color: var(--green);
  transform: translateY(-2px);
}

/* ── 15. Responsive ─────────────────────────────────────────── */

@media (max-width: 1024px) {
  .nav-links a { font-size: 17px; }
  .nav-links li + li::before { margin: 0 18px; }
}
@media (max-width: 768px) {
  :root { --nav-h: 68px; --pad: 24px; }
  .nav { padding: 0 20px; }
  .nav-logo img { height: 50px; }
  .nav-links { display: none !important; }
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }
  .product-layout { grid-template-columns: 1fr; gap: 28px; }
  .product-card {
    position: static;
    flex-direction: row; gap: 16px;
    padding: 16px 20px;
  }
  .product-card__img { width: 80px; height: 80px; max-width: 80px; }
  .product-card__name { font-size: 14px; text-align: left; }
  .product-card__name::before { display: none; }
  .product-section { padding: 52px 24px; }
  .page-header { padding: 40px 24px 0; }
}
@media (max-width: 480px) {
  :root { --pad: 16px; }
  .page-header__title { font-size: 30px; }
  .product-section { padding: 44px 16px; }
}

    /* ──16. Carousel ─────────────────────────────────────────── */
    .carousel {
      position: relative;
      width: 100%;
      overflow: hidden;
      border-radius: 8px;
    }
    .carousel__track {
      display: flex;
      transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
      will-change: transform;
    }
    .carousel__slide {
      min-width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px;
    }
    .carousel__slide .product-card__img {
      /* override sticky transform from product-card hover — carousel handles motion */
      transition: filter 0.4s;
    }

    /* Prev / next arrow buttons */
    .carousel__btn {
      position: absolute;
      top: 50%; transform: translateY(-50%);
      width: 30px; height: 30px;
      background: rgba(14,14,12,0.75);
      border: 1px solid var(--border-green);
      border-radius: 50%;
      color: var(--green);
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      opacity: 0;
      transition: opacity 0.2s, background 0.2s, transform 0.2s;
      z-index: 10;
      padding: 0;
    }
    .carousel__btn svg { width: 14px; height: 14px; }
    .carousel__btn--prev { left: 6px; }
    .carousel__btn--next { right: 6px; }
    .carousel:hover .carousel__btn { opacity: 1; }
    .carousel__btn:hover {
      background: var(--green);
      color: var(--dark);
    }
    .carousel__btn--prev:hover { transform: translateY(-50%) translateX(-1px); }
    .carousel__btn--next:hover { transform: translateY(-50%) translateX(1px); }

    /* Dot indicators */
    .carousel__dots {
      position: absolute;
      bottom: 8px; left: 50%; transform: translateX(-50%);
      display: flex; gap: 6px;
      z-index: 10;
    }
    .carousel__dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      border: none;
      background: rgba(176,253,48,0.30);
      cursor: pointer;
      padding: 0;
      transition: background 0.2s, transform 0.2s;
    }
    .carousel__dot.active {
      background: var(--green);
      transform: scale(1.3);
    }

    /* Touch swipe hint on mobile */
    @media (max-width: 768px) {
      .carousel__btn { opacity: 0.7; }
    }



/* ── 17. Collapsible table sections ─────────────────────────── */
.table-section { margin-top: 12px; }
.table-section:first-child { margin-top: 0; }

.table-section__toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(176,253,48,0.08);
  border: 1px solid var(--border-green);
  border-radius: 6px;
  padding: 12px 18px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--green);
  transition: background 0.2s, border-color 0.2s;
  text-align: left;
}
.table-section__toggle:hover {
  background: rgba(176,253,48,0.14);
  border-color: var(--green);
}
.table-section__toggle-icon {
  font-size: 16px; line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  transition: transform 0.3s var(--ease);
}
.table-section__toggle[aria-expanded="false"] .table-section__toggle-icon {
  transform: rotate(-90deg);
}

/* Grid-row trick: smooth collapse without fixed max-height */
.table-section__body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s var(--ease), opacity 0.3s;
  opacity: 1;
}
.table-section__body.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
}
.table-section__body > div {
  overflow: hidden; /* inner wrapper clips overflowing content */
  min-width: 0;
}
.table-section__body .table-wrap {
  padding-top: 14px;
}

@media (max-width: 768px) {
  .product-layout > *:last-child { overflow: visible; } /* allow horizontal scroll to propagate */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-section__body > div { overflow: visible; }
  .data-table { min-width: 480px; } /* force table wide so scroll activates */
}

/* ── Site footer ─────────────────────────────────────────── */
.site-footer {
  background: #3e3e3e;
  color: #fff;
  padding: 50px 60px 40px;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
}
.site-footer .footer-col h4 { font-size: 20px; font-weight: 700; margin-bottom: 22px; }
.site-footer .footer-col ul { list-style: none; }
.site-footer .footer-col ul li { margin-bottom: 14px; font-size: 16px; }
.site-footer .footer-col ul a { color: #fff; text-decoration: none; transition: color 0.2s; }
.site-footer .footer-col ul a:hover { color: #b0fd30; }
.site-footer .footer-company h4 { font-size: 20px; font-weight: 700; margin-bottom: 22px; }
.site-footer .footer-company a { color: #fff; text-decoration: none; transition: color 0.2s; }
.site-footer .footer-company a:hover { color: #b0fd30; text-decoration: underline; }
.site-footer .footer-contact { display: flex; flex-direction: column; gap: 14px; }
.site-footer .footer-contact-row { display: flex; align-items: flex-start; gap: 16px; font-size: 16px; line-height: 1.6; }
.site-footer .footer-contact-label { font-weight: 700; color: #fff; min-width: 48px; padding-top: 1px; flex-shrink: 0; }
.site-footer .footer-address { font-style: normal; display: flex; flex-direction: column; gap: 2px; }
.site-footer .footer-address span { color: rgba(255,255,255,0.85); }
.site-footer .footer-address span:first-child { color: #fff; font-weight: 500; }
.site-footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 40px; padding-top: 20px;
  font-size: 13px; color: rgba(255,255,255,0.45);
}
@media (max-width: 768px) {
  .site-footer { padding: 40px 20px 32px; }
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .site-footer .footer-col h4, .site-footer .footer-company h4 { font-size: 18px; }
  .site-footer .footer-contact-row { font-size: 15px; }
}

/* ── 18. Scrollable tables (desktop + mobile) ────────────────── */

/* The collapse-animation rule (.table-section__body > div { overflow: hidden })
   has higher specificity (0,1,1) than .table-wrap (0,1,0) and blocks horizontal
   scroll when .table-wrap is the direct child of .table-section__body.
   This later rule wins the cascade at equal/same specificity. */
.table-section__body > div {
  overflow-x: auto;
  overflow-y: hidden; /* keep vertical clip for collapse animation */
  -webkit-overflow-scrolling: touch;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

@media (max-width: 768px) {
  /* Collapsible sections: horizontal scroll, vertical clip for animation */
  .table-section__body > div {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  /* Direct .table-wrap children in product-layout stay scrollable
     (overrides the earlier overflow:visible rule at same specificity) */
  .product-layout > .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}