

/* NAVBAR */
/* FIXED, bukan sticky */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;                      /* left+right, bukan width:100% */
  z-index: 1000;                 /* di atas konten & .wa-float */
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);          /* web lama */
  transition: background .3s ease, box-shadow .3s ease;
}

/* Ruang pengganti navbar */
#header { height: var(--nav-height); }

/* .is-scrolled dipasang initNavbar */
.navbar.is-scrolled { box-shadow: var(--shadow-md); }

/* align-items */
.navbar__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--space-lg);
  max-width: var(--container);
  height: 100%;                  /* pas --nav-height */
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
@media (max-width: 1488px) {
  .navbar__inner { padding-inline: var(--pad-x-mobile); }
}

/* logo */
.navbar__logo { display: flex; align-items: center; }
.navbar__logo img {
  width: auto;
  height: 38px;                  /* angka web lama */
  object-fit: contain;
}

/* MENU DESKTOP */
.navbar__menu { display: flex; }

.navbar__list {
  display: flex;
  align-items: stretch;
  gap: 36px;                     /* angka web lama */
}

.navbar__item {
  position: static;              /* PENTING */
  display: flex;
  align-items: center;           /* teks link tetap di tengah vertikal */
}

.navbar__item > a,
.navbar__trigger {
  position: relative;            /* jangkar buat garis ::after di bawah */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 4px;
  border: 0;
  background: transparent;
  color: var(--text-dark);
  font-size: 14.4px;             /* .9rem web lama */
  font-weight: 500;              /* web lama 500, bukan 600 */
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s;
}

.navbar__item > a::after,
.navbar__trigger::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 99px;
  background: var(--blue-accent);
  transition: width .25s ease;
}

.navbar__item > a:hover,
.navbar__trigger:hover,
.navbar__item.is-active > a,
.navbar__item > a.is-current { color: var(--blue-accent); }

.navbar__item > a:hover::after,
.navbar__trigger:hover::after,
.navbar__item.is-open .navbar__trigger::after,
.navbar__item.is-active > a::after,
.navbar__item > a.is-current::after { width: 100%; }

.navbar__caret {
  font-size: 10px;
  line-height: 1;
  transition: var(--transition);
}
.has-mega:hover .navbar__caret,
.has-mega:focus-within .navbar__caret,
.navbar__item.is-open .navbar__caret { transform: rotate(180deg); }

/* MEGA MENU */
.mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1001;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  box-shadow: var(--shadow-md);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

/* kebuka */
.navbar__item.has-mega:hover .mega,
.navbar__item.has-mega:focus-within .mega,
.navbar__item.has-mega.is-open .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega__inner {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  max-width: var(--container);
  margin-inline: auto;
  padding: 28px var(--pad-x);
}
@media (max-width: 1488px) {
  .mega__inner { padding-inline: var(--pad-x-mobile); }
}

.mega__inner--flat { grid-template-columns: minmax(0, 1fr); }

/* kolom kiri */
.mega__cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--gray-100);
  padding-right: var(--space-md);
}

.mega__cat a {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  font-size: 15.2px;
  font-weight: 600;
  transition: background .2s, color .2s;
}

/* Kategori hover & aktif SAMA tampilannya */
.mega__cat:hover a,
.mega__cat.is-active a {
  background: var(--off-white);
  color: var(--blue-accent);
}

.mega__cat-label { position: relative; display: inline-block; }
.mega__cat-label::after {
  content: "";
  position: absolute;
  left: 0;                       /* jangkar KIRI */
  bottom: -3px;
  width: 0;
  height: 2px;
  border-radius: 99px;
  background: var(--blue-accent);
  transition: width .25s ease;
}
.mega__cat:hover .mega__cat-label::after,
.mega__cat.is-active .mega__cat-label::after { width: 100%; }

/* kolom kanan */
.mega__panel { display: none; }
/* 3 kolom 1fr penuh */
.mega__panel.is-active {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

/* kartu brand berbingkai */
.mega__brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.mega__brand:hover {
  border-color: var(--blue-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.mega__brand-name {
  color: var(--navy);
  font-size: 15.2px;
  font-weight: 700;
  line-height: 1.3;
}
.mega__brand-desc {
  color: var(--text-lembut);
  font-size: 12.8px;
  line-height: 1.3;
}

/* HAMBURGER */
.navbar__hamburger {
  display: none;                 /* desktop */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  margin-inline: auto;
  border-radius: 99px;           /* web lama */
  background: var(--text-dark);
  transition: var(--transition);
}
.navbar__hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger.is-active span:nth-child(2) { opacity: 0; }
.navbar__hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MENU MOBILE */
.navbar__mobile {
  display: none;
  background: var(--white);
  border-top: 1px solid var(--gray-100);

  max-height: calc(100dvh - var(--nav-height));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.navbar__mobile.is-open { display: block; }

.m-list { padding: 16px var(--pad-x-mobile) 20px; }   /* angka web lama */

/* link biasa */
.m-link > a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-dark);
  font-size: 16px;               /* 1rem web lama */
  font-weight: 600;
  transition: color .2s;
}
.m-link > a:hover { color: var(--blue-accent); }

/* accordion tingkat 1 */
.m-acc__trigger,
.m-cat__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--gray-100);
  background: transparent;
  color: var(--text-dark);
  font-size: var(--fs-body);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.m-acc__caret,
.m-cat__caret {
  font-size: 10px;
  line-height: 1;
  transition: var(--transition);
}
.m-acc.is-open > .m-acc__trigger .m-acc__caret,
.m-cat.is-open > .m-cat__trigger .m-cat__caret { transform: rotate(180deg); }

/* max-height */
.m-acc__panel {
  max-height: 0;
  overflow: hidden;
  padding-left: var(--space-sm);
  transition: max-height .35s ease;
}
.m-acc.is-open > .m-acc__panel { max-height: 2000px; }

/* Daftar link langsung di dalam accordion */
.m-acc__links a {
  display: block;
  padding: 11px 0 11px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-body);
  font-size: 13.6px;
  transition: color .2s;
}
.m-acc__links li:last-child a { border-bottom: none; }
.m-acc__links a:hover { color: var(--blue-accent); }

/* accordion tingkat 2 */
.m-cat__trigger {
  padding: 12px 0 12px 16px;
  color: var(--navy);
  font-size: 14.4px;
  font-weight: 600;
}

.m-cat__brands {
  max-height: 0;
  overflow: hidden;
  padding-left: 40px;
  background: var(--off-white);
  transition: max-height .35s ease;
}
.m-cat.is-open > .m-cat__brands { max-height: 600px; }

.m-cat__brands a {
  display: block;
  padding: 10px 0 10px 32px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-body);
  font-size: 12.8px;
  transition: color .2s;
}
.m-cat__brands a:hover { color: var(--blue-accent); }

/* Baris pertama tiap kategori */
.m-cat__brands .m-cat__semua {
  padding-left: 0;
  color: var(--navy);
  font-weight: 600;
}
.m-cat__brands .m-cat__semua::after {
  content: " \203A";
  font-weight: 700;
}

/* FOKUS KEYBOARD */
.navbar a:focus-visible,
.navbar button:focus-visible {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* RESPONSIF */
/* Batas 768px */
@media (max-width: 768px) {
  .navbar__menu     { display: none; }   /* menu desktop + mega ikut hilang */
  .navbar__hamburger{ display: flex; }
  .navbar__logo img { height: 30px; }
}

/* tablet */
@media (min-width: 769px) and (max-width: 1280px) {
  .mega__inner {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: var(--space-md);
    padding-block: 20px;
  }
  .mega__panel.is-active { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mega__brand { padding: 12px 14px; }
}

/* Tablet & desktop sempit */
@media (min-width: 769px) and (max-width: 1200px) {
  .navbar__list { gap: 22px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .navbar__list     { gap: 14px; }
  .navbar__logo img { height: 32px; }
  .navbar__item > a,
  .navbar__trigger  { font-size: 13px; }
}

.skip-link {
  position: fixed;
  top: 8px;
  left: -9999px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 8px; outline: 3px solid var(--gold); outline-offset: 2px; }
