/* =============================================================
   KONVEKSI21 — Navbar Stylesheet
   Fully replaces old navbar CSS. Uses Bootstrap 5 as base.
   ============================================================= */

/* ── Variables (inherit from style.css) ────────────────────── */
:root {
  --nb-height:      64px;
  --nb-bg:          #0a0a0a;
  --nb-border:      rgba(255,255,255,.07);
  --nb-gold:        #d4af37;
  --nb-gold-muted:  rgba(212,175,55,.12);
  --nb-text:        #aaaaaa;
  --nb-text-hover:  #ffffff;
  --nb-radius:      10px;
  --nb-shadow:      0 8px 32px rgba(0,0,0,.55);
}

/* ── Announcement Bar ───────────────────────────────────────── */
.k-announce {
  background: linear-gradient(90deg, #1a1200, #2a1e00, #1a1200);
  border-bottom: 1px solid rgba(212,175,55,.2);
  padding: .45rem 1rem;
  text-align: center;
  font-size: .78rem;
  color: #d4af37;
  position: relative;
  z-index: 1040;
}
.k-announce strong { color: #f0c040; }
.k-announce-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #d4af37;
  opacity: .6;
  cursor: pointer;
  font-size: .85rem;
  padding: 0;
  line-height: 1;
}
.k-announce-close:hover { opacity: 1; }

/* ── Main Navbar ────────────────────────────────────────────── */
.k-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: var(--nb-height);
  background: var(--nb-bg);
  border-bottom: 1px solid var(--nb-border);
  transition: box-shadow .25s;
}
.k-navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10,10,10,.96);
}

/* Offset body so content doesn't hide under fixed navbar */
.k-page-content {
  padding-top: var(--nb-height);
}
/* Also handle announcement bar offset */
body.has-announce .k-navbar {
  top: 32px;
}
body.has-announce .k-page-content {
  padding-top: calc(var(--nb-height) + 32px);
}

.k-navbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  gap: .75rem;
}

/* ── Brand ──────────────────────────────────────────────────── */
.k-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: .5rem;
}
.k-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #c9a227, #f0c040);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #0a0a0a;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(212,175,55,.35);
}
.k-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.k-brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.k-brand-sub {
  font-size: .58rem;
  color: var(--nb-gold);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── Nav Links (desktop center) ─────────────────────────────── */
.k-nav {
  display: flex;
  align-items: center;
  gap: .1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.k-nav-link {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .75rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--nb-text);
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.k-nav-link:hover,
.k-nav-link.active {
  color: var(--nb-gold);
  background: var(--nb-gold-muted);
}
.k-nav-link i { font-size: .78rem; opacity: .8; }

/* Kategori dropdown trigger */
.k-nav-item { position: relative; }
.k-nav-link-drop::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: .55rem;
  margin-left: .2rem;
  transition: transform .2s;
  display: inline-block;
}
.k-nav-item:hover .k-nav-link-drop::after,
.k-nav-item.open .k-nav-link-drop::after { transform: rotate(180deg); }

/* Kategori dropdown panel */
.k-cat-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: #161616;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  box-shadow: var(--nb-shadow);
  padding: .4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s, visibility .18s, transform .18s;
  z-index: 1050;
}
.k-nav-item:hover .k-cat-dropdown,
.k-nav-item.open .k-cat-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.k-cat-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  font-size: .82rem;
  color: #aaa;
  text-decoration: none;
  border-radius: 8px;
  transition: background .12s, color .12s;
}
.k-cat-item:hover { background: var(--nb-gold-muted); color: var(--nb-gold); }
.k-cat-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: var(--nb-gold);
  flex-shrink: 0;
}
.k-cat-divider { height: 1px; background: rgba(255,255,255,.06); margin: .3rem .4rem; }

/* ── Search Bar ─────────────────────────────────────────────── */
.k-search {
  flex: 1;
  min-width: 0;
  max-width: 340px;
  position: relative;
}
.k-search-input {
  width: 100%;
  height: 38px;
  background: #161616;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 0 1rem 0 2.5rem;
  font-size: .82rem;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.k-search-input::placeholder { color: #555; }
.k-search-input:focus {
  border-color: rgba(212,175,55,.5);
  box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}
.k-search-icon {
  position: absolute;
  left: .875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  font-size: .78rem;
  pointer-events: none;
}

/* ── Right Actions ──────────────────────────────────────────── */
.k-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}

/* Icon button (cart, bell) */
.k-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #161616;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  color: #aaa;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.k-icon-btn:hover {
  color: var(--nb-gold);
  border-color: rgba(212,175,55,.4);
  background: var(--nb-gold-muted);
}

/* Badge on icon buttons */
.k-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  background: #dc3545;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid #0a0a0a;
  line-height: 1;
}
.k-badge-gold {
  background: linear-gradient(135deg, #c9a227, #f0c040);
  color: #0a0a0a;
}

/* ── Notification Dropdown ──────────────────────────────────── */
.k-notif-wrap { position: relative; }

.k-notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: #141414;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow: var(--nb-shadow);
  z-index: 1060;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity .18s, visibility .18s, transform .18s;
  overflow: hidden;
}
.k-notif-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.k-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.k-notif-head-title { font-size: .875rem; font-weight: 700; color: #fff; }
.k-notif-mark-all {
  background: none;
  border: none;
  font-size: .72rem;
  color: var(--nb-gold);
  cursor: pointer;
  padding: 0;
}
.k-notif-mark-all:hover { opacity: .75; }

.k-notif-list { max-height: 300px; overflow-y: auto; }
.k-notif-list::-webkit-scrollbar { width: 3px; }
.k-notif-list::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

.k-notif-item {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .75rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
  position: relative;
}
.k-notif-item:hover { background: rgba(255,255,255,.03); }
.k-notif-item.unread { background: rgba(212,175,55,.04); }
.k-notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--nb-gold);
}

.k-notif-ico {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(212,175,55,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; color: var(--nb-gold);
  flex-shrink: 0; margin-top: 1px;
}
.k-notif-body { flex: 1; min-width: 0; }
.k-notif-title { font-size: .8rem; font-weight: 600; color: #fff; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-notif-msg { font-size: .73rem; color: #666; line-height: 1.4; margin-bottom: 2px; }
.k-notif-time { font-size: .67rem; color: #444; }

.k-notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 2rem 1rem; color: #555; font-size: .82rem;
}
.k-notif-empty i { font-size: 1.75rem; }

.k-notif-footer {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1rem;
  font-size: .78rem; color: var(--nb-gold); text-decoration: none;
  border-top: 1px solid rgba(255,255,255,.06);
  transition: background .12s;
}
.k-notif-footer:hover { background: var(--nb-gold-muted); color: var(--nb-gold); }

/* ── Profile Button & Dropdown ──────────────────────────────── */
.k-profile-wrap { position: relative; }

.k-profile-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: #161616;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  padding: .3rem .75rem .3rem .3rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: #aaa;
  flex-shrink: 0;
}
.k-profile-btn:hover {
  border-color: rgba(212,175,55,.4);
  background: var(--nb-gold-muted);
  color: var(--nb-gold);
}

.k-profile-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.k-profile-avatar-init {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a227, #f0c040);
  color: #0a0a0a;
  font-size: .75rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.k-profile-name {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.k-profile-chevron {
  font-size: .55rem;
  transition: transform .2s;
  flex-shrink: 0;
}
.k-profile-btn.open .k-profile-chevron { transform: rotate(180deg); }

.k-profile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: #141414;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow: var(--nb-shadow);
  z-index: 1060;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity .18s, visibility .18s, transform .18s;
  overflow: hidden;
}
.k-profile-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.k-profile-head {
  padding: .875rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.k-profile-head-name { font-size: .875rem; font-weight: 700; color: #fff; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-profile-head-email { font-size: .72rem; color: #555; margin-bottom: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-profile-role {
  display: inline-block;
  background: rgba(212,175,55,.12);
  color: var(--nb-gold);
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.25);
  text-transform: capitalize;
}

.k-profile-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1rem;
  font-size: .83rem;
  color: #aaa;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.k-profile-item i { width: 15px; text-align: center; font-size: .78rem; flex-shrink: 0; }
.k-profile-item:hover { background: var(--nb-gold-muted); color: var(--nb-gold); }
.k-profile-item-admin { color: var(--nb-gold) !important; font-weight: 600; }
.k-profile-item-admin:hover { background: rgba(212,175,55,.15) !important; }
.k-profile-item-danger { color: #dc3545 !important; }
.k-profile-item-danger:hover { background: rgba(220,53,69,.1) !important; color: #dc3545 !important; }
.k-profile-divider { height: 1px; background: rgba(255,255,255,.06); margin: .25rem 0; }

/* ── Auth Buttons (guest) ───────────────────────────────────── */
.k-btn-login {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem;
  font-size: .8rem; font-weight: 600;
  color: var(--nb-gold);
  border: 1px solid rgba(212,175,55,.4);
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.k-btn-login:hover { background: var(--nb-gold-muted); border-color: var(--nb-gold); color: var(--nb-gold); }

.k-btn-register {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem;
  font-size: .8rem; font-weight: 600;
  color: #0a0a0a;
  background: linear-gradient(135deg, #c9a227, #f0c040);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
  white-space: nowrap;
}
.k-btn-register:hover { opacity: .9; transform: translateY(-1px); color: #0a0a0a; }

/* ── Hamburger ──────────────────────────────────────────────── */
.k-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: #161616;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.k-hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: #aaa;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.k-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.k-hamburger.open span:nth-child(2) { opacity: 0; }
.k-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Drawer ──────────────────────────────────────────── */
.k-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nb-height);
  left: 0; right: 0;
  background: #0d0d0d;
  border-bottom: 1px solid rgba(255,255,255,.07);
  z-index: 1029;
  padding: .75rem 1.25rem 1.25rem;
  max-height: calc(100vh - var(--nb-height));
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.k-mobile-menu.open { display: block; }

/* Mobile search */
.k-mobile-search {
  position: relative;
  margin-bottom: .875rem;
}
.k-mobile-search input {
  width: 100%;
  height: 42px;
  background: #161616;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 0 1rem 0 2.5rem;
  font-size: .85rem;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  outline: none;
}
.k-mobile-search input:focus { border-color: rgba(212,175,55,.4); }
.k-mobile-search i {
  position: absolute;
  left: .875rem; top: 50%;
  transform: translateY(-50%);
  color: #555; font-size: .8rem;
  pointer-events: none;
}

/* Mobile nav links */
.k-mobile-nav { list-style: none; padding: 0; margin: 0 0 .75rem; }
.k-mobile-nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .75rem;
  font-size: .875rem; color: #aaa;
  text-decoration: none;
  border-radius: 10px;
  transition: background .12s, color .12s;
}
.k-mobile-nav-link:hover,
.k-mobile-nav-link.active { background: var(--nb-gold-muted); color: var(--nb-gold); }
.k-mobile-nav-link i { width: 18px; text-align: center; font-size: .85rem; }

/* Mobile sub-menu (categories) */
.k-mobile-sub { padding-left: 1.5rem; display: none; }
.k-mobile-sub.open { display: block; }
.k-mobile-sub-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  font-size: .82rem; color: #777;
  text-decoration: none;
  border-radius: 8px;
  transition: background .12s, color .12s;
}
.k-mobile-sub-link:hover { background: var(--nb-gold-muted); color: var(--nb-gold); }

/* Mobile divider */
.k-mobile-divider { height: 1px; background: rgba(255,255,255,.06); margin: .5rem 0; }

/* Mobile action row */
.k-mobile-actions {
  display: flex; gap: .5rem; flex-wrap: wrap;
  padding-top: .5rem;
}
.k-mobile-actions .k-btn-login,
.k-mobile-actions .k-btn-register { flex: 1; justify-content: center; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .k-nav,
  .k-search,
  .k-notif-wrap,
  .k-profile-wrap,
  .k-btn-login,
  .k-btn-register { display: none !important; }

  .k-hamburger { display: flex; }

  /* On mobile, cart icon stays visible */
  .k-icon-btn.k-cart-btn { display: flex; }

  /* Notification & profile panels become bottom sheets */
  .k-notif-panel,
  .k-profile-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    transform-origin: bottom center;
    transform: translateY(20px) scale(.98);
    max-height: 80vh;
    overflow-y: auto;
  }
  .k-notif-panel.open,
  .k-profile-panel.open {
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 992px) {
  .k-hamburger { display: none; }
  .k-mobile-menu { display: none !important; }
}

@media (max-width: 1199.98px) {
  .k-search { max-width: 220px; }
  .k-profile-name { display: none !important; }
}

/* ── Overlay (mobile menu backdrop) ────────────────────────── */
.k-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1028;
}
.k-overlay.open { display: block; }

/* ── Page content offset ────────────────────────────────────── */
.page-content { padding-top: var(--nb-height); }
