/* ===========================
   GoEnjoy Header — Full Blue Refresh
   Modern, Accessible, Responsive
   =========================== */
:root {
  /* ---- COLOR SYSTEM ---- */
  --gj-topbar: #0a3d91;       /* Navy elegan untuk topbar */
  --gj-header: #0b4a9f;       /* Biru utama header */
  --gj-text: #ffffff;         /* Teks putih untuk kontras */
  --gj-border: #2b70e4;       /* Aksen biru cerah untuk garis */
  --gj-panel: #e6f0ff;        /* Panel/dropdown, biru sangat lembut */
  --gj-muted: #94a3b8;        /* Teks sekunder, abu-abu biru lembut */
  --gj-accent: #ff3b4b;       /* Badge/alert, merah cerah */
  --gj-focus: #7da2ff;        /* Ring fokus untuk aksesibilitas */
  --gj-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); /* Bayangan lembut */
  --gj-hover: #d4e2ff;        /* Background hover, biru lebih lembut */
  --gj-active: #1d65d8;       /* Warna aktif untuk tombol/interaksi */
  --gj-panel-dark: #b3ccff;   /* Biru lebih gelap untuk panel aktif/hover */

  /* ---- LAYOUT ---- */
  --container: 1200px;
  --topbar-h: 48px;
  --header-h: 68px;

  /* ---- EFFECTS ---- */
  --ring: 0 0 0 3px var(--gj-focus);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
.container {
  width: 100%; max-width: var(--container);
  margin-inline: auto; padding: 0 16px;
}

/* ====== SOCIAL BAR ====== */
.social-bar {
  background: var(--gj-topbar);
  color: var(--gj-text);
  padding: 0;
  margin: 0;
}
.social-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Pindah ikon ke sisi kanan */
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 0 16px;
}
.social-text { 
  opacity: 0.92; 
  font-size: 14px; 
  margin: 0;
  display: none; /* Sembunyikan teks untuk ruang lebih */
}
.social-links {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gj-text);
  text-decoration: none;
  opacity: 0.92;
  transition: opacity 0.2s ease, transform 0.15s ease, background 0.2s ease;
  padding: 4px 8px;
}
.social-link:hover {
  opacity: 1;
  transform: translateY(-1px);
  background: var(--gj-active);
  border-radius: 8px;
}
.social-link:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}
.social-bar .social-link svg {
  fill: var(--gj-text);
  color: var(--gj-text);
}

/* ====== SITE HEADER ====== */
.site-header {
  background: var(--gj-header);
  color: var(--gj-text);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4000;
  box-shadow: inset 0 -1px 0 var(--gj-border);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  backdrop-filter: saturate(130%);
}
body {
  padding-top: calc(var(--topbar-h) + var(--header-h));
}

/* Desktop header container */
.header-inner {
  background: var(--gj-header);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
  padding: 0 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gj-text);
}
.brand .brand-name {
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}
.brand:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 10px;
}
.header-search {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 400px;
}
.search-input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 600; /* Membuat teks lebih menonjol */
  border: 1px solid var(--gj-border);
  border-radius: 10px 0 0 10px;
  background: var(--gj-panel);
  color: var(--gj-header);
}
.search-btn {
  height: 38px;
  width: 60px;
  border: 1px solid var(--gj-border);
  border-left: none;
  border-radius: 0 10px 10px 0;
  background: var(--gj-active);
  color: var(--gj-text);
  cursor: pointer;
  transition: background 0.2s ease;
}
.search-btn:hover {
  background: var(--gj-border);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

/* ====== ICON BUTTONS ====== */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gj-border);
  border-radius: 999px;
  background: var(--gj-panel);
  cursor: pointer;
  text-decoration: none;
  color: var(--gj-header);
  transition: box-shadow 0.2s ease, transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover {
  box-shadow: var(--gj-shadow);
  transform: translateY(-1px);
  background: var(--gj-panel-dark);
}
.icon-btn:active {
  transform: translateY(0);
}
.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gj-text);
  background: var(--gj-accent);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--gj-panel);
}
.badge-text {
  position: absolute;
  top: -10px;
  right: 0;
  font-size: 12px;
  color: var(--gj-text);
  background: var(--gj-accent);
  padding: 2px 6px;
  border-radius: 10px;
  opacity: 0.9;
}
.badge-text:after {
  content: "Notifikasi Baru"; /* Label untuk notifikasi */
}

/* ====== NOTIFICATION DROPDOWN ====== */
.header-notif { position: relative; }
.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-height: 420px;
  overflow: auto;
  background: var(--gj-panel);
  border: 1px solid var(--gj-border);
  border-radius: 12px;
  box-shadow: var(--gj-shadow);
  display: none;
  z-index: 4200;
}
.header-notif.is-open .notif-dropdown { display: block; }
.notif-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}
.notif-list li a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--gj-header);
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.12s ease;
}
.notif-list li.unread a { background: var(--gj-panel-dark); }
.notif-list li a:hover { background: var(--gj-panel-dark); transform: translateX(1px); }
.notif-list li a:focus-visible { outline: none; box-shadow: var(--ring); }
.notif-list .title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.notif-list .meta { font-size: 12px; color: var(--gj-muted); }
.notif-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--gj-border);
  padding: 10px;
  background: var(--gj-panel);
  position: sticky;
  bottom: 0;
}
.notif-foot-btn {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--gj-border);
  background: var(--gj-panel);
  cursor: pointer;
  text-decoration: none;
  color: var(--gj-header);
  transition: box-shadow 0.2s ease, transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}
.notif-foot-btn:hover {
  box-shadow: var(--gj-shadow);
  transform: translateY(-1px);
  background: var(--gj-panel-dark);
}
.notif-foot-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.notif-form { margin: 0; }

/* ====== USER MENU ====== */
.user-menu { position: relative; }
.user-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gj-panel);
  border: 1px solid var(--gj-border);
  border-radius: 999px;
  height: 38px;
  padding: 0 10px;
  cursor: pointer;
  color: var(--gj-header);
  transition: box-shadow 0.2s ease, transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}
.user-toggle:hover {
  box-shadow: var(--gj-shadow);
  transform: translateY(-1px);
  background: var(--gj-panel-dark);
}
.user-toggle:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.user-toggle .avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
}
.user-name {
  font-size: 14px;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none; /* Sembunyikan nama pengguna kecuali login */
}
.user-menu .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--gj-panel);
  border: 1px solid var(--gj-border);
  border-radius: 12px;
  box-shadow: var(--gj-shadow);
  display: none;
  z-index: 1999;
  padding: 6px;
}
.user-menu.is-open .menu { display: block; }
.user-menu .menu a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--gj-header);
  font-size: 14px;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.12s ease;
}
.user-menu .menu a:hover {
  background: var(--gj-panel-dark);
  transform: translateX(1px);
}
.user-menu .menu a:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  gap: 8px;
  transition: box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-solid {
  background: var(--gj-active);
  color: var(--gj-text);
  border: 1px solid var(--gj-active);
}
.btn-solid:hover {
  transform: translateY(-1px);
  background: var(--gj-border);
}
.btn-ghost {
  background: var(--gj-panel);
  color: var(--gj-header);
  border: 1px solid var(--gj-border);
}
.btn-ghost:hover {
  transform: translateY(-1px);
  box-shadow: var(--gj-shadow);
  background: var(--gj-panel-dark);
}
.btn-outline {
  background: var(--gj-panel);
  color: var(--gj-header);
  border: 1px solid var(--gj-header);
}
.btn-outline:hover {
  transform: translateY(-1px);
  background: var(--gj-panel-dark);
}

/* ====== MOBILE HEADER ====== */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--gj-border);
  background: var(--gj-header);
  color: var(--gj-text);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}
.mobile-header .brand {
  color: var(--gj-text);
  text-decoration: none;
}
.hamburger {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--gj-border);
  background: var(--gj-panel);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease;
}
.hamburger:hover {
  box-shadow: var(--gj-shadow);
  transform: translateY(-1px);
  background: var(--gj-panel-dark);
}
.mobile-header .icon-btn { color: var(--gj-header); }

/* ====== MOBILE DRAWER ====== */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
}
.mobile-drawer[aria-hidden="false"] { display: block; }
.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease;
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer[aria-hidden="true"] .drawer-overlay {
  opacity: 0;
  pointer-events: none;
}
.drawer-panel {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: min(82vw, 360px);
  background: var(--gj-panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease;
  transform: translateX(0);
  display: flex;
  flex-direction: column;
  padding: 14px;
}
.mobile-drawer[aria-hidden="true"] .drawer-panel {
  transform: translateX(-100%);
}
.drawer-close {
  align-self: flex-end;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--gj-border);
  background: var(--gj-panel);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease;
}
.drawer-close:hover {
  box-shadow: var(--gj-shadow);
  transform: translateY(-1px);
  background: var(--gj-panel-dark);
}
.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 4px 12px;
}
.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drawer-links a {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--gj-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--gj-header);
  transition: background 0.15s ease, transform 0.12s ease, border-color 0.2s ease;
}
.drawer-links a:hover {
  background: var(--gj-panel-dark);
  transform: translateX(1px);
}
.drawer-links a:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.drawer-social {
  margin-top: auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--gj-border);
}

/* ====== RESPONSIVE RULES ====== */
@media (max-width: 768px) {
  .social-inner { justify-content: center; gap: 8px; }
  .social-text { display: none; }
  .header-inner { display: none !important; }
  .mobile-header { display: flex !important; }
  .notif-dropdown { right: 0; width: min(92vw, 360px); }
  .user-name { display: none; }
  .hide-sm { display: none !important; }
}

/* Jaga konten tidak tertutup */
main, .page-content { position: relative; z-index: 1; }

/* === BAR NOTIF: biru dengan teks putih === */
.header-notif .notif-dropdown > .notif-head,
.header-notif .notif-dropdown > .notif-empty,
.header-notif .notif-dropdown > .empty,
.header-notif .notif-dropdown.bar-white > :first-child,
.header-notif .notif-dropdown > :first-child {
  background: var(--gj-panel-dark) !important;
  color: var(--gj-text) !important;
  padding: 10px 12px !important;
  display: block !important;
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
  border-bottom: 1px solid var(--gj-border) !important;
}

/* Teks kecil/secondary di dalam bar */
.header-notif .notif-dropdown > :first-child .meta {
  color: var(--gj-muted) !important;
}

/* Saat kosong, rapikan sudut bawah jadi kapsul */
.header-notif .notif-dropdown.is-empty > :first-child {
  text-align: center;
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

/* ==== PATCH MINIMAL: LAYERING & VISIBILITY ==== */
.site-header {
  z-index: 4000;
  overflow: visible;
}
.header-inner,
.header-actions,
.header-notif {
  overflow: visible;
}
.header-notif .notif-btn { position: relative; z-index: 4100; }
.header-notif .notif-dropdown { z-index: 4200; }
.mobile-drawer { z-index: 9000; }
.drawer-overlay { z-index: 9001; }
.drawer-panel { z-index: 9002; }
.swiper, .swiper-container, .swiper-wrapper, .swiper-slide,
.slick-slider, .slick-list, .slick-track,
.owl-carousel, .owl-stage-outer {
  position: relative;
  z-index: 2 !important;
}

.is-active, .disabled[aria-disabled="true"], span.disabled {
  pointer-events: none;
  opacity: 0.6;
  cursor: default;
  text-decoration: none;
}

/* Kill kategori desktop di mobile */
@media (max-width: 767px) {
  nav[class*="cat"],
  nav[class*="categor"],
  .desktop-cat,
  .desktop-categories,
  .header-categories,
  .categories,
  .cat-nav,
  .nav-categories,
  [class*="cat-nav"],
  [class*="categories-nav"] {
    display: none !important;
  }
  ul[class*="cat"] > li:nth-child(n+5),
  ul[class*="categor"] > li:nth-child(n+5),
  .header-categories ul > li:nth-child(n+5),
  .cat-nav ul > li:nth-child(n+5),
  .nav-categories ul > li:nth-child(n+5) {
    display: none !important;
  }
  .mobile-cat-list > li.more { display: inline-block !important; }
}

.site-header, .mobile-header {
  min-height: 60px;
  transition: none;
}
.site-header a, .mobile-header a, .site-header button, .mobile-header button {
  transition: background-color 0.2s, opacity 0.2s;
}

/* Menambahkan class untuk menampilkan nama pengguna hanya saat login */
.logged-in .user-name {
  display: inline;
}

.user-toggle {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}
.user-name {
  font-weight: 500;
}