/* ============================================
   CUSTOM NAVBAR STYLES
   ============================================ */

/* Reset za header */
.custom-header {
    position: relative;
    width: 100%;
    /* Ensure no overflow hidden on parent */
    overflow: visible !important;
}

/* Ensure body and html don't interfere with sticky */
html {
    overflow-x: hidden;
    overflow-y: auto !important; /* Force overflow-y visible */
    overflow-anchor: none; /* Disable scroll anchoring */
}

body {
    overflow-x: hidden;
    overflow-y: visible !important; /* CRITICAL: mora biti visible za sticky */
    position: relative;
    min-height: 100vh;
    /* Ensure sticky works */
    display: block !important;
    overflow-anchor: none; /* Disable scroll anchoring */
}

/* Ensure content wrapper doesn't block sticky */
.content-wrapper {
    position: relative;
    z-index: 1;
}

/* Top Bar - Crni bar sa kontakt info */
.top-bar {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    line-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px !important;
    transition: all 0.3s ease;
    overflow: visible !important;
}

.top-bar .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    height: 30px !important;
    line-height: 30px !important;
}

.top-bar-content {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    height: 30px !important;
    line-height: normal !important;
}

.top-bar-left,
.top-bar-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px;
    height: 30px !important;
    line-height: normal !important;
}

.top-bar a {
    color: #ffffff !important;
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
    display: inline-flex !important;
    align-items: center !important;
    height: 30px !important;
    line-height: normal !important;
    font-size: 12px !important;
}

.top-bar i {
    margin-right: 5px;
    font-size: 11px !important;
    display: inline-block !important;
}

/*Force horizontal layout on desktop */
@media (min-width: 992px) {
    .top-bar-content {
        flex-direction: row !important;
    }

    .top-bar-left,
    .top-bar-right {
        flex-direction: row !important;
    }
}



/* Top Bar - FIXED Position */
.top-bar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    transition: transform 0.3s ease;
}

/* Sakri top bar kada se skroluje */
body.scrolled .top-bar {
    transform: translateY(-100%);
}

/* Main Navbar - FIXED Position */
.main-navbar {
    background-color: #ffffff;
    position: fixed !important;
    top: 30px; /* Ispod top bara (30px visina) */
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000 !important;
    transition: top 0.3s ease, box-shadow 0.3s ease;
}

/* Kada se skroluje, pomeri navbar na sam vrh */
body.scrolled .main-navbar {
    top: 0 !important;
}

/* Placeholder za fiksni header */
body::before {
    content: '';
    display: block;
    height: 110px; /* Top bar (30px) + navbar (~80px) */
    transition: height 0.3s ease;
}

body.scrolled::before {
    height: 80px; /* Samo navbar */
}

/* Dodatni stilovi */
.top-bar {
    will-change: transform;
    contain: layout;
}

.main-navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/* Logo */
.navbar-logo h1 {
    font-size: 32px;
    font-family: "Maname", sans-serif;
    color: #000;
}

/* Fix for logo image if present */
.navbar-logo img,
.mobile-menu-header img,
.footer-logo-img {
    height: auto;
    width: auto;
    max-height: 100%;
    max-width: 100%;
}

/* Desktop Menu */
.navbar-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
    align-items: center;
}

.navbar-menu li {
    position: relative;
}

.navbar-menu li a {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 20px;
    color: #000;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 10px 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.navbar-menu li a:hover {
    transform: scale(1.02);
}

/* Dropdown Desktop */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border-radius: 5px;
    z-index: 9999;
    
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
    border-bottom: 1px solid #000000;
    width: 100%;
}

.dropdown-menu li a {
    padding: 10px 0;
    display: block;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: #f8f9fa;
}

/* Hamburger Button (samo na mobilnom) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    width: 40px;
    height: 40px;
    position: relative;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #333333;
    border-radius: 3px;
    transition: all 0.3s ease;
    position: absolute;
}

.hamburger span:nth-child(1) {
    top: 12px;
}

.hamburger span:nth-child(2) {
    top: 19px;
}

.hamburger span:nth-child(3) {
    top: 26px;
}

.hamburger.active span:nth-child(1) {
    top: 19px;
    transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    top: 19px;
    transform: rotate(-45deg);
}

/* Mobile Menu - klizi odozgo ispod navbara */
.mobile-menu {
    position: fixed;
    top: 110px; /* Ispod top bara (30px) + navbara (~80px) */
    left: 0;
    right: 0;
    width: 100%;
    max-height: 0;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 998;
    transition: max-height 0.4s ease, top 0.3s ease;
    overflow: hidden;
}

/* Kada je scrolled, pomeri menu na nižu poziciju */
body.scrolled .mobile-menu {
    top: 80px; /* Ispod samo navbara */
}

.mobile-menu.active {
    max-height: calc(100vh - 110px); /* Visina ekrana minus header */
    overflow-y: auto;
}

body.scrolled .mobile-menu.active {
    max-height: calc(100vh - 80px);
}

.mobile-menu-header {
    display: none; /* Sakri logo */
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0 20px;
}

.mobile-menu-list > li {
    border-bottom: 1px solid #000000;
}

.mobile-menu-list > li > a,
.mobile-menu-list > li > .mobile-dropdown-toggle {
    display: block;
    padding: 12px 20px;
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-list > li > a:hover,
.mobile-menu-list > li > .mobile-dropdown-toggle:hover {
    transform: scale(1.05);
}

.mobile-menu-list > li > a:active,
.mobile-menu-list > li > .mobile-dropdown-toggle:active {
    background-color: #f8f9fa;
}

/* Mobile Dropdown */
.mobile-dropdown-toggle {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.mobile-dropdown-toggle i {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.mobile-dropdown.active .mobile-dropdown-toggle i {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-dropdown.active .mobile-dropdown-menu {
    max-height: 500px;
}

.mobile-dropdown-menu li {
    border-bottom: 1px solid #e0e0e0;
}

.mobile-dropdown-menu li:last-child {
    border-bottom: none;
}

.mobile-dropdown-menu li a {
    display: block;
    padding: 12px 20px 12px 40px;
    color: #555555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-dropdown-menu li a:hover {
    transform: scale(1.03);
}

.mobile-dropdown-menu li a:active {
    background-color: #e9ecef;
}

/* Overlay nije potreban za dropdown menu */

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 991px) {
    /* Sakri desktop menu */
    .desktop-menu {
        display: none;
    }

    /* Prikaži hamburger */
    .hamburger {
        display: flex;
    }

    /* Top bar responsive */
    .top-bar-content {
        gap: 10px;
        text-align: center;
    }

    .top-bar-left,
    .top-bar-right {
        gap: 10px;
    }
}

@media (max-width: 768px) {
   

    .top-bar {
        font-size: 12px;
    }

    /* Mobilni padding */
    .top-bar .container,
    .main-navbar .container {
        padding: 0 20px;
    }

    

    /* Adjust mobile menu top for smaller screens */
    .mobile-menu {
        top: 110px;
    }

    body.scrolled .mobile-menu {
        top: 70px;
    }
}

@media (max-width: 480px) {

    /* Extra mali ekrani */
    .top-bar .container,
    .main-navbar .container {
        padding: 0 20px;
    }
}
