/* =====================================================================
   TEXRON — Header, Footer, Navigasi, Aksi Mengambang
   Dimuat setelah style.css
   ===================================================================== */

/* ---------------------------------------------------------------------
   TOPBAR
   --------------------------------------------------------------------- */
.topbar {
  background: var(--brand-blue-900);
  color: rgba(255, 255, 255, .8);
  font-size: var(--fs-sm);
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  min-height: 40px;
  flex-wrap: wrap;
}
.topbar a { color: rgba(255, 255, 255, .8); }
.topbar a:hover { color: var(--brand-yellow); }

.topbar__contact { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.topbar__contact span,
.topbar__contact a { display: inline-flex; align-items: center; gap: 6px; }
.topbar__contact svg { width: 15px; height: 15px; flex: none; opacity: .85; }

/* Pemilih bahasa */
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius-sm); overflow: hidden; }
.lang-switch a {
  padding: 2px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}
.lang-switch a:hover { background: rgba(255,255,255,.1); color: #fff; }
.lang-switch a.is-active { background: var(--brand-yellow); color: var(--ink); }

/* ---------------------------------------------------------------------
   HEADER
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s var(--ease);
}
.site-header.is-stuck { box-shadow: var(--shadow); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: var(--header-h);
}

.site-logo { display: flex; align-items: center; flex: none; }
.site-logo img { height: 44px; width: auto; }

/* Navigasi utama */
.nav { display: flex; align-items: center; gap: var(--sp-1); }

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  border-radius: var(--radius-sm);
}
.nav__link:hover { color: var(--brand-blue); background: var(--surface-alt); }
.nav__link::after {
  content: '';
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.3rem;
  height: 3px;
  background: var(--brand-red);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
.nav__link.is-active { color: var(--brand-blue); }
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link svg { width: 11px; height: 11px; opacity: .6; }

/* Dropdown */
.nav__item { position: relative; }
.nav__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  padding: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-red);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .2s var(--ease);
}
.nav__item:hover > .nav__dropdown,
.nav__item:focus-within > .nav__dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav__dropdown a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.nav__dropdown a:hover { background: var(--brand-blue-100); color: var(--brand-blue); }
.nav__dropdown .divider { height: 1px; background: var(--line-soft); margin: var(--sp-2) 0; }

/* Aksi header */
.header-actions { display: flex; align-items: center; gap: var(--sp-3); flex: none; }

.rfq-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.55rem 1rem;
  border: 2px solid var(--brand-blue);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-blue);
  transition: all .18s var(--ease);
}
.rfq-chip:hover { background: var(--brand-blue); color: #fff; }
.rfq-chip svg { width: 18px; height: 18px; }
.rfq-chip__count {
  position: absolute;
  top: -8px; right: -8px;
  min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  padding-inline: 5px;
  background: var(--brand-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border: 2px solid var(--surface);
}

/* Tombol menu mobile */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--brand-blue);
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------- */
.site-footer {
  background: var(--surface-dark);
  color: rgba(255, 255, 255, .68);
  font-size: var(--fs-sm);
}
.site-footer a { color: rgba(255, 255, 255, .68); }
.site-footer a:hover { color: var(--brand-yellow); }

.site-footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: var(--sp-6);
  padding-block: var(--sp-7);
}

.footer-brand__logo { height: 46px; width: auto; margin-bottom: var(--sp-4); }
.footer-brand p { color: rgba(255, 255, 255, .6); }

.footer-col h4 {
  font-size: var(--fs-base);
  color: #fff;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}
.footer-col li + li { margin-top: var(--sp-2); }

.footer-contact li {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}
.footer-contact svg {
  width: 17px; height: 17px;
  flex: none;
  margin-top: 3px;
  color: var(--brand-yellow);
}

.social-links { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.social-links a {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius);
  transition: all .18s var(--ease);
}
.social-links a:hover { background: var(--brand-yellow); border-color: var(--brand-yellow); color: var(--brand-blue-900); }
.social-links svg { width: 18px; height: 18px; }

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-block: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, .5);
}

/* ---------------------------------------------------------------------
   AKSI MENGAMBANG (WhatsApp + kembali ke atas)
   --------------------------------------------------------------------- */
.float-actions {
  position: fixed;
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.float-btn {
  width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  color: #fff;
  transition: transform .18s var(--ease);
}
.float-btn:hover { transform: translateY(-3px); color: #fff; }
.float-btn svg { width: 26px; height: 26px; }
.float-btn--wa { background: #25d366; }
.float-btn--top {
  background: var(--brand-blue);
  opacity: 0; visibility: hidden;
}
.float-btn--top.is-visible { opacity: 1; visibility: visible; }
.float-btn--top svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------------
   RESPONSIF
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .nav__link { padding-inline: 0.6rem; font-size: 1rem; }
}

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .nav__link { white-space: normal; }

  /* Header sticky membuat stacking context sendiri, sehingga .nav di dalamnya
     tidak bisa melampaui z-index header. Header harus di atas overlay. */
  .site-header { z-index: 120; }

  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(340px, 86vw);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: calc(var(--header-h) + var(--sp-4)) var(--sp-4) var(--sp-6);
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .28s var(--ease);
    z-index: 120;
  }
  .nav.is-open { transform: translateX(0); }

  .nav__link {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
  }
  .nav__link::after { display: none; }
  .nav__link.is-active { color: var(--brand-red); }

  .nav__dropdown {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    border: 0; border-left: 2px solid var(--brand-yellow);
    border-radius: 0;
    box-shadow: none;
    min-width: 0;
    margin: var(--sp-2) 0 var(--sp-3) var(--sp-3);
    padding: 0 0 0 var(--sp-3);
    display: none;
  }
  .nav__item.is-expanded > .nav__dropdown { display: block; }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 20, 50, .5);
    opacity: 0; visibility: hidden;
    transition: opacity .25s var(--ease);
    z-index: 110;
  }
  .nav-overlay.is-visible { opacity: 1; visibility: visible; }

  .header-actions .rfq-chip span:not(.rfq-chip__count) { display: none; }

  .site-footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .topbar__contact { gap: var(--sp-3); }
  .topbar__inner { justify-content: center; }
  .site-footer__top { grid-template-columns: 1fr; gap: var(--sp-5); }
  .site-footer__bottom { justify-content: center; text-align: center; }
  .site-logo img { height: 36px; }
  :root { --header-h: 66px; }
}
