header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px 30px;
    background-color: #f4f4f4;
    font-size: 13px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
}

nav .logo img {
    height: 178px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-right: 50px;
    font-size: 15px;
    position: relative; /* Ensure dropdown content is positioned relative to the parent */
}

nav ul li a {
    text-decoration: none;
    color: #000;
    font-weight: bold;
}

nav ul li a:hover {
    color: #ff0000;
}

/* Animation for nav items */
.nav-item {
    opacity: 0; /* Start fully transparent */
    transform: translateY(20px); /* Start slightly below */
    animation: fadeIn 0.5s forwards; /* Apply fadeIn animation */
}

/* Keyframes for the fadeIn effect */
@keyframes fadeIn {
    from {
        opacity: 0; /* Fully transparent */
        transform: translateY(20px); /* Start below */
    }
    to {
        opacity: 1; /* Fully visible */
        transform: translateY(0); /* Normal position */
    }
}

/* Add delays for each nav item */
.nav-item:nth-child(1) {
    animation-delay: 0.2s; /* Delay for Home */
}

.nav-item:nth-child(2) {
    animation-delay: 0.4s; /* Delay for About Us */
}

.nav-item:nth-child(3) {
    animation-delay: 0.6s; /* Delay for Services */
}

.nav-item:nth-child(4) {
    animation-delay: 0.8s; /* Delay for Products */
}

.nav-item:nth-child(5) {
    animation-delay: 1s; /* Delay for Contact Us */
}



/* Ensure the nav bar is above other elements */
nav {
    position: relative;
    z-index: 1000; /* Ensure navbar stays above other content */
}

/* Dropdown Styles */
.nav-item {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1100; /* Ensure dropdown stays above slideshow */
    min-width: 200px;
    border-radius: 5px;
    overflow: hidden;
}

/* Fix dropdown overlapping issue */
.dropdown-content li {
    list-style: none;
    padding: 10px;
    font-size: 12px;
    border-bottom: 1px solid #ddd;
    transition: background 0.3s ease;
    position: relative;
    z-index: 1101;
}

.dropdown-content li:last-child {
    border-bottom: none;
}

.dropdown-content li a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 10px;
}

.dropdown-content li a:hover {
    background-color: #ff0000;
    color: #fff;
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
    display: block;
}


/* Tablet View (768px and below) */
@media screen and (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }

    nav {
        flex-direction: column;
        padding: 10px;
    }

    nav .logo img {
        height: 150px;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    nav ul li {
        margin: 10px 0;
    }

    /* Dropdown inside Mobile View */
    .dropdown-content {
        position: relative;
        width: 100%;
        display: none;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }
}

/* Mobile View (480px and below) */
@media screen and (max-width: 480px) {
    .top-bar {
        font-size: 10px;
    }

    nav .logo img {
        height: 150px;
    }

    nav ul {
        flex-direction: column;
        padding: 0;
    }

    nav ul li {
        font-size: 13px;
        margin: 8px 0;
    }

    .dropdown-content {
        width: 100%;
    }
}