/* --- GLOBAL THEME VARIABLES --- */
:root {
    --primary-teal: #1b8a73;     /* Your brand green */
    --secondary-yellow: #ffcc00; /* Your underline/accent color */
    --text-dark: #333333;
    --white: #ffffff;
    --bg-light: #f9f9f9;
    --shadow-medical: 0px 10px 30px rgba(0, 0, 0, 0.15);
    --transition: 0.3s ease;
}

/* --- MAIN DROPDOWN ALIGNMENT --- */
.dropdown {
    position: relative;
    display: inline-flex; /* Keeps it in line with Home, Products, etc. */
    align-items: center;
    height: 100%;         /* Helps with vertical centering */
}

.dropbtn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--white) !important; /* Matches your white nav text */
    text-decoration: none;
    padding: 0 15px;      /* Standard nav padding */
    font-size: 16px;      /* Adjust to match your other nav links */
    transition: color var(--transition);
    cursor: pointer;
}

.dropbtn:hover {
    color: var(--secondary-yellow) !important;
}

/* --- THE SCROLLABLE DROPDOWN CONTENT --- */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--white);
    min-width: 250px;
    
    /* SCROLLING LOGIC */
    max-height: 450px;    /* Height before scrolling kicks in */
    overflow-y: auto;     /* Vertical scroll on */
    overflow-x: visible;  /* CRITICAL: Allows sub-menus to fly out */
    
    /* VISUALS */
    box-shadow: var(--shadow-medical);
    z-index: 9999;
    border-radius: 0 0 8px 8px;
    border-top: 4px solid var(--secondary-yellow); /* Connects to nav bar accent */
    
    list-style: none;
    padding: 10px 0;
    top: 100%;            /* Aligns exactly at bottom of nav bar */
    left: 0;
    margin: 0;
}

/* Show on Hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* --- INDIVIDUAL CATEGORY LINKS --- */
.dropdown-content li {
    position: relative;
    width: 100%;
}

.dropdown-content li a {
    color: var(--text-dark) !important;
    padding: 12px 25px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    transition: all 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-content li:last-child a {
    border-bottom: none;
}

.dropdown-content li a:hover {
    background-color: var(--bg-light);
    color: var(--primary-teal) !important;
    padding-left: 30px; /* Modern slide effect */
}

/* --- SUB-MENU (Fly-out to the right) --- */
.has-submenu {
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    left: 100%;           /* Appear to the right */
    top: -10px;           /* Aligns with the parent category */
    background: var(--white);
    min-width: 220px;
    box-shadow: var(--shadow-medical);
    border-radius: 0 8px 8px 8px;
    list-style: none;
    padding: 10px 0;
    z-index: 10000;
}

.has-submenu:hover > .submenu {
    display: block;
}

/* --- PROFESSIONAL SCROLLBAR STYLING --- */
.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-teal);
}

/* --- LOGO & UTILITIES --- */
.logo img, .footer-logo img {
    height: 75px; /* Adjust as needed */
    width: auto;
    display: block;
    object-fit: contain;
}

#backToTop {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 999;
    background-color: var(--primary-teal);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .dropdown-content {
        position: static;
        max-height: none;
        box-shadow: none;
        border: none;
        display: none !important; /* Hide unless mobile toggle is active */
    }
    
    .logo img, .footer-logo img {
        height: 50px;
    }

    .dropbtn {
        color: var(--white) !important;
        padding: 10px 0;
    }
}