/* ============================================
   🌿 NAVBAR MODERN & PROFESIONAL (FINAL FIX SUBMENU + STICKY)
   ============================================ */
.navbar {
    background-color: #146A0E;
    position: relative;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Saat discroll jadi sticky */
.navbar.fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    animation: slideDown 0.4s ease forwards;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== Flex Container ===== */
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    margin: 0 auto;
    max-width: 1370px;
    width: 100%;
}

/* ===== Menu Utama ===== */
.navbar .ul {
    display: flex;
    flex: 1;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 28px;
    transition: all 0.4s ease;
}

.navbar .ul a {
    color: #fff;
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.3s ease, transform 0.2s ease;
    position: relative;
}

.navbar .ul a:hover {
    color: #CAF8BF;
    transform: translateY(-2px);
}

.navbar .ul a.active {
    color: #CAF8BF;
    font-weight: 600;
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: -12px;
    background-color: #146A0E;
    min-width: 220px;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 50;
    padding: 33px 0 22px 0
}

.dropdown-content a {
    display: block;
    padding: 12px 18px 12px 12px;
    color: #fff;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.3s ease, padding-left 0.3s ease;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background-color: #0f580c;
    padding-left: 22px;
}

/* Hover tampil dropdown */
.dropdown:hover .dropdown-content {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ===== Sub Dropdown (Level 2) ===== */
.dropdown-sub {
    position: relative;
}

.dropdown-sub > a::after {
    content: "›";
    position: absolute;
    right: 12px;
    font-size: 13px;
    opacity: 0.8;
}

/* Submenu Level 2 muncul di samping kanan */
.dropdown-sub-content {
    position: absolute;
    top: 0;
    left: 100%;
    background-color: #146A0E;
    min-width: 210px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 60;
    border-left: 1px solid rgba(255,255,255,0.1);
}

/* Area transparan agar hover tidak terputus */
.dropdown-sub-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: -10px;
    width: 10px;
    height: 100%;
}

/* Saat hover submenu aktif */
.dropdown-sub:hover > .dropdown-sub-content {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* Hover animasi halus */
.dropdown-sub-content a {
    font-size: 14px;
    padding: 10px 14px;
    transition: background 0.3s ease, padding-left 0.3s ease;
}

.dropdown-sub-content a:hover {
    background-color: #0f580c;
    padding-left: 20px;
}

/* ===== Hamburger Modern Elegan ===== */
.menu-toggle {
    display: none;
    width: 30px;
    height: 22px;
    position: relative;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.menu-toggle span {
    background: #fff;
    border-radius: 2px;
    position: absolute;
    height: 3px;
    width: 100%;
    left: 0;
    transition: all 0.4s ease;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 9px; }
.menu-toggle span:nth-child(3) { top: 18px; }

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 9px;
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 9px;
}

.menu-toggle:hover span { background: #CAF8BF; }

/* ============================================
   🌿 RESPONSIVE STYLING
   ============================================ */
@media (max-width: 768px) {
    .navbar { padding: 10px 18px; }

    .menu-toggle { display: block; }

    .navbar .ul {
        flex-direction: column;
        align-items: flex-start;
        background-color: #146A0E;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 20px 24px;
        gap: 15px;
        opacity: 0;
        transform: translateY(-15px);
        pointer-events: none;
        visibility: hidden;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.4s ease;
    }

    .navbar .ul.show {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: #0f580c;
        opacity: 1;
        pointer-events: auto;
        transition: none;
        width: 100%;
        margin-top: 5px;
        padding: 0;
        overflow: visible;
    }

    .dropdown-content a {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 10px 16px;
    }

    .dropdown-sub-content {
        position: static;
        background: #0d470b;
        opacity: 1;
        pointer-events: auto;
        margin-left: 10px;
        border-left: 2px solid rgba(255, 255, 255, 0.1);
        transform: none;
    }

    .dropdown-sub > a::after {
        content: "▼";
        right: 10px;
        transform: scale(0.9);
    }
}

/* ============================================
   🔍 SEARCH ICON & BOX (MODERN FLOAT)
   ============================================ */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 16px;
}

.search-btn {
    background: #146A0E;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
}

.search-btn:hover {
  color: #CAF8BF;
}

/* Search Box Floating */
.search-box {
  position: absolute;
  top: 62px;
  right: 0;
  width: 320px;
  background: rgba(20, 106, 14, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-15px);
  transition: all 0.35s ease;
  z-index: 999;
}

.search-box.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Input field */
.search-box input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border-radius: 6px;
  border: none;
  outline: none;
  font-size: 15px;
  color: #333;
}

/* Close button */
.close-search {
    position: absolute;
    width: fit-content;
    top: 11px;
    right: 10px;
    background: transparent;
    border: none;
    color: #0f580c;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-search:hover {
  color: #0c4809;
}

/* Hasil pencarian */
.search-results {
  margin-top: 12px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.search-results p.placeholder {
  color: #e8f9e5;
  font-size: 14px;
  text-align: center;
  opacity: 0.8;
}

/* Responsif */
@media (max-width: 768px) {
  .search-box {
    right: auto;
    left: 0;
    width: 90vw;
    top: 60px;
  }
}
