/* ======================================
   TrendFactory — Shared Navigation
   ====================================== */

/* ── Variables ────────────────────────── */
:root {
  --tf-primary: #4f46e5;
  --tf-primary-dark: #4338ca;
  --tf-text: #1e293b;
  --tf-text-sub: #64748b;
  --tf-border: #e2e8f0;
  --tf-bg-glass: rgba(255,255,255,0.88);
  --tf-shadow: 0 1px 3px rgba(0,0,0,0.04);
  --tf-radius: 10px;
  --tf-max-w: 1200px;
}

/* ── Nav wrapper ──────────────────────── */
.tf-nav {
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 1000;
  padding: 0;
  background: var(--tf-bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--tf-border);
  box-shadow: var(--tf-shadow);
}

/* ── Inner container ──────────────────── */
.tf-nav-inner {
  max-width: var(--tf-max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 20px;
}

/* ── Home logo (links to index) ───────── */
.tf-nav-home {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  font-size: 15px;
  color: var(--tf-text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  transition: color 0.2s;
}
.tf-nav-home:hover { color: var(--tf-primary); }
.tf-nav-home .tf-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--tf-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  transition: opacity 0.2s;
}
.tf-nav-home:hover .tf-icon { opacity: 0.85; }

/* ── Separator ────────────────────────── */
.tf-nav-sep {
  width: 1px;
  height: 22px;
  background: var(--tf-border);
  flex-shrink: 0;
}

/* ── Product selector + dropdown ──────── */
.tf-nav-product {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
  color: var(--tf-primary);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  padding: 4px 0;
}
.tf-nav-product .fa-chevron-down {
  font-size: 10px;
  color: var(--tf-text-sub);
  transition: transform 0.2s;
}
.tf-nav-product:hover .fa-chevron-down,
.tf-nav-product.open .fa-chevron-down { transform: rotate(180deg); }

/* Dropdown panel */
.tf-nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: -12px;
  background: #fff;
  border: 1px solid var(--tf-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  padding: 8px;
  min-width: 220px;
  z-index: 200;
}
/* invisible bridge to keep hover when moving to dropdown */
.tf-nav-dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.tf-nav-product:hover .tf-nav-dropdown,
.tf-nav-product.open .tf-nav-dropdown { display: block; }

.tf-nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tf-text);
  transition: background 0.15s;
}
.tf-nav-dropdown a:hover { background: #f1f5f9; }
.tf-nav-dropdown a.current {
  background: #eef2ff;
  font-weight: 700;
  color: var(--tf-primary);
  pointer-events: none;
}
.tf-nav-dropdown .dd-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

/* ── Section links ────────────────────── */
.tf-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}
.tf-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--tf-text-sub);
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
}
.tf-nav-links a:hover,
.tf-nav-links a.active { color: var(--tf-primary); }
.tf-nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: var(--tf-primary);
  border-radius: 1px;
}

/* ── CTA button ───────────────────────── */
.tf-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tf-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--tf-radius);
  flex-shrink: 0;
  transition: background 0.2s;
  white-space: nowrap;
}
.tf-nav-cta:hover { background: var(--tf-primary-dark); }

/* ── Mobile toggle ────────────────────── */
.tf-nav-mobile {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  cursor: pointer;
  z-index: 1001;
  flex-shrink: 0;
}
.tf-nav-mobile span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--tf-text);
  border-radius: 1px;
  transition: all 0.3s;
}
.tf-nav-mobile.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.tf-nav-mobile.active span:nth-child(2) { opacity: 0; }
.tf-nav-mobile.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Mobile menu overlay ──────────────── */
.tf-nav-mobile-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}
.tf-nav-mobile-panel.active { display: flex; }
.tf-nav-mobile-panel a {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--tf-text);
  transition: color 0.2s;
}
.tf-nav-mobile-panel a:hover { color: var(--tf-primary); }
.tf-nav-mobile-panel .tf-mobile-divider {
  width: 40px;
  height: 1px;
  background: var(--tf-border);
}
.tf-nav-mobile-panel .tf-mobile-products {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.tf-nav-mobile-panel .tf-mobile-products a {
  font-size: 0.95rem;
  color: var(--tf-text-sub);
}
.tf-nav-mobile-panel .tf-mobile-products a.current {
  color: var(--tf-primary);
  font-weight: 700;
}

/* ── Theme variants ───────────────────── */
.tf-nav.theme-teal  { --tf-primary: #0D9488; --tf-primary-dark: #0F766E; }
.tf-nav.theme-blue  { --tf-primary: #3182F6; --tf-primary-dark: #1B64DA; }
.tf-nav.theme-red   { --tf-primary: #ef4444; --tf-primary-dark: #dc2626; }

/* ── Responsive ───────────────────────── */
@media (max-width: 768px) {
  .tf-nav-links { display: none; }
  .tf-nav-cta   { display: none; }
  .tf-nav-mobile { display: flex; }
  .tf-nav-product .fa-chevron-down { display: none; }
  .tf-nav-dropdown { display: none !important; }
}
