/* ─────────────────────────────────────────
   KENCO MANUFACTUR — Shared Styles
   Design tokens, reset, header, footer,
   buttons, utilities, fade-in, responsive
───────────────────────────────────────── */

/* ── 1. DESIGN TOKENS ── */
:root {
  --navy:        #1a2e5e;
  --navy-dark:   #0f172a;
  --orange:      #e56b1f;
  --orange-dark: #c4591a;
  --white:       #ffffff;
  --surface:     #f0f2f5;
  --border:      #e5e7eb;
  --text:        #0f172a;
  --muted:       #64748b;
  --muted-light: #9ca3af;
}

/* ── 2. RESET & BASE ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── 3. LAYOUT UTILITIES ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── 4. TYPOGRAPHY UTILITIES ── */
.eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.75rem;
}

/* ── 5. BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover {
  background: #162857;
  box-shadow: 0 4px 16px rgba(26, 46, 94, 0.22);
}

.btn-orange {
  background: var(--orange);
  color: var(--white);
}
.btn-orange:hover {
  background: var(--orange-dark);
  box-shadow: 0 4px 16px rgba(229, 107, 31, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--navy);
  background: var(--surface);
}

/* ── 6. FADE-IN ANIMATION ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}
.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

/* ── 7. HEADER ── */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#main-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo img {
  height: 36px;
  width: auto;
}

#nav-menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

#nav-menu a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  position: relative;
  white-space: nowrap;
}

#nav-menu a:hover {
  color: var(--navy);
  background: var(--surface);
}

#nav-menu a.active {
  color: var(--navy);
  font-weight: 600;
}

#nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.875rem;
  right: 0.875rem;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
}

.btn-nav-cta {
  background: var(--orange) !important;
  color: var(--white) !important;
  padding: 0.4rem 1rem !important;
  border-radius: 4px;
  font-weight: 600 !important;
  margin-left: 0.5rem;
}
.btn-nav-cta:hover {
  background: var(--orange-dark) !important;
  color: var(--white) !important;
  transform: translateY(-1px);
}
.btn-nav-cta::after {
  display: none !important;
}

.nav-user {
  font-size: 1.5rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem !important;
  margin-left: 0.25rem;
}
.nav-user:hover {
  color: var(--navy) !important;
  background: var(--surface) !important;
}

.guest-popup {
  position: absolute;
  top: 68px;
  right: 2rem;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  z-index: 9999;
}
.guest-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: fixed;
  top: 14px;
  right: 1.25rem;
  z-index: 1100;
}

.bar {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  display: block;
  transition: opacity 0.2s ease;
}

.close-icon {
  display: none;
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1;
}

.hamburger.active .bar {
  display: none;
}
.hamburger.active .close-icon {
  display: block;
}

/* Mobile-only nav elements — hidden on desktop (min-width overrides base) */
@media (min-width: 769px) {
  .mobile-nav-header,
  .mobile-nav-bottom,
  .mobile-nav-close { display: none !important; }
}

/* ── 8. FOOTER ── */
#main-footer {
  background: var(--navy-dark);
  color: var(--white);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Top bar */
.footer-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.375rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.footer-brand img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  display: block;
  flex-shrink: 0;
}

/* Nav links — horizontal row with pipe separators */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.footer-links a {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  padding: 0.2rem 0.8rem;
  border-right: 1px solid rgba(255,255,255,0.12);
  white-space: nowrap;
  transition: color 0.15s ease;
  text-decoration: none;
}
.footer-links a:first-child { padding-left: 0; }
.footer-links a:last-child  { border-right: none; padding-right: 0; }
.footer-links a:hover       { color: var(--white); }

/* Social icons */
.footer-social {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.footer-social a {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}
.footer-social a:hover {
  background: var(--orange);
  color: #fff;
}

/* Bottom bar */
.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.28);
  flex-wrap: wrap;
}

.footer-address { flex: 1; white-space: nowrap; }
.footer-address a { color: rgba(255,255,255,0.38); transition: color 0.15s ease; }
.footer-address a:hover { color: rgba(255,255,255,0.7); }

.footer-copy { flex: 2; text-align: center; }

.footer-cert {
  flex-shrink: 0;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.35);
}

/* ── 9. RESPONSIVE ── */
@media (max-width: 1024px) {
  .footer-bar { gap: 1.25rem; }
  .footer-links a { font-size: 0.74rem; padding: 0.2rem 0.6rem; }
}

@keyframes navSlideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@media (max-width: 768px) {
  /* Hamburger — show 3 bars */
  .hamburger {
    display: flex;
    z-index: 1100;
  }
  .hamburger .close-icon { display: none !important; }
  .hamburger.active { display: none; } /* hide when menu open — X is inside menu */

  /* ── Full-screen white nav panel ── */
  #nav-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--white);
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
    gap: 0;
    z-index: 1050;
    overflow-y: auto;
  }
  #nav-menu.active {
    display: flex;
    animation: navSlideIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* ── Mobile nav header (logo kiri + X kanan) ── */
  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    box-sizing: border-box;
  }
  .mobile-nav-logo {
    display: flex;
    align-items: center;
  }
  .mobile-nav-logo img {
    height: 36px;
    width: auto;
    filter: none;
    display: block;
  }
  .mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
  }
  .mobile-nav-close:hover { color: var(--text); }

  /* ── Nav links ── */
  #nav-menu > a {
    width: 100%;
    padding: 1.125rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: left;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    background: transparent;
    letter-spacing: -0.01em;
    transition: color 0.15s ease, background 0.15s ease;
  }
  #nav-menu > a:hover {
    color: var(--navy);
    background: var(--surface);
  }
  #nav-menu > a.active {
    color: var(--orange);
    border-left: 3px solid var(--orange);
    padding-left: calc(1.5rem - 3px);
    background: rgba(229,107,31,0.05);
  }
  #nav-menu > a.active::after { display: none; }

  /* Karir button — styled as orange text link */
  .btn-nav-cta {
    color: var(--orange) !important;
    font-weight: 600 !important;
    margin-left: 0 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 1.125rem 1.5rem !important;
    justify-content: flex-start !important;
  }

  /* Hide desktop-only user icon */
  .nav-user.desktop-user { display: none !important; }
  #guest-popup { display: none !important; }

  /* ── Mobile nav bottom (email + social) ── */
  .mobile-nav-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mobile-nav-email {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s ease;
  }
  .mobile-nav-email:hover { color: var(--navy); }

  .mobile-nav-social {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
  }
  .mobile-nav-social a {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    background: var(--surface) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--navy) !important;
    font-size: 1rem !important;
    padding: 0 !important;
    border: 1px solid var(--border) !important;
    text-align: center !important;
    transition: background 0.2s ease, color 0.2s ease !important;
  }
  .mobile-nav-social a:hover {
    background: var(--orange) !important;
    color: var(--white) !important;
    border-color: var(--orange) !important;
  }

  /* Mobile footer: stacked layout */
  .footer-bar {
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem 1.5rem;
    gap: 0;
    border-bottom: none;
  }

  /* Logo goes to bottom — reorder with flex order */
  .footer-brand { order: 3; margin-top: 2rem; }

  /* Nav: 2-column grid */
  .footer-links {
    order: 1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    justify-content: unset;
    flex: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
  }
  .footer-links a {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    padding: 0.55rem 0;
    border-right: none;
    border-bottom: none;
    white-space: normal;
  }
  .footer-links a:first-child,
  .footer-links a:last-child { padding-left: 0; padding-right: 0; }

  /* Social icons: centered row */
  .footer-social {
    order: 2;
    margin-left: 0;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0;
  }
  .footer-social a {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    background: rgba(255,255,255,0.1);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1.25rem 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.07);
  }
  .footer-address { display: none; }
  .footer-copy { text-align: center; flex: none; }
  .footer-cert { display: none; }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 1rem;
  }
  .container {
    padding: 0 1rem;
  }
  .guest-popup {
    right: 1rem;
  }
}
